Open
Description
Short description of the issue
Default value of Integer field triggers change detection in hook.
Steps to reproduce the issue
- Create an Integer field with a default value (zero).
- Add the field to a page.
- Create a saveReady hook:
$this->addHookBefore('Pages::saveReady',
function (HookEvent $event): void {
/** @var Page $page */
$page = $event->arguments(0);
$changes = $page->getChanges(true);
if ($changes) {
var_dump($changes);
exit();
}
}
);
- Save the page without any change and see that there is a change detected on the Integer field.
- Edit the Integer field configuration and remove the default value.
- Save the page without any change and see that no change is detected anymore.
Setup/Environment
- ProcessWire version: 3.0.228