Fixed All custom CLI commands do not work without implementing AllowInactiveAddOnCommandInterface

Xon

Well-known member
Affected version
2.2.0 Beta 2
getAddOnForCommand extracts the add-on from the class name which uses \ as the namespace part-delimiter, but add-on isAddOnActive expects / in the namespace, resulting in isAddOnActive always returning false
 
Last edited:
Yeah, this is a pretty serious bug - every single CLI command contained in addons is currently broken on XF 2.2b2
 
Yeah, this is a namespace vs addon id issue.

Namespaces use backslashes - addon ids use forward slashes.

Suggested fix:

in XF\Cli\Runner::getAddOnForCommand, replace line 150 return $addon; with the following:

PHP:
return str_replace( '\\', '/', $addOn);
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.2.0 Beta 3).

Change log:
Fix incorrect handling of namespaced add-on IDs when validating if a CLI command is runnable
There may be a delay before changes are rolled out to the XenForo Community.
 
Back
Top Bottom