MyBB Community Forums

Full Version: Validate thread on edition
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there,

I'm facing a little trouble with ABP Caps limiter: I want to revalidate the thread if someone edits the first post in full mode (allowing to modify title). But can't find the good hook:
  • datahandler_post_validate_thread seems to work only with new thread
  • datahandler_post_update_thread doesn't revalidate, the update query is alway executed

Do I miss something ?

Thanks
Without looking too closely, is it possible that in the datahandler_post_update_thread hook, you manually, yourself, call the validate_thread() method, and, if it fails, reset thread_update_data to the current values, such that nothing is actually changed when the update query is subsequently executed?
That's the idea I had, but I dislike it because I want to be able to block the submission (with warning) and force the user to change by himself the updated title.
It's not essential, but users may not understand why the edition of the title doesn't work.
Understood. How, then, about hooking in to datahandler_post_validate_post, given that the data handler's validate_post() method is called in editpost.php prior to its (the data handler's) update_post() method being called in that same file?