saleo Posted 5 hours ago Share Posted 5 hours ago Hello. I'm trying to track the changes of a textarea field. The field has a TinyMce inputifeld configured and Markup/Html as content type. To track the changes I use this hook in the init.php: wire()->addHookBefore('Pages::saveReady', function($event) { $page = $event->arguments(0); if($page->template->name === 'wiki-page'){ if($page->isChanged('body')){ bd($page->getChanges()); //using Tracy here } } }); The issue is that the isChanged method returns ['body'] even if the body field has not changed, but only when some type of markup is present. For example, if I put some simple formatted text and I save the page, the changes are tracked correctly. But if I put a <table> or a <ol> in the body, when I save the page the isChanged method returns always ['body'], even if I have not changed anything. Am I doing something wrong with the hook? Maybe the saveReady is not the correct place to track changes? Or is this a Processwire issue? I'm using Processwire 3.0.227, the only extra plugins installed are ProcessDatabaseBackups and TracyDebugger, and I'm using php 8.2.4 in a Mamp Pro installation on MacOs. Thank you! Leo Link to comment Share on other sites More sharing options...
bernhard Posted 2 hours ago Share Posted 2 hours ago Maybe these links help? https://processwire.com/blog/posts/new-ajax-driven-inputs-conditional-hooks-template-family-settings-and-more/#new-conditional-hooks 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