Guy Verville Posted July 22, 2018 Posted July 22, 2018 Hi, I thought I understood $object->trackChanges() behavior, but I am not so sure now. The code below if($p->parent_id != $dataBundle["parent"]) { $p->parent_id = $dataBundle["parent"]; } or this one $p->setLanguageValue("francais", "crm_description", $data['DescriptionFrancais']); is not recorded, while this one is $p->crm_description = $data['DescriptionEnglish']; I try to make a log file for a synchronization process with this code: $message = "<p><a href='$existingPage->httpUrl'>" . $existingPage->title; $message .= "</a> a été modifié (" . $existingPage->template . "). Changements aux champs => "; $messag .= implode("<br/>", $existingPage->getChanges()); Any idea?
Zeka Posted July 22, 2018 Posted July 22, 2018 @Guy Verville Take a look at this thread, maybe you will find something that solves your issue
Guy Verville Posted July 22, 2018 Author Posted July 22, 2018 (edited) Hi Zeka, Unfortunately, changing to $existingPage->setTrackChanges(Wire::trackChangesOn | Wire::trackChangesValues); does not worked. I realized though that putting true in getChanges, gives me an array of all the values of the field. $changes = $existingPage->getChanges(true); $implodedChange = ""; foreach($changes as $key => $change){ $implodedChange .= $key . "=>" . implode(",",$change) . "<br/>"; } However, the $existingPage->parent_id is still not caught... I think I will have to track this with my own code. Edited July 22, 2018 by Guy Verville completion of message
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