Item12840: Debug option doesn't print the prefs

pencil
Priority: Normal
Current State: Confirmed
Released In: n/a
Target Release:
Applies To: Extension
Component: LoginNameAliasesPlugin
Branches:
Reported By: LloydParkes
Waiting For: LloydParkes
Last Change By: GeorgeClark
When turning on debug mode in LoginNameAliasesPlugin, the debug log only ever records an empty list of preferences. e.g. it reads

2014-04-01T20:45:30Z debug - LoginNameAliasesPlugin prefs read. user: guest
2014-04-01T20:45:30Z debug - LoginNameAliasesPlugin prefs:
2014-04-01T20:45:30Z debug - logFile: /var/lib/foswiki/working/LoginNameAliasesPlugin_logfile.txt

Note the distinct lack of preferences print out after LoginNameAliasesPlugin prefs:.

The fix is to replace %prefs on line 260 of LoginNameAliasesPlugin.pm with %{$Foswiki::cfg{LoginNameAliasesPlugin}}. The foreach loop should now read
        foreach my $p ( keys %{$Foswiki::cfg{LoginNameAliasesPlugin}} ) {
            Foswiki::Func::writeDebug(
"- $pluginName  pref $p is  $Foswiki::cfg{LoginNameAliasesPlugin}{$p}"
            );
        }

After this change, the output in the debug log now looks like this:
2014-04-02T19:20:53Z debug - LoginNameAliasesPlugin prefs read. user: lloyd
2014-04-02T19:20:53Z debug - LoginNameAliasesPlugin prefs:
2014-04-02T19:20:53Z debug - LoginNameAliasesPlugin pref DEBUG is 1
2014-04-02T19:20:53Z debug - LoginNameAliasesPlugin pref REMOVE_PREFIX is
2014-04-02T19:20:53Z debug - LoginNameAliasesPlugin pref RETURN_NOTHING_IF_UNCHANGED is 1
2014-04-02T19:20:53Z debug - LoginNameAliasesPlugin pref CHANGE_CASE is none
2014-04-02T19:20:53Z debug - LoginNameAliasesPlugin pref REMOVE_SUFFIX is
2014-04-02T19:20:53Z debug - LoginNameAliasesPlugin pref USE_ALIASES is 1
2014-04-02T19:20:53Z debug - LoginNameAliasesPlugin pref LOGGING is 1
2014-04-02T19:20:53Z debug - LoginNameAliasesPlugin pref MAP_BLANK_USER is
2014-04-02T19:20:53Z debug - LoginNameAliasesPlugin pref MAP_UNREGISTERED is
2014-04-02T19:20:53Z debug - logFile: /var/lib/foswiki/working/LoginNameAliasesPlugin_logfile.txt

which is a much better result.

-- LloydParkes - 02 Apr 2014

Thanks for the patch. This extension doesn't have a current maintainer. Feel free to fork and apply the patch at Github:foswiki/LoginNameAliasesPlugin

-- GeorgeClark - 24 Dec 2014
 

ItemTemplate edit

Summary Debug option doesn't print the prefs
ReportedBy LloydParkes
Codebase 1.1.9
SVN Range
AppliesTo Extension
Component LoginNameAliasesPlugin
Priority Normal
CurrentState Confirmed
WaitingFor LloydParkes
Checkins
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
masterCheckins
ItemBranchCheckins
Release01x01Checkins
Topic revision: r2 - 24 Dec 2014, 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