I seem to be having the same issue with OnBeforeWrite. Still no conclusion?
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
- Previous 10 entries
- 1
- Page 22(current)
No.. I ended up taking a different route. I'd really like an answer as to why these functions get run so many times. I really screws things up for me.
Just a thought, don't have time to test right now, but does this only happen on SiteTree objects (ie VERSIONED?).
I wonder if versioned is causing onBeforeWrite to happen multiple times as they're written to different stages.
Would be easy to test - if it happens to a page, but not a standard dataobject, it would would probably be the cause. Then extend the data object with versioned and see what happens.
I have a strong feeling that onBeforeWrite and onAfterWrite run once for every object relation. My class had two has_ones and a has_many, and I believe i was getting 4 writes. One for the main table and 3 for the relations... ??
- Previous 10 entries
- 1
- Page 22(current)