From 28668d4195be7e55e6d9144b0b2c1f1fc578ab88 Mon Sep 17 00:00:00 2001 From: Scott Walters Date: Fri, 1 Jul 2011 16:26:55 -0400 Subject: [PATCH] Fix for ``unable to call method setting on undefined value'' when turning admin on. Details follow. It turned out this problem is related to Moose and/or Class::MOP. I downgraded Moose to 1.25, and Class::MOP to 1.12, and then I got the console just fine when I clicked on "turn admin on". I managed to operate the Perl debugger on the code, by putting Enbugger->stop at the desired point. I could then debug it interactively. The stack trace at the point of failure in Search.pm is: DB<3> T $ = WebGUI::Asset::Wobject::Search::_searchRoot_builder(ref(WebGUI::Asset::Wobject::Search)) called from file `constructor WebGUI::Asset::Wobject::Search::new (defined at /home/amir/Downloads/webgui/lib/WebGUI/Asset/Wobject/Search.pm line 214)' line 224 $ = WebGUI::Asset::Wobject::Search::new('WebGUI::Asset::Wobject::Search', ref(HASH)) called from file `/home/amir/Downloads/webgui/lib/WebGUI/Asset.pm' line 1937 $ = WebGUI::Asset::newByPropertyHashRef('WebGUI::Asset', ref(WebGUI::Session), ref(HASH)) called from file `/home/amir/Downloads/webgui/lib/WebGUI/Admin.pm' line 186 @ = WebGUI::Admin::getAssetTypes(ref(WebGUI::Admin)) called from file `/home/amir/Downloads/webgui/lib/WebGUI/Admin.pm' line 279 $ = WebGUI::Admin::getNewContentTemplateVars(ref(WebGUI::Admin)) called from file `/home/amir/Downloads/webgui/lib/WebGUI/Admin.pm' line 811 $ = WebGUI::Admin::www_view(ref(WebGUI::Admin)) called from file `/home/amir/Downloads/webgui/lib/WebGUI/Content/Admin.pm' line 80 $ = WebGUI::Content::Admin::handler(ref(WebGUI::Session)) called from file `/home/amir/Downloads/webgui/lib/WebGUI/Pluggable.pm' line 287 $ = WebGUI::Pluggable::run('WebGUI::Content::Admin', 'handler', ref(ARRAY)) called from file `/home/amir/Downloads/webgui/lib/WebGUI.pm' line 165 $ = eval {...} called from file `/home/amir/Downloads/webgui/lib/WebGUI.pm' line 165 . = WebGUI::handle(ref(WebGUI), ref(WebGUI::Session)) called from file `/home/amir/Downloads/webgui/lib/WebGUI.pm' line 77 @ = WebGUI::call(ref(WebGUI), ref(HASH)) called from file `/usr/lib/perl5/site_perl/5.12.3/Plack/Component.pm' line 39 ... DB<1> l 38==> my $session = shift->session; 39 return $session->setting->get("defaultPage"); 40 } 41 property classLimiter => ( 42 fieldType => "checkList", 43 default => undef, 44 vertical => 1, 45 tab => "properties", 46 hoverHelp => ["class limiter description", 'Asset_Search'], 47 label => ["class limiter", 'Asset_Search'], DB<1> p join(",",keys %{$_[0]}); mobileStyleTemplateId,displayTitle,assetSize,classLimiter,newWindow,extraHeadTagsPacked,ownerUserId,extraHeadTags,paginateAfter,isPrototype,isPackage,isHidden,groupIdEdit,encryptPage,inheritUrlFromParent,description,isExportable,lastModified,groupIdView,printableStyleTemplateId NOTE: "session" is not found there. With a downgraded Moose: 38==> my $session = shift->session; 39 return $session->setting->get("defaultPage"); 40 } 41 property classLimiter => ( 42 fieldType => "checkList", 43 default => undef, 44 vertical => 1, 45 tab => "properties", 46 hoverHelp => ["class limiter description", 'Asset_Search'], 47 label => ["class limiter", 'Asset_Search'], DB<1> p join(",",keys %{$_[0]}); skipNotification,uiLevel,displayTitle,classLimiter,newWindow,synopsis,extraHeadTagsPacked,extraHeadTags,ownerUserId,session,paginateAfter,isHidden,groupIdEdit,encryptPage,inheritUrlFromParent,description,title,printableStyleTemplateId DB<2> ("session" is found.) Amir --- lib/WebGUI/Asset/Wobject/Search.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/WebGUI/Asset/Wobject/Search.pm b/lib/WebGUI/Asset/Wobject/Search.pm index f3250d301..e89e2275e 100644 --- a/lib/WebGUI/Asset/Wobject/Search.pm +++ b/lib/WebGUI/Asset/Wobject/Search.pm @@ -31,6 +31,7 @@ property searchRoot => ( tab => "properties", hoverHelp => ["search root description", 'Asset_Search'], label => ['search root', 'Asset_Search'], + lazy => 1, ); sub _searchRoot_builder { my $session = shift->session;