on_page_update not fired
Permalink
I'm trying to use on_page_update to hook into the update process but it never gets called.
(ENABLE_APPLICATION_EVENTS is enabled)
Page::update never gets called too and due to this the event doesn't get fired...
Any ideas why Page::update isn't used when I "update" the page"?
Thanks!
(ENABLE_APPLICATION_EVENTS is enabled)
Page::update never gets called too and due to this the event doesn't get fired...
Any ideas why Page::update isn't used when I "update" the page"?
Thanks!
is there really no one interested in helping me to improve c5's performance?
Very true. It's only fired when you update meta_data.
IMHO, we need to know (or define) what to be considered a page update. Could be:
- A page's (collection) direct updates, e.g. page properties, permissions, versions, design, and maybe other stuff.
- Any update related to the page, e.g. block add/remove/edit
My 2 cents: Since most of the work is actually on block level, it may help to have block level events, from which you can derive the page where the block is located, and then do the required action.
IMHO, we need to know (or define) what to be considered a page update. Could be:
- A page's (collection) direct updates, e.g. page properties, permissions, versions, design, and maybe other stuff.
- Any update related to the page, e.g. block add/remove/edit
My 2 cents: Since most of the work is actually on block level, it may help to have block level events, from which you can derive the page where the block is located, and then do the required action.
i think on block's parent collection version update might be more appropriate as that would encompass any meaningful change to a page object and thus it's collection via it's area and block associations.
Another thing. Since there is a on_page_version_approve, this may help a little in knowing of change.
Thanks, already found it yesterday, added a comment in the doc section. It seems to work just fine.
thanks for adding that Remo. I almost dropped a bunch of code before seeing that one. In my case on_page_add wouldn't be useful in my case as a page/collection is added with zero content which while useful in some instances wouldn't be for what I am looking at doing, more about actually approved content.
or if a page is added and is approved and thus actually on the site. Okhayat I wanted to personally thank you for bringing that inadvertenly to my attention as that is exactly the event I wanted to tie into.
-Scott
-Scott
Thank Remo :) I really just noticed his comment, tested it, and mentioned it here!
This thread ended a little specifically -- on_page_version_approve is nice but not always all we need. For example I currently have a client wanting admin users to be notified when an underling makes updates to a page (and that page becomes pending approval). Clearly on_page_version_approve is useless to me as I need something triggered before that.
Any ideas?
Any ideas?
So given I'm under a tight schedule, I hacked in my mailing routine to run from the check-in process script under the else condition, which is for these purposes thrown when a user hits Preview My Edits. Not very elegant, but it'll do the job for now.
If anyone else feels like doing the work to find a more graceful way to invent this event, please feel free to post.
If anyone else feels like doing the work to find a more graceful way to invent this event, please feel free to post.
then use on_page_update
Mnkras, check out the first few posts in the thread -- on_page_update only fires when metadata is updated, not page content itself.
lemme check that...
i thought that since this post is really old it was most likely fixed ;)
i thought that since this post is really old it was most likely fixed ;)
just checked the code in the trunk, and it looks like it should fire, look at the update function in /models/page.php its at the bottom of the function
Should, but don't!
ok,
so anyone figured it out already?
I'm generating blocks dynamically on page properties and want them to get updated if page properties have changed.
so anyone figured it out already?
I'm generating blocks dynamically on page properties and want them to get updated if page properties have changed.
Looks like this thread stopped a while back... but just wondered if anyone figured out how to catch a page_update (i.e. a block is amended)?
Sorry - Just answered my own question... on_page_version_approve
When I look at startup/process ~line 716 you should find an update but it only gets called if you change page properties.
The documentation isn't very clear about it:
http://www.concrete5.org/help/building_with_concrete5/developers/mv...
Can anyone confirm this?
Is there a way to hook into the "real update process"?