Hi
I had a chat ticket with Waqar an hour ago, which he marked as resolved, but unfortunately it is not resolved, and I cannot see it under my list of tickets.. Here's the transcript.. Please re-open the ticket...
Thanks and regards
Simon
=================
Dear customer,
Ticket "Issue editing the existing custom code snippets" has been marked as Resolved by supporter.
Below is transcript of the chat:
Issue editing the existing custom code snippets
Toolset Support Bot : Hi, before assigning your chat to Waqar, please describe in details, what is happening - note that there are buttons below that can help you add debug information, screens and more
simonM-5 : Hi Support
Our Custom Code Snippet sections is giving errors when trying to save items.
If I create a new item, it gets created OK.
I cannot update or delete any items. I get the error message:
\"There was an error when updating snippets.\"
I saw this post
https://toolset.com/forums/topic/cannot-save-custom-code-snippet/ which describes something similar, however the error message is different.
Also checked that the following are not present in the wp-config.php file
define( \'DISALLOW_FILE_EDIT\', true );
define( \'DISALLOW_FILE_MODS\', true );
Also checked that the folder and contents have read and write permissions (see screenshot).
I can workaround this for the moment by moving files back and forth with FTP, but that\'s not ideal and is prone to errors. I would like to get this working again from the GUI.
Also, if I create a new snippet, eg test.php and then delete it via the FTP server, it is no longer visible in the GUI, but if I then try to re-create test.php in the GUI, it is somehow remembering that I had such a file before - where is this information being stored in the database?
Thanks and regards
Simon
Waqar : Hi,
Thank you for contacting us and I\'d be happy to assist.
I\'m currently reviewing your question for more details. Please wait
Waqar : Thank you for waiting.
Have you checked the server\'s error logs to see if any other error or warning is logged related to this?
Waqar : As for the database storage, Toolset stores the information about these code snippets in a serialized format in the options table under the name \"toolset_code_snippet_options\".
Waqar : Are you with me Simon?
simonM-5 : Yes, I was looking in the wp_options table
Waqar : I\'ll recommend making a backup of your existing custom code snippets and then delete existing files and the \"toolset_code_snippet_options\" record from the options table.
In case the issue still persists, you check the server\'s error logs for any error or warning and also test the clone/snapshot of this website on a different server.
If the custom snippet feature works properly on a different server, then you\'ll need to consult your hosting support team to see if there is any security measure in placed, which can stop the editing of PHP files.
simonM-5 : OK, but if I replace the files on the server, will the record in the database be updated correctly then?
Waqar : Yes, when there will be no \"toolset_code_snippet_options\" record in the options table it will be re-created when you\'ll create a new file through the GUI.
An important part is that no existing snippet file should be left in the \"wp-content/toolset-customizations\" folder.
simonM-5 : OK, my question is - if I manually add files to the folder, is the database record updated? Or are updates only registered there when created via the GUI.
I want to avoid having to create all snippets again via the GUI if I can just drop the files into the newly created toolset_customisations folder
Waqar : No, I\'m afraid, the database record will be updated only when the files will be added/edited through the GUI.
simonM-5 : One further question - does deleting a snippet via the GUI update the record to remove the existing (used) slug?
simonM-5 : OK, just so I\'ve understood correctly, you\'re suggesting I cut and paste all the snippets again cleanly via the GUI to have everything registered correctly after backup and deletion?
Waqar : > One further question - does deleting a snippet via the GUI update the record to remove the existing (used) slug?
- yes when the snippet will be deleted through the GUI, it will update the record in the database and the same slug would be available to be recreated too.
Waqar : > OK, just so I\'ve understood correctly, you\'re suggesting I cut and paste all the snippets again cleanly via the GUI to have everything registered correctly after backup and deletion?
That is correct because the data is saved in a serialized form, it is possible that some conflict has arisen due to manual direct manual changes.
You\'re also welcome to check the server\'s error logs first.
simonM-5 : OK, I understand, thanks. We had a virus recently and I replaced the folder after backup, so that\'s probably where all this started. I\'ll cut and paste all the snippets again and see how things go
Waqar : You\'re very welcome and feel free to reach us anytime - we\'re here to help!
The state of this thread is:
Resolved