1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

_messagePreSave not being called?

Discussion in 'XenForo Development Discussions' started by Liam W, Jul 11, 2016.

  1. Liam W

    Liam W Well-Known Member

    I'm in the middle of developing an add-on, and I've hit a headache inducing scenario :(

    For some reason, the _messagePreSave method isn't being called at all on the post data writer... This is causing a headache as I can't figure out why.

    It's in a cron run environment (manually running the cron).

    Is this supposed to happen? Because it's really annoying...

  2. Xon

    Xon Well-Known Member

    Another add-on is likely failing to respect calling the parent::_messagePreSave.

    Try grepping your library folder for _messagePreSave and look for any time a file doesn't have two entries (besides XenForo core stuff obviously).
    Liam W likes this.
  3. Liam W

    Liam W Well-Known Member

    I would think that, but it is called when editing a post via the front end...
  4. Xon

    Xon Well-Known Member

    _preSave() unconditionally _messagePreSave(), which is called as part of save().

    Unless you have _importMode set, then _preSave() is skipped, so something might be calling setImportMode. But you'll need to grep for that since only an add-on would be doing that.:p
  5. Liam W

    Liam W Well-Known Member

    Scratch that, I just disabled all add-ons and it's working. Now to figure out which one :)
    Xon and CyclingTribe like this.

Share This Page