Jump to content

Problem with field validation and values added via saveReady hook


Juergen
 Share

Recommended Posts

Hello @ all,

I cannot find a solution for this behavior:

I want to validate a field which value is sometimes filled out manually and sometimes via a hook.

The custom validation was done with this type of hook:

$pages->addHookAfter("InputfieldDatetime::processInput", function($event) {

The hook for adding a value in this field is done via this type of hook:

$pages->addHookBefore('saveReady', function($event){

The 2 hooks work but the problem is that "processInput" runs before "saveReady" and so I always get the error that the field is empty. But the value will be added correctly if you can see at the following screenshot.

screenshot-www.juergen-kern.at-2017-11-06-19-21-57.png.9bc664a1ed89b10b7d05ce8b8dab0b80.png

If I fill out the value manually everything works. So which type of hook runs before "processinput" and can be used to populate a field with a value.

Thanks

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...