Page 1 of 1

Save As Copy Not Working

Posted: 2022-04-14 18:12
by rpierce
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 4662 times
Capture_server.JPG
Server indexes
Capture_server.JPG (34.23 KiB) Viewed 4662 times

Re: Save As Copy Not Working

Posted: 2022-04-16 14:41
by Moh Youba
Hello

I found the same issue today

Re: Save As Copy Not Working

Posted: 2022-04-26 21:47
by rpierce
Does anyone have a suggestion??

Re: Save As Copy Not Working

Posted: 2023-06-21 11:13
by G Scott
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?

Re: Save As Copy Not Working

Posted: 2023-06-23 18:58
by a.gneady
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.

Re: Save As Copy Not Working

Posted: 2023-06-24 13:17
by D Oliveira
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

Re: Save As Copy Not Working

Posted: 2023-06-24 18:34
by a.gneady
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 4093 times

Re: Save As Copy Not Working

Posted: 2023-10-24 16:29
by rpierce
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 3232 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 3232 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

Re: Save As Copy Not Working

Posted: 2023-10-25 00:08
by rpierce
UPDATE:

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

Re: Save As Copy Not Working

Posted: 2024-02-08 14:01
by mysh_eireannach
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

Re: Save As Copy Not Working

Posted: 2024-02-21 21:31
by cmalimoglou
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....

Re: Save As Copy Not Working

Posted: 2024-03-09 11:17
by onoehring
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 957 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

Re: Save As Copy Not Working

Posted: 2024-09-20 17:31
by rpierce
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

Re: Save As Copy Not Working

Posted: 2024-09-30 07:15
by onoehring
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

Re: Save As Copy Not Working

Posted: 2024-09-30 08:00
by jsetzer
@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.

Re: Save As Copy Not Working

Posted: 2024-09-30 08:36
by onoehring
Hi Jan,

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

Olaf

Re: Save As Copy Not Working

Posted: 2024-09-30 09:44
by jsetzer
Thank you Olaf, I am happy when my contributions are valued by the community.