The afterUpdate() hook

The afterUpdate() hook does not fire when the status of an element in the collection (Hidden, Displayed) changes according to a schedule. If you change the status manually, the hook works fine. Is there any way to fix this?

I don’t think there is since the publicity status isn’t part of your object, Wix can’t detect the change.

I guess the reason the visibility status change in the content manager is because they force an update when you edit the item, which does not occurred when triggered by the backend.

You probably want another approach like using a scheduler.

What are you trying to achieve?

Thanks for the answer
I understand that the afterUpdate() hook is triggered when there are changes in the collection, but why, if I manually change the visibility status, then this is considered a change and the afterUpdate() hook is triggered, and if the visibility status changes according to a schedule (there is such an option), then afterUpdate() hook doesn’t work. Although this is the same action.

Perhaps this question should be asked to the developers.

Status

Yes Wix developers might have better answer. I feel this will be considered as a feature and not a bug unfortunately.

You should post your request to support if you want a direct answer :slight_smile:

1 Like

Thank you, try contacting support