Support » Plugin: WP Data Access » Problem updating records with NOT NULL column rule

  • I have a table definition with lots of columns defined as NOT NULL. (@passionate programmer, it’s the TONI database, you have a copy).

    When the table was loaded / updated these columns have been filled with empty strings (”). Now when we try to update the row in the WPDA backend, using a project, updates are rejected with the message “Please fill in this field” when the Save button is pressed. The field has a value of empty string, which is not the same a NULL.

    Is this a bug? A feature? or…..?

    Charles

    • This topic was modified 4 months, 4 weeks ago by charlesgodwin.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi Charles,

    It’s a feature! 😊 A bit confusing, but let me explain…

    When you add a new row, the plugin will check for not null columns. Please try, and you will see then not null columns must be entered. The plugin does not accept empty strings for not null columns on insert.

    This is different with updates. I noticed that many WordPress users and developers enter empty strings in not null columns. Although this is not the idea of a not null column, it is not wrong either. On update the plugin accepts empty strings, which is acceptable because the column already contained an empty string before the user started the update.

    Hope I explained myself clear enough and it makes sense. If you have a better idea, I’m listening…

    Best regards,
    Peter

    Thread Starter charlesgodwin

    (@charlesgodwin)

    Peter

    Yes you explained yourself well and I understand the problem with insert / add. But… my question dealt with update / exit. I can reproduce the problem by just clicking on the edit icon of a row and after the edit popup is drawn , I just prerss save, making no changes. that is when I get the error.

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi Charles,

    Sorry, but I cannot reproduce this error. Can you mail me a record which returns this error? Maybe I can import it and see if that helps to reproduce the error.

    Do you get the error directly in the browser or is it part of the server response?

    Thanks,
    Peter

    Thread Starter charlesgodwin

    (@charlesgodwin)

    I’ll work on it today.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.