Fixed inline_mod_actions requires \XF\Pub\App but could work with \XF\App as well

AddonsLab

Well-known member
Affected version
2.x
Hello,

when adding an event listener for inline_mod_actions the documentation says, that as a second argument for the listener will be passed an instance of \XF\Pub\App This seems to be natural choice considering the system is used on the front-end by XenForo itself, but as it is a very nicely organized abstraction of all inline moderation actions we use it in the back-end code as well. As a result, our add-on causes an error if some other add-ons register a listener for inline_mod_actions actions because an instance of \XF\Admin\App is being passed to the listener in this case.

Checking the context in which the event is fired we see it actually gets an instance of \XF\App at \XF\InlineMod\AbstractHandler::__construct so it seems the requirement for an instance of \XF\Pub\App is just in the documentation but is not needed at the runtime. Please confirm if it can be updated or if there is any reason why the system cannot be used in back-end code.

Thank you!
 
Thank you for reporting this issue. It has now been resolved and we are aiming to include it in a future XF release (2.1.4).

Change log:
Update inline_mod_actions event listener description to suggest using the global app object rather than public.
Any changes made as a result of this issue being resolved may not be rolled out here until later.
 
Back
Top Bottom