Fixed "Macro names may only contain A-Z, 0-9 and underscores." does not report macro and blocks add-on install when a bugged style exists

Xon

Well-known member
Affected version
2.2.0B3
PHP:
if (!preg_match('#^[a-z0-9_]+$#i', $name))
{
   // We only enforce this with development on and outside of the install/upgrade system because this
   // constraint was bugged prior to 2.2. This should avoid end users running into it or upgrades being
   // blocked because of it.
   if (\XF::$developmentMode && !(\XF::app() instanceof \XF\Install\App))
   {
      throw $tag->exception(\XF::phrase('macro_names_may_only_contain_alphanumeric_underscore'));
   }
}

Without the macro name, this is stupidly hard to troubleshoot.
 
During add-on install/import; this blocks importing template modifications if a style has this. Rather than silently failing to apply the template modification with normal template modifications fail.
 
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 4).

Change log:
Include offending macro name in the error message thrown when it does not match the required format
There may be a delay before changes are rolled out to the XenForo Community.
 
Top Bottom