we have a MySQL table that gets used with Front End Editing.
Until now the Primary-Key in this table was a 16 digit long number. Since we're switching the program that feeds data into the table, this will change to a longer alphanumerical identifier.
This is permitted by the MySQL table settings (nvarchar(45)) and the data type in wpdatatables is set to "string", for this column.
The problem is, as soon as we have a single row with the new Primary Key format in the table, it is not possible to edit any entry in the table through wpdatatables. It gives out an error for a duplicate Primary Key value when you try.
If you delete all the letters from the new Primary Key it will give out a success, but no change will be applied.
If you then shorten the new Primary Key to the length of the old format, it is possible to edit again.
If you empty the table and only have entries with the new Primary Key format it is possible to edit again, but that would cause a lot of extra work.
Is there some form of Data-Type interpreting going on?
This is happening on Version 6.2 of wpdatatables.
Update: The cause of the issue might be a bit different. I have tried updating all the existing Primary Keys in length and adding some letters.
Then it told me that the Primary Key column required a default value (when editing).
When I set the default value it created a new row with the default value and the edit that I did.
I feel like it was trying to create a new row all along but I do not understand why it would do that all of a sudden, when all that was changed was the length of the data.
I am delighted to hear that this has been resolved. Thank you for letting us know.
Anything else that we could assist with, please don't hesitate to create new tickets.
Hello,
we have a MySQL table that gets used with Front End Editing.
Until now the Primary-Key in this table was a 16 digit long number. Since we're switching the program that feeds data into the table, this will change to a longer alphanumerical identifier.
This is permitted by the MySQL table settings (nvarchar(45)) and the data type in wpdatatables is set to "string", for this column.
The problem is, as soon as we have a single row with the new Primary Key format in the table, it is not possible to edit any entry in the table through wpdatatables. It gives out an error for a duplicate Primary Key value when you try.
If you delete all the letters from the new Primary Key it will give out a success, but no change will be applied.
If you then shorten the new Primary Key to the length of the old format, it is possible to edit again.
If you empty the table and only have entries with the new Primary Key format it is possible to edit again, but that would cause a lot of extra work.
Is there some form of Data-Type interpreting going on?
This is happening on Version 6.2 of wpdatatables.
Update: The cause of the issue might be a bit different. I have tried updating all the existing Primary Keys in length and adding some letters.
Then it told me that the Primary Key column required a default value (when editing).
When I set the default value it created a new row with the default value and the edit that I did.
I feel like it was trying to create a new row all along but I do not understand why it would do that all of a sudden, when all that was changed was the length of the data.
Nevermind, I figured it out.
I wasn't aware that the editing requires an Integer ID column and that it says so in the tooltip.
Created a separate column for it, and now it works.
Hello,
I am delighted to hear that this has been resolved. Thank you for letting us know. Anything else that we could assist with, please don't hesitate to create new tickets.
Have a great day! :)
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables