Item1308: EditTablePlugin has problems with included topics with included edittable definition
Priority: Urgent
Current State: Closed
Released In: 1.0.4
Target Release: patch
My Foswiki just died with a crash
Use of uninitialized value in pattern match (m//) at /var/www/Release01x00/core/lib/Foswiki/Plugins/EditTablePlugin/Core.pm line 783.
at /usr/lib/perl5/5.8.8/CGI/Carp.pm line 314
CGI::Carp::realdie('Use of uninitialized value in pattern match (m//) at /var/www...') called at /usr/lib/perl5/5.8.8/CGI/Carp.pm line 385
CGI::Carp::die('Use of uninitialized value in pattern match (m//) at /var/www...') called at /var/www/Release01x00/core/lib/Foswiki.pm line 154
Foswiki::__ANON__('Use of uninitialized value in pattern match (m//) at /var/www...') called at /var/www/Release01x00/core/lib/Foswiki/Plugins/EditTablePlugin/Core.pm line 783
Foswiki::Plugins::EditTablePlugin::Core::handleEditTableTag('QMS', 'ProcedureSysarch000Comments', ' include="QmsCommentTable" ') called at /var/www/Release01x00/core/lib/Foswiki/Plugins/EditTablePlugin/Core.pm line 235
Foswiki::Plugins::EditTablePlugin::Core::processText(2, 0, '---+ User Added Comments - ProcedureSysarch000 - System Archi...', 'ProcedureSysarch000Comments', 'QMS', 'ProcedureSysarch000', 'QMS') called at /var/www/Release01x00/core/lib/Foswiki/Plugins/EditTablePlugin/Core.pm line 135
Foswiki::Plugins::EditTablePlugin::Core::process('---+ User Added Comments - ProcedureSysarch000 - System Archi...', 'ProcedureSysarch000Comments', 'QMS', 'ProcedureSysarch000', 'QMS') called at /var/www/Release01x00/core/lib/Foswiki/Plugins/EditTablePlugin.pm line 114
Foswiki::Plugins::EditTablePlugin::commonTagsHandler('---+ User Added Comments - ProcedureSysarch000 - System Archi...', 'ProcedureSysarch000Comments', 'QMS', 1, 'Foswiki::Meta=HASH(0xb33748c)') called at /var/www/Release01x00/core/lib/Foswiki/Plugin.pm line 273
Foswiki::Plugin::invoke('Foswiki::Plugin=HASH(0xa472278)', 'commonTagsHandler', '---+ User Added Comments - ProcedureSysarch000 - System Archi...', 'ProcedureSysarch000Comments', 'QMS', 1, 'Foswiki::Meta=HASH(0xb33748c)') called at /var/www/Release01x00/core/lib/Foswiki/Plugins.pm line 316
Foswiki::Plugins::dispatch('Foswiki::Plugins=HASH(0xa29811c)', 'commonTagsHandler', '---+ User Added Comments - ProcedureSysarch000 - System Archi...', 'ProcedureSysarch000Comments', 'QMS', 1, 'Foswiki::Meta=HASH(0xb33748c)') called at /var/www/Release01x00/core/lib/Foswiki.pm line 3491
Foswiki::INCLUDE('Foswiki=HASH(0xa0286b4)', 'Foswiki::Attrs=HASH(0xb3373fc)', 'ProcedureSysarch000', 'QMS', 'Foswiki::Meta=HASH(0xae75c58)') called at /var/www/Release01x00/core/lib/Foswiki.pm line 2771
Foswiki::_expandTagOnTopicRendering('Foswiki=HASH(0xa0286b4)', 'INCLUDE', '"ProcedureSysarch000Comments"', 'ProcedureSysarch000', 'QMS', 'Foswiki::Meta=HASH(0xae75c58)') called at /var/www/Release01x00/core/lib/Foswiki.pm line 2676
Foswiki::_processTags('Foswiki=HASH(0xa0286b4)', '---+!! %FORMFIELD{"DocumentID"}% %FORMFIELD{"TopicTitle"}%\x{a}\x{a}<...', 'CODE(0xa3b5458)', 16, 'ProcedureSysarch000', 'QMS', 'Foswiki::Meta=HASH(0xae75c58)') called at /var/www/Release01x00/core/lib/Foswiki.pm line 2593
Foswiki::expandAllTags('Foswiki=HASH(0xa0286b4)', 'SCALAR(0xb06479c)', 'ProcedureSysarch000', 'QMS', 'Foswiki::Meta=HASH(0xae75c58)') called at /var/www/Release01x00/core/lib/Foswiki.pm line 2950
Foswiki::handleCommonTags('Foswiki=HASH(0xa0286b4)', '---+!! %FORMFIELD{"DocumentID"}% %FORMFIELD{"TopicTitle"}%\x{a}\x{a}<...', 'QMS', 'ProcedureSysarch000', 'Foswiki::Meta=HASH(0xae75c58)') called at /var/www/Release01x00/core/lib/Foswiki/UI/View.pm line 388
Foswiki::UI::View::_prepare('---+!! %FORMFIELD{"DocumentID"}% %FORMFIELD{"TopicTitle"}%\x{a}\x{a}<...', 'Foswiki=HASH(0xa0286b4)', 'QMS', 'ProcedureSysarch000', 'Foswiki::Meta=HASH(0xae75c58)', 0) called at /var/www/Release01x00/core/lib/Foswiki/UI/View.pm line 368
Foswiki::UI::View::view('Foswiki=HASH(0xa0286b4)') called at /var/www/Release01x00/core/lib/Foswiki/UI.pm line 181
Foswiki::UI::__ANON__() called at /usr/lib/perl5/vendor_perl/5.8.8/Error.pm line 415
eval {...} called at /usr/lib/perl5/vendor_perl/5.8.8/Error.pm line 407
Error::subs::try('CODE(0xa1c4858)', 'HASH(0xaeb2814)') called at /var/www/Release01x00/core/lib/Foswiki/UI.pm line 249
Foswiki::UI::execute('Foswiki::Request=HASH(0xa443d90)', 'CODE(0xa443af0)', 'view', 1) called at /var/www/Release01x00/core/lib/Foswiki/UI.pm line 120
Foswiki::UI::handleRequest('Foswiki::Request=HASH(0xa443d90)') called at /var/www/Release01x00/core/lib/Foswiki/Engine/CGI.pm line 26
Foswiki::Engine::CGI::run('Foswiki::Engine::CGI=HASH(0xa2321f4)') called at /var/www/Release01x00/core/bin/view line 45.
I am attaching the deadly topic
I have ASSERTS on. Trying without.
--
KennethLavrsen - 16 Mar 2009
It was ASSERTS. Trying to find the root cause now
--
KennethLavrsen - 16 Mar 2009
It happens when you have a topic that includes a topic which has en EDITTABLE with an include.
Without asserts on the edit table just doesn't work and the log is filled with initialization warnings.
This is a real life example from our quality management system so I will see this at work if I upgrade to Foswiki (which I still cannot do because of bugs). So I put this urgent.
error log says
[Tue Mar 17 00:42:30 2009] [error] [client 192.168.1.11] [Tue Mar 17 00:42:30 2009] view: Use of uninitialized value in pattern match (m//) at /var/www/Release01x00/core/lib/Foswiki/Plugins/EditTablePlugin/Core.pm line 783., referer: http://merlin.lavrsen.dk/foswiki10/bin/view/QMS/ProcedureSysarch000Comments
[Tue Mar 17 00:42:30 2009] [error] [client 192.168.1.11] [Tue Mar 17 00:42:30 2009] view: Use of uninitialized value in concatenation (.) or string at /var/www/Release01x00/core/lib/Foswiki/Plugins/EditTablePlugin/Core.pm line 821., referer: http://merlin.lavrsen.dk/foswiki10/bin/view/QMS/ProcedureSysarch000Comments
[Tue Mar 17 00:42:30 2009] [error] [client 192.168.1.11] [Tue Mar 17 00:42:30 2009] view: Use of uninitialized value in concatenation (.) or string at /var/www/Release01x00/core/lib/Foswiki/Plugins/EditTablePlugin/Core.pm line 878., referer: http://merlin.lavrsen.dk/foswiki10/bin/view/QMS/ProcedureSysarch000Comments
[Tue Mar 17 00:42:30 2009] [error] [client 192.168.1.11] [Tue Mar 17 00:42:30 2009] view: Use of uninitialized value in concatenation (.) or string at /var/www/Release01x00/core/lib/Foswiki/Plugins/EditTablePlugin/Core.pm line 953., referer: http://merlin.lavrsen.dk/foswiki10/bin/view/QMS/ProcedureSysarch000Comments
[Tue Mar 17 00:42:33 2009] [error] [client 192.168.1.11] File does not exist: /var/www/Release01x00/core/pub/QMS/ProcedureSysarch000, referer: http://merlin.lavrsen.dk/foswiki10/bin/view/QMS/ProcedureSysarch000
The last file does not exist is because no drawing has been made. This is unrelated.
--
KennethLavrsen - 16 Mar 2009
After a good sleep some more information. Besides the warnings in the error log and the crashing when turning on asserts (developer mode) the problem for the end user is that the Edit button for the edit table is not correctly visible. You get a small empty button.
But when you click it all is OK. You are taken to the included topic and end up in edit mode there. This is all OK. This is as it always worked. If you include a topic with an EDITTABLE and you edit the table from the parent you are taken to the included topic and editing the table there. I have no illusions about changing that. So all we need to figure out is how to get the warnings silenced and the edit button shown correctly from the parent.
--
KennethLavrsen - 17 Mar 2009
One more important information. The fact that the EDITTABLE tag uses the include parameter is not the problem.
If I change the EDITTABLE tag to a normal one in the included topic the error is still there.
The problem is simply the handling of a topic including another topic that contains an EDITTABLE tag. The view from the parent should be a normal table with an edit button in plain view. The minute you click the edit button you must be taken to the child where the actual editing takes place. And when you are saving you stay in the child and have to find your way back.
--
KennethLavrsen - 17 Mar 2009
Problem seems to be that for an EDITTABLE in an included topic the beforeCommonTagsHandler is never called which means that a lot of variables defined in the ETP init function are never called and this results in an endless row of undefined variables all over the code.
--
KennethLavrsen - 17 Mar 2009
My fix was fix + big hack. I have tested a lot and it works great. Additionally I found a little less hacky way which I will check in.
--
KennethLavrsen - 17 Mar 2009
I have added a unit test with this case. And renamed
reinit
to
initIncludedTopic
.
--
ArthurClemens - 17 Mar 2009