disable set formatter when $_POST['data']['field'] is not set

disable set formatter when $_POST['data']['field'] is not set

perrotinperrotin Posts: 39Questions: 9Answers: 1

hello,

I'm using editor serverside with editor PHP.
I've added nullEmpty formatter on several fields.
My problem occurs when I try to send a 'edit' request to the json page without specifiing every single fields. (I just want to edit a single field, for example an order field that is used for ordering the table).
In that case, every field with NullEmpty set formatter are set to NULL. (which is quite normal)
I'm wondering if it is possible to disable set formatter on a field when the $_POST['data']['field'] value is not set, so that the update only take place if the field value is send into the post to the json page.

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin

    This should actually be the case already. The "empty" part refers to if the value submitted is an empty string. If there is no value submitted at all, the field shouldn't be acted upon at all. This is worth Editor 1.5+. Editor 1.4 and earlier had slightly different behaviour.

    Can you let me know the version of Editor you are using and show the PHP code you are using?

    Allan

  • perrotinperrotin Posts: 39Questions: 9Answers: 1

    Thanks Allan for your answer.
    The behavior that I described above happened with editor 1.4.
    I'm glad to know that it no longer happens with 1.5.

    Julian

This discussion has been closed.