Jump to content

Recommended Posts

Posted

I'm looking to check if $page->modifiedUser has changed in a (saveReady) hook.

$page->getChanges() doesn't contain modified_user_id, or modified (I think that is set by mySQL).

Any pointers?

Posted

works as expected on other fields, including status.



public function hookSaveReady(HookEvent $event){
    $page = $event->arguments[0];
    $changes = $page->getChanges();

    foreach ($changes as $change) {
        $this->session->message($change);
    }
}

Posted

I'll need to dig a little further….

if I check $page->ModifiedUser from saveReady, it still shows the value currently in the DB, not the value of the user who is saving this page.

Posted

I had looked a little more at the core code yesterday and the only thing that seemed to be able to cause this would be disabling trackChanges for that case. Or even not changing anything.

Posted

If I set 

$page->modifiedUser = $this->user 

in my saveReady hook, then $page->getChanges() has modified_users_id.

This works, and will allow me to move on. Would be nice to know if there is a "proper" way.

Posted

I'm kind of rushing to get this out the door—so I'm just looking quickly—but it appears there is a quiet mode which probably explains why it's not there.

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
  • Recently Browsing   0 members

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