Save As Copy Not Working

Please report bugs and any annoyances here. Kindly include all possible details: steps to reproduce, expected result, actual result, screenshots, ... etc.
Post Reply
rpierce
Veteran Member
Posts: 271
Joined: 2018-11-26 13:55
Location: Washington State

Save As Copy Not Working

Post by rpierce » 2022-04-14 18:12

Hello,

I have an app set up to Save Child Records when the Parent record is "Saved As Copy". The functionality works great on my Local computer but does not work on the server. The databases are identical except for the "Cardinality", which I have no idea about. Images Below. I need the "Save As Copy" functionality. I hope someone can help.
Capture-local.JPG
Local computer indexes
Capture-local.JPG (37.01 KiB) Viewed 5008 times
Capture_server.JPG
Server indexes
Capture_server.JPG (34.23 KiB) Viewed 5008 times

Moh Youba
Veteran Member
Posts: 235
Joined: 2017-03-12 09:31

Re: Save As Copy Not Working

Post by Moh Youba » 2022-04-16 14:41

Hello

I found the same issue today

rpierce
Veteran Member
Posts: 271
Joined: 2018-11-26 13:55
Location: Washington State

Re: Save As Copy Not Working

Post by rpierce » 2022-04-26 21:47

Does anyone have a suggestion??

G Scott
Posts: 20
Joined: 2018-02-25 00:02

Re: Save As Copy Not Working

Post by G Scott » 2023-06-21 11:13

I'm having the same issue.
I've been using a shared server for a few years now, and suddenly last week, child records are no longer copying when I Save As Copy.
I have not updated my app or changed any code. I have not changed any settings in the webhosting cPanel either.

I believe the webhost has changed server settings/configuration which has caused the issue.
Unfortunately, there are no errors in the php error log. So I'm a bit stumped as to identifying the problem.

I have raised a support ticket with the web host, but so far they have not been much help.

Does anyone have any suggestions on what could be causing this or how I can identify the cause?

User avatar
a.gneady
Site Admin
Posts: 1320
Joined: 2012-09-27 14:46
Contact:

Re: Save As Copy Not Working

Post by a.gneady » 2023-06-23 18:58

Save as copy feature depends on the php_curl extension. If that extension has been removed during a server upgrade, the feature would stop working. To check this, please go to the admin area > Utilities menu > Server status. From there, check if Curl extension is enabled under the 'PHP Info' section.
:idea: AppGini plugins to add more power to your apps:

User avatar
D Oliveira
AppGini Super Hero
AppGini Super Hero
Posts: 354
Joined: 2018-03-04 09:30
Location: David

Re: Save As Copy Not Working

Post by D Oliveira » 2023-06-24 13:17

a.gneady wrote:
2023-06-23 18:58
...please go to the admin area > Utilities menu > Server status. From there, check ...
I don't have this problem but I'm curious about this server status page location, it doesnt show in my utilities menu (appgini 22.14)

https://pasteboard.co/su4gtIFO16KR.png

User avatar
a.gneady
Site Admin
Posts: 1320
Joined: 2012-09-27 14:46
Contact:

Re: Save As Copy Not Working

Post by a.gneady » 2023-06-24 18:34

D Oliveira wrote:
2023-06-24 13:17
I don't have this problem but I'm curious about this server status page location, it doesnt show in my utilities menu (appgini 22.14)
You can enable it in your AppGini project:
Screenshot 2023-06-24 213335.png
Screenshot 2023-06-24 213335.png (34.43 KiB) Viewed 4439 times
:idea: AppGini plugins to add more power to your apps:

rpierce
Veteran Member
Posts: 271
Joined: 2018-11-26 13:55
Location: Washington State

Re: Save As Copy Not Working

Post by rpierce » 2023-10-24 16:29

Hello Again,

This issue with Save As Copy keeps resurfacing. It is a very important function for our app but seems very unstable. I have made some minor changes to the app and it works great in Xampp. When I upload it to the server Save As Copy ceases to work. I have the old version of the app still on the server and the Save As Copy functions as expected. I must revert to the old version of the app until I can get this figured out. The images below are from the new version of the app where Save As Copy is not working.

I'm using AppGini Version 23.14.

PHP curl is enabled - is there a curl setting that might be the culprit?
php-curl.JPG
php-curl.JPG (51.41 KiB) Viewed 3578 times
Settings for children are set to Copy = Yes (the ones we need to have copied to the new record)
child-settings.JPG
child-settings.JPG (55.76 KiB) Viewed 3578 times
This unpredictable nature of the Save As Copy function is very frustrating. We depend on it working. Can someone please help me to understand why this continually happens? Please and thank you!

Ray

rpierce
Veteran Member
Posts: 271
Joined: 2018-11-26 13:55
Location: Washington State

Re: Save As Copy Not Working

Post by rpierce » 2023-10-25 00:08

UPDATE:

