You are here: Foswiki>Tasks Web>Item11813 (13 Dec 2017, GeorgeClark)Edit Attach

Item11813: Check that %MACROS in GROUP values are handled gracefully

pencil
Priority: Enhancement
Current State: No Action Required
Released In: n/a
Target Release: patch
Applies To: Extension
Component: TopicUserMappingContrib
Branches:
Reported By: PaulHarvey
Waiting For:
Last Change By: GeorgeClark
Consider a FooGroup topic as follows

   * Set GROUP = %STARTINCLUDE%JoeUser, JaneUser%STOPINCLUDE%

I'm just worried this isn't handled gracefully, see the following stacktrace when using FOSWIKI_ASSERTS=1

Assertion failed!
 at /usr/local/src/wiki.example.org.au/core/lib/Assert.pm line 82
   Assert::ASSERT('') called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki.pm line 1581
   Foswiki::normalizeWebTopicName('Foswiki=HASH(0x20aaf00)', 'Main', undef) called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki/Users/TopicUserMapping.pm line 804
   Foswiki::Users::TopicUserMapping::groupAllowsView('Foswiki::Users::TopicUserMapping=HASH(0x2efa9b0)', '%STARTINCLUDE%JoeUser') called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki/Users.pm line 915
   Foswiki::Users::groupAllowsView('Foswiki::Users=HASH(0x2abbb08)', '%STARTINCLUDE%JoeUser') called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki/Macros/GROUPINFO.pm line 43
   Foswiki::GROUPINFO('Foswiki=HASH(0x20aaf00)', 'Foswiki::Attrs=HASH(0x66c1df8)', 'Foswiki::Plugins::MongoDBPlugin::Meta=HASH(0x662ff60)') called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki.pm line 3108
   Foswiki::_expandMacroOnTopicRendering('Foswiki=HASH(0x20aaf00)', 'GROUPINFO', '"AcraGroup"
  expand="0"
  format="$percntIF{\"istopic \'Main...', 'Foswiki::Plugins::MongoDBPlugin::Meta=HASH(0x662ff60)') called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki.pm line 2984
   Foswiki::_processMacros('Foswiki=HASH(0x20aaf00)', '<!-- -->\x{a}%GROUPINFO{"%groupname%"\x{a}  expand="0"\x{a}  format="$per...', 'CODE(0x29ca9f0)', 'Foswiki::Plugins::MongoDBPlugin::Meta=HASH(0x662ff60)', 16) called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki.pm line 2781
   Foswiki::innerExpandMacros('Foswiki=HASH(0x20aaf00)', 'SCALAR(0x5c69530)', 'Foswiki::Plugins::MongoDBPlugin::Meta=HASH(0x662ff60)') called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki/Macros/INCLUDE.pm line 265
   Foswiki::__ANON__() called at /usr/share/perl5/Error.pm line 416
   eval {...} called at /usr/share/perl5/Error.pm line 408
   Error::subs::try('CODE(0x665fdc8)', 'HASH(0x66ffc00)') called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki/Macros/INCLUDE.pm line 316
   Foswiki::_includeTopic('Foswiki=HASH(0x20aaf00)', 'Foswiki::Plugins::MongoDBPlugin::Meta=HASH(0x3a7b2d8)', 'HASH(0x5c40000)', 'Foswiki::Attrs=HASH(0x627d268)') called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki/Macros/INCLUDE.pm line 374
   Foswiki::INCLUDE('Foswiki=HASH(0x20aaf00)', 'Foswiki::Attrs=HASH(0x627d268)', 'Foswiki::Plugins::MongoDBPlugin::Meta=HASH(0x3a7b2d8)') called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki.pm line 3108
   Foswiki::_expandMacroOnTopicRendering('Foswiki=HASH(0x20aaf00)', 'INCLUDE', '"Main.GroupViewTemplate"
         section="rendergroup"
     ...', 'Foswiki::Plugins::MongoDBPlugin::Meta=HASH(0x3a7b2d8)') called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki.pm line 2984
   Foswiki::_processMacros('Foswiki=HASH(0x20aaf00)', '<table class=\'foswikiTable wikiGroupsTable\'>
             <...', 'CODE(0x29ca9f0)', 'Foswiki::Plugins::MongoDBPlugin::Meta=HASH(0x3a7b2d8)', 15) called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki.pm line 3002
   Foswiki::_processMacros('Foswiki=HASH(0x20aaf00)', '---+ Wiki groups dashboard
Showing all known groups that can ...', 'CODE(0x29ca9f0)', 'Foswiki::Plugins::MongoDBPlugin::Meta=HASH(0x3a7b2d8)', 16) called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki.pm line 2781
   Foswiki::innerExpandMacros('Foswiki=HASH(0x20aaf00)', 'SCALAR(0x5b75ff8)', 'Foswiki::Plugins::MongoDBPlugin::Meta=HASH(0x3a7b2d8)') called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki.pm line 3290
   Foswiki::expandMacros('Foswiki=HASH(0x20aaf00)', '---+ Wiki groups dashboard
Showing all known groups that can ...', 'Foswiki::Plugins::MongoDBPlugin::Meta=HASH(0x3a7b2d8)') called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki/Meta.pm line 3145
   Foswiki::Meta::expandMacros('Foswiki::Plugins::MongoDBPlugin::Meta=HASH(0x3a7b2d8)', '---+ Wiki groups dashboard
Showing all known groups that can ...') called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki/UI/View.pm line 418
   Foswiki::UI::View::_prepare('---+ Wiki groups dashboard
Showing all known groups that can ...', 'Foswiki::Plugins::MongoDBPlugin::Meta=HASH(0x3a7b2d8)', 0) called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki/UI/View.pm line 398
   Foswiki::UI::View::view('Foswiki=HASH(0x20aaf00)') called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki/UI.pm line 316
   Foswiki::UI::__ANON__() called at /usr/share/perl5/Error.pm line 416
   eval {...} called at /usr/share/perl5/Error.pm line 408
   Error::subs::try('CODE(0x1fc0f60)', 'HASH(0x2a53e68)') called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki/UI.pm line 435
   Foswiki::UI::_execute('Foswiki::Request=HASH(0x2a4f8b0)', 'CODE(0x2a4f448)', 'view', 1) called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki/UI.pm line 274
   Foswiki::UI::handleRequest('Foswiki::Request=HASH(0x2a4f8b0)') called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki/Engine/CGI.pm line 41
   Foswiki::Engine::CGI::run('Foswiki::Engine::CGI=HASH(0x2397b08)') called at /usr/local/src/wiki.example.org.au/core/bin/view line 29
 at /usr/local/src/wiki.example.org.au/core/lib/Assert.pm line 82
   Assert::ASSERT('') called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki.pm line 1581
   Foswiki::normalizeWebTopicName('Foswiki=HASH(0x20aaf00)', 'Main', undef) called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki/Users/TopicUserMapping.pm line 804
   Foswiki::Users::TopicUserMapping::groupAllowsView('Foswiki::Users::TopicUserMapping=HASH(0x2efa9b0)', '%STARTINCLUDE%JoeUser') called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki/Users.pm line 915
   Foswiki::Users::groupAllowsView('Foswiki::Users=HASH(0x2abbb08)', '%STARTINCLUDE%JoeUser') called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki/Macros/GROUPINFO.pm line 43
   Foswiki::GROUPINFO('Foswiki=HASH(0x20aaf00)', 'Foswiki::Attrs=HASH(0x66c1df8)', 'Foswiki::Plugins::MongoDBPlugin::Meta=HASH(0x662ff60)') called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki.pm line 3108
   Foswiki::_expandMacroOnTopicRendering('Foswiki=HASH(0x20aaf00)', 'GROUPINFO', '"AcraGroup"
  expand="0"
  format="$percntIF{\"istopic \'Main...', 'Foswiki::Plugins::MongoDBPlugin::Meta=HASH(0x662ff60)') called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki.pm line 2984
   Foswiki::_processMacros('Foswiki=HASH(0x20aaf00)', '<!-- -->\x{a}%GROUPINFO{"%groupname%"\x{a}  expand="0"\x{a}  format="$per...', 'CODE(0x29ca9f0)', 'Foswiki::Plugins::MongoDBPlugin::Meta=HASH(0x662ff60)', 16) called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki.pm line 2781
   Foswiki::innerExpandMacros('Foswiki=HASH(0x20aaf00)', 'SCALAR(0x5c69530)', 'Foswiki::Plugins::MongoDBPlugin::Meta=HASH(0x662ff60)') called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki/Macros/INCLUDE.pm line 265
   Foswiki::__ANON__() called at /usr/share/perl5/Error.pm line 416
   eval {...} called at /usr/share/perl5/Error.pm line 408
   Error::subs::try('CODE(0x665fdc8)', 'HASH(0x66ffc00)') called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki/Macros/INCLUDE.pm line 316
   Foswiki::_includeTopic('Foswiki=HASH(0x20aaf00)', 'Foswiki::Plugins::MongoDBPlugin::Meta=HASH(0x3a7b2d8)', 'HASH(0x5c40000)', 'Foswiki::Attrs=HASH(0x627d268)') called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki/Macros/INCLUDE.pm line 374
   Foswiki::INCLUDE('Foswiki=HASH(0x20aaf00)', 'Foswiki::Attrs=HASH(0x627d268)', 'Foswiki::Plugins::MongoDBPlugin::Meta=HASH(0x3a7b2d8)') called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki.pm line 3108
   Foswiki::_expandMacroOnTopicRendering('Foswiki=HASH(0x20aaf00)', 'INCLUDE', '"Main.GroupViewTemplate"
         section="rendergroup"
     ...', 'Foswiki::Plugins::MongoDBPlugin::Meta=HASH(0x3a7b2d8)') called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki.pm line 2984
   Foswiki::_processMacros('Foswiki=HASH(0x20aaf00)', '<table class=\'foswikiTable wikiGroupsTable\'>
             <...', 'CODE(0x29ca9f0)', 'Foswiki::Plugins::MongoDBPlugin::Meta=HASH(0x3a7b2d8)', 15) called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki.pm line 3002
   Foswiki::_processMacros('Foswiki=HASH(0x20aaf00)', '---+ Wiki groups dashboard
Showing all known groups that can ...', 'CODE(0x29ca9f0)', 'Foswiki::Plugins::MongoDBPlugin::Meta=HASH(0x3a7b2d8)', 16) called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki.pm line 2781
   Foswiki::innerExpandMacros('Foswiki=HASH(0x20aaf00)', 'SCALAR(0x5b75ff8)', 'Foswiki::Plugins::MongoDBPlugin::Meta=HASH(0x3a7b2d8)') called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki.pm line 3290
   Foswiki::expandMacros('Foswiki=HASH(0x20aaf00)', '---+ Wiki groups dashboard
Showing all known groups that can ...', 'Foswiki::Plugins::MongoDBPlugin::Meta=HASH(0x3a7b2d8)') called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki/Meta.pm line 3145
   Foswiki::Meta::expandMacros('Foswiki::Plugins::MongoDBPlugin::Meta=HASH(0x3a7b2d8)', '---+ Wiki groups dashboard
Showing all known groups that can ...') called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki/UI/View.pm line 418
   Foswiki::UI::View::_prepare('---+ Wiki groups dashboard
Showing all known groups that can ...', 'Foswiki::Plugins::MongoDBPlugin::Meta=HASH(0x3a7b2d8)', 0) called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki/UI/View.pm line 398
   Foswiki::UI::View::view('Foswiki=HASH(0x20aaf00)') called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki/UI.pm line 316
   Foswiki::UI::__ANON__() called at /usr/share/perl5/Error.pm line 416
   eval {...} called at /usr/share/perl5/Error.pm line 408
   Error::subs::try('CODE(0x1fc0f60)', 'HASH(0x2a53e68)') called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki/UI.pm line 435
   Foswiki::UI::_execute('Foswiki::Request=HASH(0x2a4f8b0)', 'CODE(0x2a4f448)', 'view', 1) called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki/UI.pm line 274
   Foswiki::UI::handleRequest('Foswiki::Request=HASH(0x2a4f8b0)') called at /usr/local/src/wiki.example.org.au/core/lib/Foswiki/Engine/CGI.pm line 41
   Foswiki::Engine::CGI::run('Foswiki::Engine::CGI=HASH(0x2397b08)') called at /usr/local/src/wiki.example.org.au/core/bin/view line 29.

-- PaulHarvey - 03 May 2012

 

Making this a feature proposal. I don't think we advertise that we support macros in groups, Also with Foswiki 1.2, groups are implemented in Meta settings, not using inline settings. I suspect that this should probably be a no-action item.

-- Main.GeorgeClark - 04 Jan 2015 - 22:57

ItemTemplate edit

Summary Check that %MACROS in GROUP values are handled gracefully
ReportedBy PaulHarvey
Codebase
SVN Range
AppliesTo Extension
Component TopicUserMappingContrib
Priority Enhancement
CurrentState No Action Required
WaitingFor
Checkins
TargetRelease patch
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
masterCheckins
ItemBranchCheckins
Release02x01Checkins
Release02x00Checkins
Release01x01Checkins
Topic revision: r3 - 13 Dec 2017, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy