Juergen Posted October 29, 2017 Share Posted October 29, 2017 Hello, I have a hook which should copy the value of one field to another on special type of templates: $pages->addHookBefore('saveReady', function($event) { $page = $event->arguments(0); $page->setOutputFormatting(false); if(in_array($page->template->name, array('event_specialbusinesshours', 'single-special-business-hours'))) { $page->endeventdate = $page->starteventdate; } }); The field value will be copied -> this works. The 2 fields are requiered. After pressing the save button I got the following message that the value is missing, but it is still there To eliminate this error I could set the second field to not required, but I want an explanation why a copied value with "hook before saveready" leads to such an error-message. Does the validation take place before this hook. If yes, which hook method should be used instead? Best regards Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now