I re - FTP'd the app to the server and now Save as Copy is working!! A ghost in the machine....

mysh_eireannach
Veteran Member
Posts: 36
Joined: 2016-02-16 22:31

Re: Save As Copy Not Working

Post by mysh_eireannach » 2024-02-08 14:01

Hi All

I have same issue with Save As Copy Stop Working.

Presume after server update

Checked my server

Image

Contacted my provider, customers service said switch off ModSecurity at cPanel

Image

I switched off ModSecurity, but no changes

My AG version 23.11

Thanks

cmalimoglou
Posts: 4
Joined: 2020-10-26 16:04

Re: Save As Copy Not Working

Post by cmalimoglou » 2024-02-21 21:31

Dear all,

I face the same problem with the "Save as Copy" and the children records, dispite the fact that cURL is enabled (version: 7.87.0).
Any suggestion for the problem solving??

Thanks in advance....

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1205
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: Save As Copy Not Working

Post by onoehring » 2024-03-09 11:17

Hi,

in conjunction with my previous bug report ( viewtopic.php?f=11&t=5342 ) I also noticed, that the option "copy child records when copying parent" does not seem to work (AG: 24.10 rev 1579). I have an attached child table that holds only links to attached files. Not a single child record is being duplicated - the parent record is duplicated correctly.

Initially I did not have this enabled but after reporting the previous bug I got curious. I checked the box, regenerated the app and flushed my browser cache.
ag_err_copychildren.png
ag_err_copychildren.png (71.33 KiB) Viewed 1303 times
cURL IS enabled (though I am nut sure, why it's needed. Just copying a record could be handled in a different way.

Olaf

rpierce
Veteran Member
Posts: 271
Joined: 2018-11-26 13:55
Location: Washington State

Re: Save As Copy Not Working

Post by rpierce » 2024-09-20 17:31

Hi Folks,

Again, I'm struggling with the "Save as Copy" function. I have a Parent table named Daily Report. This table has 7 child tables. When I use the save as copy function, 6 of the 7 tables copies fine. I've run it locally and on the server. cURL is active, obviously since 6 of the child records copy.

I've upgraded to the latest AppGini version (24.17 revision 1725) to see if that helps but with no success. I've checked and rechecked the settings for the problem table and everything appears to be set up correctly. I've installed the app in a new directory with no success. I hope someone can help.

Thanks,

Ray
Attachments
daily rpt settings.JPG
daily rpt settings.JPG (44.8 KiB) Viewed 556 times
children settings.JPG
children settings.JPG (62.17 KiB) Viewed 556 times

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1205
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: Save As Copy Not Working

Post by onoehring » 2024-09-30 07:15

Hi,

just a suggestion: Could there be a field definition in the "remarks" table that does not allow duplication of a record? Maybe you have define a field to be unique. As copying would create a new record with that exact field, it would seem logical to me that the copy would fail.
If this is not the reason, we would need more input about your table design.

Olaf

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1891
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Save As Copy Not Working

Post by jsetzer » 2024-09-30 08:00

@BigProf:
Apart from problems* which seem to occur from time to time when cURL-cloning sub-records:
We should get more influence over the new data set that is created when duplicating.

I suggest that we should get a new hook function TABLENAME_before_duplicate(&$data, $memberInfo, &$args) : bool for this, in which we can change $data according to our own requirements.

This would have the following advantages:
  • We can modify any field, for example build custom unique id's, update timestamps, make use of currently logged in user etc.
  • We could prevent duplication by returning FALSE.
  • We could set certain values ​​that we could evaluate in the _after_insert hook, later on.
  • It remains 100% backwards compatible: if this hook function does not exist, everything remains in the standard
As an alternative
AppGini could give us some extra info in $args-array for us to see if this is a (new/blank) insert or a record-duplication.

---
Note to myself
In before_insert-hook we can check for any data, breaking constraints, and then change $data accordingly before AppGini inserts it. Also, we can return FALSE there to deny insert.

---
* I know, this will not solve the issue reported here.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.14 Revision 1665 + all AppGini Helper tools

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1205
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: Save As Copy Not Working

Post by onoehring » 2024-09-30 08:36

Hi Jan,

thank you for your great input. I admire how structured your suggestions (always) are. Thanks

Olaf

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1891
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Save As Copy Not Working

Post by jsetzer » 2024-09-30 09:44

Thank you Olaf, I am happy when my contributions are valued by the community.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.14 Revision 1665 + all AppGini Helper tools

mysh_eireannach
Veteran Member
Posts: 36
Joined: 2016-02-16 22:31

Re: Save As Copy Not Working

Post by mysh_eireannach » 2024-11-19 13:46

Hi

Looks very strange situation. With version 5.82 all work as should. But with latest version 24.18 not :?

Actually with default settings, app copy child records, but not add new parent ID

Image

In my sample mobilization_id

I tried Jsetzer suggestion, not helps.

Thanks

Post Reply