Editor editing issue? Can edit text, but not clear the text.
Editor editing issue? Can edit text, but not clear the text.
I'm using Datatables with the New, Edit, Delete buttons. I can select a row and Edit the displayed data (replace content with new content) and the changes are Updated to the database. However, when I Edit the same row (or any other row) and clear a field's text by deleting all of the existing text in the field, the Update change is not saved to the database. Can anyone advise me on how to correct this issue? Note: if I delete all of the text and instead replace it with one press of the spacebar, I can get the text to be removed from the database (and replaced with the space).
Replies
Can you show me your server-side code please? I'm not immediately sure why that would be, but it sounds like the server is ignoring the field if it is being submitted as an empty value (which should be perfectly legal and valid, as you will be able to see it working in the Editor examples).
Allan
Here is the code. I'm trying to clear the text in 'machine_desc'.
-Thanks.
That's very odd. Can you also show me the client-side code? Could you also confirm if it works in my examples for you (it does appear to work okay for me)?
Thanks,
Allan
I will not be surprised if I caused my own problem. Still in learning mode.
Here is my client side js.
I ran the simple bubble-editing example on my server and it works well. I used the Editor-PHP-1.5.6 folder to do so. Since my code is in a separate folder, I'm wondering if I'm missing some important file in my path.
Allan,
In my HTML file I am now referencing the following js. I used the Download Builder tool at datatables.net and if I recall correctly chose just about everything.
I took the js references from the simple.html file example for simple bubble-editing (which works on my server) and replaced my download builder version with the following references. I could no longer display my data when I did this.
When I added my download builder version beneath the following group I could then again display data, but still could not edit. I'm not sure if this helps at all.
Allan,
I used Download Builder to create another css/js file. Still getting the same results where I cannot clear a text field using Datatables and Editor. Not sure what else to check.
This gets odder and odder! Everything you have done looks right to me!
Are you able to PM me a link to the page so I can check it out and attempt to debug it live? To send me a PM click my name above and then "Send message".
Thanks,
Allan
FYI...
I updated the Suhosin Php extension as recommended by Allan and that resolved the issue.
Hi Bob,
What I did to find out what was going on was to add:
as the very first line in the file Editor sends the Ajax edit request to. It showed that anything that was submitted with an empty string was being stripped out before any of the user space code ran. That meant it had to be PHP itself or a plug-in. I'm not aware of any PHP config option that would cause that and the issue link linked to for suhosin indicates that the error is there - your server is running exactly the same version as they indicate is buggy (0.9.36).
Regards,
Allan