editor $_POST data processing

editor $_POST data processing

rwgreenwoodrwgreenwood Posts: 43Questions: 13Answers: 0

I am having a problem with processing columns before updating in the Editor. We recently moved to Editor 1.5 and what we had earlier is no longer working. The goal is to hash a password as well as save a random salt value. Our original PHP code did something like this:
$_POST['data']['password'] = hash('sha512', $password . $random_salt);
$_POST['data']['salt'] = $random_salt;

However, when I look in the $_POST array now, it is structured like this:
$_POST[data][row_156][password] (note the additional level of the row #)
So the old code obviously doesn't work.

Is there a setting for a single edit that will leave out the row # level? All the forums and document I can find still recommend using
the structure of $_POST['data']['password'] but that isn't how the POST variables appear to be structured anymore.

Thanks in advance.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,824Questions: 1Answers: 10,130 Site admin
    Answer ✓

    Hi,

    The 1.5 upgrade documents cover the client / server change in detail and also note that legacyAjax can be used to revert to the old style. However, you should be aware that the 1.5 libraries (PHP and .NET) will not work with the old style.

    I would suggest using server-side events which were introduced with 1.5 in order to make exactly this kind of thing easier.

    Regards,
    Allan

  • rwgreenwoodrwgreenwood Posts: 43Questions: 13Answers: 0

    Thanks, Alan, I was trying the preEdit event but somehow missed the ->setValue in the docs.

This discussion has been closed.