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

Not a Bug Callback Execution Order

Discussion in 'Resolved Bug Reports' started by LiquidPro, Jan 10, 2015.

  1. LiquidPro

    LiquidPro Active Member

    When using the callback execution order, it appears that any listener that doesn't use a hint takes priority over one that does use a hint. An example is provided below. Not sure if it is possible to correct this or not, but it sure would be nice. Sorry for the lack of formatting, wasn't quite sure how to lay it out easily.

    I'm trying to prevent a conflict with one of our addons and because the other addon doesn't use an hint, I am forced now to do the same.

    Scenario 1
    Listener: load class controller, no hint, execution order 10, extending XenForo_ControllerPublic_Member with AddonA_ControllerPublic_Member
    Listener: load class controller, hinted to XenForo_ControllerPublic_Member, execution order 1, extending XenForo_ControllerPublic_Member with AddonB_ControllerPublic_Member

    Resulting order:
    XenForo_ControllerPublic_Member
    AddonA_ControllerPublic_Member
    AddonB_ControllerPublic_Member

    Scenario 2
    Listener: load class controller, no hint, execution order 10, extending XenForo_ControllerPublic_Member with AddonA_ControllerPublic_Member
    Listener: load class controller, hinted to XenForo_ControllerPublic_Member, execution order 100, extending XenForo_ControllerPublic_Member with AddonB_ControllerPublic_Member

    Resulting order:
    XenForo_ControllerPublic_Member
    AddonA_ControllerPublic_Member
    AddonB_ControllerPublic_Member

    Scenario 3
    Listener: load class controller, no hint, execution order 10, extending XenForo_ControllerPublic_Member with AddonA_ControllerPublic_Member
    Listener: load class controller, no hint, execution order 1, extending XenForo_ControllerPublic_Member with AddonB_ControllerPublic_Member

    Resulting order:
    XenForo_ControllerPublic_Member
    AddonB_ControllerPublic_Member
    AddonA_ControllerPublic_Member

    Scenario 4
    Listener: load class controller, no hint, execution order 10, extending XenForo_ControllerPublic_Member with AddonA_ControllerPublic_Member
    Listener: load class controller, no hint, execution order 100, extending XenForo_ControllerPublic_Member with AddonB_ControllerPublic_Member

    Resulting order:
    XenForo_ControllerPublic_Member
    AddonA_ControllerPublic_Member
    AddonB_ControllerPublic_Member
     
  2. Jake B.

    Jake B. Well-Known Member

    I believe this is intended functionality. It even states on the "Code Event Listener Editor" page that "Lower execution orders will run first. Note that listeners that specify an event hint will always run after listeners that don't."
     
  3. LiquidPro

    LiquidPro Active Member

    Bummer... I must have missed that detail. Don't necessarily know if I agree with it, but if that's intended then that's how it goes.

    Thanks for catching that.
     

Share This Page