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

Not Planned New code event listener for post_upgrade

Discussion in 'Closed Suggestions' started by Jon W, Jun 23, 2013.

  1. Jon W

    Jon W Well-Known Member

    It would be incredibly useful to have a code event listener (post_upgrade) that is called just after the updateVersion method in XenForo_Install_Model_Upgrade is called (or somewhere around there).
  2. Mike

    Mike XenForo Developer Staff Member

    Listeners--intentionally--don't run in the upgrade system at all. Otherwise, it'd create plenty of "impossible to upgrade" situations.

    You could work around this by storing the last known version in a simple cache and checking if the version ID has changed in the options.

    But can you explain what you're trying to do with this?
  3. Jon W

    Jon W Well-Known Member

    I want to change what code event listeners are available to an add-on after upgrade.

    For example, in 1.1.5, I would only want one load_class_controller listener, but in version 1.2, I would want several but with hints.

    Running this at any point after the upgrade has finished has its own problems.
  4. Jon W

    Jon W Well-Known Member

    I'm also interested in creating template edits. Basically anything that wasn't available in the previous version.

    In future (i.e., 1.3 etc.), there may be other such things that I would like to add as soon as they become available.
  5. Mike

    Mike XenForo Developer Staff Member

    I'd rather keep the install/upgrade process entirely free of listeners to ensure the best chance of the upgrade completely successfully. I'm not keen on a conditional "load them when..." trigger there.
  6. Jon W

    Jon W Well-Known Member

    Understood. This change should allow me to add temporary listeners now anyway that can keep an eye out for a version change as you suggested.

Share This Page