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

Fixed Template modification key prevents add-on install

Chris D

XenForo developer
Staff member
#10
Just did some diff comparisons on the new code.

It's this:

PHP:
if (preg_match('/[^a-zA-Z0-9_]/', $key))
{
    $this->error(new XenForo_Phrase('please_enter_an_id_using_only_alphanumeric'), 'modification_key');
    return false;
}
The verification of the template modification key.

I never knew that it wasn't already constrained to those characters, but it was. Seems like Extra Portal has modification keys such as:
add simpleportal promotelink

It tends to be the description copy and pasted, it seems.
 

HWS

Well-known member
#11
The modification key always had this restrictions in its description. It seems like a bug fix, because this should always have been checked.

Anyway: This problem is caused by Extra Portal and has to be fixed by its developer.
 

Chris D

XenForo developer
Staff member
#12
The modification key always had this restrictions in its description.
That's not entirely true. The description on the page at is (and always has been as far as I can remember): This is used to uniquely identify a modification across add-on upgrades.

But you're right. It's a reasonable change for XF to have made and would be an add-on fix.
 

Mike

XenForo developer
Staff member
#14
This wasn't actually supposed to trigger when installing or upgrading an add-on. It was mostly to get the add-on developers to be aware of it when creating or changing. I just forgot that, of course, this check would run on installation of an add-on.

So the check now only runs when you try to edit the modification (which would require a change to push anything through).