01163: $GroupPattern issue makes PMWiki not work after upgrade
$GroupPattern
issue makes PMWiki not work after upgradeDescription:
Came across an issue when updating from 2.1.17 to 2.2.7. Should be the same for 2.2.8.
I use $GroupPattern
to prevent people from creating new groups:$GroupPattern
= "(?:Site|PmWiki|Main|Profiles|Test)";
This caused PmWiki not to function after the upgrade, as it couldn't migrate Site.AuthUser to SiteAdmin.AuthUser and therefore couldn't use it for authorization.
I changed it to the following to makeit work:$GroupPattern
= "(?:$SiteGroup
|$SiteAdminGroup
|PmWiki|$DefaultGroup
|Profiles|Test)";
But this is not a very good solution in general.
Shouldn't Site and SiteAdmin always be allowed, at least readable, no matter what $GroupPattern
is set to?
Otherwise PmWiki is not working. Maybe actions on Site and SiteAdmin shouldn't be checked against $GroupPattern
.
$AuthorGroup
is not set in pmwiki.php and therefore can not be used in farm or local config (had to use fixed value 'Profiles')
Can this be added to pmwiki.php? --Maddes 2010-01-14
No, it is defined later in author.php, but you can set in (farm)config.php something like:
$AuthorGroup
= "Utilisateurs"; # French
to change it. --Petko January 13, 2010, at 06:44 PM
Would be great if the definition of $AuthorGroup
is moved to pmwiki.php, so it can be used for $GroupPattern
or other tasks. --Maddes January 16, 2010, at 02:33 PM
You can define it yourself in (farm)config.php before using it for $GroupPattern
or other tasks. The code in author.php will not override your definition -- it only sets $AuthorGroup
if it doesn't exist. --Petko January 16, 2010, at 02:47 PM
I do not want to change $AuthorGroup
, I want to use it with its default setting in $GroupPattern
.
Just like I can use $SiteGroup
, $SiteAdminGroup
, etc.$GroupPattern
= "(?:$SiteGroup
|$SiteAdminGroup
|PmWiki|$DefaultGroup
|$AuthorGroup
|Test)"
--Maddes January 18, 2010, at 03:59 PM
You can define it yourself in (farm)config.php before using it for $GroupPattern
or other tasks. The code in author.php will not override your definition -- it only sets $AuthorGroup
if it doesn't exist. --Petko January 16, 2010, at 02:47 PM
Defining $GroupPattern
as an array would allow to add Site, SiteAdmin, PmWiki and more in the farm config, while more groups can be added in the local config.
But this may change a lot of coding inside PmWiki.
I'm not sure this is a PmWiki bug -- by default it doesn't restrict group names this way, you had a setting which was incorrect. If you think the documentation should be improved, please edit the entry $GroupPattern
. --Petko January 10, 2010, at 06:00 PM
The setting was correct for PMWiki 2.1 and there was no hint to change it while migrating to 2.2.
I do not see this as a real bug either, but the migration script should print a warning that $GroupPattern
has to include $SiteAdminGroup
to make it and PMWiki 2.2 work.
At least the migration guide should be updated.
--Maddes 2010-01-14
You're right, I'll see what I can do, thanks for your help improving PmWiki. --Petko January 13, 2010, at 06:44 PM
Updated PmWiki.Troubleshooting. Should the $GroupPattern
documentation be updated too?
Oh, recognized your text change while typing :)
Should the info be moved to $GroupPattern
? Or copied?
--Maddes 2010-01-14
Updated PmWiki.UpgradeToSiteAdmin which is linked from the upgrade form, Cookbook:LimitWikiGroups and $GroupPattern
. Closing this entry. Thanks! :-) --Petko February 13, 2010, at 09:46 AM