You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many times in a before.update I'll check the incoming modifier and update it to enforce application rules. A perfect example is sanitizing HTML from a rich-text editor before saving. Simply sanitize the HTML and update modifier.$set.html.
I just noticed for the first time that the after.updatemodifier does not get these updates. It retains the original modifier from the update. I see how this could be important, but if you update the modifier manually in the before.update it seems like the after.update should then see this somehow?
I often refer to the modifier in after.update to get around the the issue of replication lag. As usually it's the same as the original update and since we're in after.update we can assume the update was a success. But when needing to update the modifier you can't do this work-around.
For now a work-around is to replicate the logic to update the modifier in after.update but this of course is not DRY.
The text was updated successfully, but these errors were encountered:
Many times in a
before.update
I'll check the incomingmodifier
and update it to enforce application rules. A perfect example is sanitizing HTML from a rich-text editor before saving. Simply sanitize the HTML and updatemodifier.$set.html
.I just noticed for the first time that the
after.update
modifier
does not get these updates. It retains the originalmodifier
from theupdate
. I see how this could be important, but if you update themodifier
manually in thebefore.update
it seems like theafter.update
should then see this somehow?I often refer to the
modifier
inafter.update
to get around the the issue of replication lag. As usually it's the same as the original update and since we're inafter.update
we can assume the update was a success. But when needing to update themodifier
you can't do this work-around.For now a work-around is to replicate the logic to update the
modifier
inafter.update
but this of course is not DRY.The text was updated successfully, but these errors were encountered: