Priority: Urgent
Current State: Closed
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: FormPlugin
Branches:
I have recently upgraded from FOSWIKI 1.09 to the current version. When using
FormPlugin to create a topic, after hitting the submit button:
- The new topic is created
- The parent topic crashes as soon as it tries to show the created topic in a search macro
- As soon as you change the name of the FormPlugin form (that created the new topic) in the parent topic, the error disappears.
- If you change the form name back, FOSWIKI crashes again.
The message is:
Foswiki detected an internal error - please check your Foswiki logs and webserver logs for more information.
Can't use string ("undef") as a HASH ref while "strict refs" in use
The only way to view the parent topic is to view it as raw (append "?raw=on" to the URL), where you can edit it, etc. As soon as you hit the "save" button, FOSWIKI crashes again.
The error.log is:
| 2012-10-09T10:00:45Z warning | Can't use string ("undef") as a HASH ref while "strict refs" in use at /var/www/ErgoQPM/lib/Foswiki/Plugins/FormPlugin.pm line 765.
at /var/www/ErgoQPM/lib/Foswiki/Plugins/FormPlugin.pm line 765
Foswiki::Plugins::FormPlugin::_sessionSaveForm('QpmCompanyContactCreate', 'Foswiki::Plugins::FormPlugin::FormData=HASH(0x3333638)') called at /var/www/ErgoQPM/lib/Foswiki/Plugins/FormPlugin.pm line 269
Foswiki::Plugins::FormPlugin::_endForm('Foswiki=HASH(0x15b1de0)', 'Foswiki::Attrs=HASH(0x3335b50)', 'CompanyNo0001', 'ErgoQ', 'Foswiki::Meta=HASH(0x2ca6a48)') called at /var/www/ErgoQPM/lib/Foswiki/Func.pm line 609
Foswiki::Func::__ANON__('Foswiki=HASH(0x15b1de0)', 'Foswiki::Attrs=HASH(0x3335b50)', 'Foswiki::Meta=HASH(0x2ca6a48)') called at /var/www/ErgoQPM/lib/Foswiki.pm line 3112
Foswiki::_expandMacroOnTopicRendering('Foswiki=HASH(0x15b1de0)', 'ENDFORM', undef, 'Foswiki::Meta=HASH(0x2ca6a48)') called at /var/www/ErgoQPM/lib/Foswiki.pm line 2988
Foswiki::_processMacros('Foswiki=HASH(0x15b1de0)', '%TABPANE%\x{a}%TAB{"%JQICON{user}% \x{ce}\x{a3}\x{cf}\x{84}\x{ce}\x{bf}\x{ce}\x{b9}\x{cf}\x{87}\x{ce}\x{b5}\x{ce}\x{af}\x{ce}\x{b1} \x{ce}\x{95}\x{cf}\x{84}\x{ce}\x{b1}\x{ce}\x{b9}\x{cf}\x{81}\x{ce}\x{b5}\x{ce}...', 'CODE(0x1530c68)', 'Foswiki::Meta=HASH(0x2ca6a48)', 16) called at /var/www/ErgoQPM/lib/Foswiki.pm line 2785
Foswiki::innerExpandMacros('Foswiki=HASH(0x15b1de0)', 'SCALAR(0x153c0c8)', 'Foswiki::Meta=HASH(0x2ca6a48)') called at /var/www/ErgoQPM/lib/Foswiki.pm line 3294
Foswiki::expandMacros('Foswiki=HASH(0x15b1de0)', '%TABPANE%\x{a}%TAB{"%JQICON{user}% \x{ce}\x{a3}\x{cf}\x{84}\x{ce}\x{bf}\x{ce}\x{b9}\x{cf}\x{87}\x{ce}\x{b5}\x{ce}\x{af}\x{ce}\x{b1} \x{ce}\x{95}\x{cf}\x{84}\x{ce}\x{b1}\x{ce}\x{b9}\x{cf}\x{81}\x{ce}\x{b5}\x{ce}...', 'Foswiki::Meta=HASH(0x2ca6a48)') called at /var/www/ErgoQPM/lib/Foswiki/Meta.pm line 3143
Foswiki::Meta::expandMacros('Foswiki::Meta=HASH(0x2ca6a48)', '%TABPANE%\x{a}%TAB{"%JQICON{user}% \x{ce}\x{a3}\x{cf}\x{84}\x{ce}\x{bf}\x{ce}\x{b9}\x{cf}\x{87}\x{ce}\x{b5}\x{ce}\x{af}\x{ce}\x{b1} \x{ce}\x{95}\x{cf}\x{84}\x{ce}\x{b1}\x{ce}\x{b9}\x{cf}\x{81}\x{ce}\x{b5}\x{ce}...') called at /var/www/ErgoQPM/lib/Foswiki/UI/View.pm line 411
Foswiki::UI::View::_prepare('%TABPANE%\x{a}%TAB{"%JQICON{user}% \x{ce}\x{a3}\x{cf}\x{84}\x{ce}\x{bf}\x{ce}\x{b9}\x{cf}\x{87}\x{ce}\x{b5}\x{ce}\x{af}\x{ce}\x{b1} \x{ce}\x{95}\x{cf}\x{84}\x{ce}\x{b1}\x{ce}\x{b9}\x{cf}\x{81}\x{ce}\x{b5}\x{ce}...', 'Foswiki::Meta=HASH(0x2ca6a48)', 0) called at /var/www/ErgoQPM/lib/Foswiki/UI/View.pm line 391
Foswiki::UI::View::view('Foswiki=HASH(0x15b1de0)') called at /var/www/ErgoQPM/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(0xbc7b60)', 'HASH(0x15ffcf0)') called at /var/www/ErgoQPM/lib/Foswiki/UI.pm line 435
Foswiki::UI::_execute('Foswiki::Request=HASH(0x15b03a0)', 'CODE(0x156eeb8)', 'view', 1) called at /var/www/ErgoQPM/lib/Foswiki/UI.pm line 274
Foswiki::UI::handleRequest('Foswiki::Request=HASH(0x15b03a0)') called at /var/www/ErgoQPM/lib/Foswiki/Engine/CGI.pm line 41
Foswiki::Engine::CGI::run('Foswiki::Engine::CGI=HASH(0xf95068)') called at /var/www/ErgoQPM/bin/view line 24.
UI.pm in line 316 calls Error.pm
The Apache log file after the edit is:
[Tue Oct 09 13:00:45 2012] [error] [client 10.3.2.10] Can't use string ("undef") as a HASH ref while "strict refs" in use at /var/www/ErgoQPM/lib/Foswiki/Plugins/FormPlugin.pm line 765., referer: http://10.3.2.156/bin/edit/ErgoQ/CompanyNo0001?t=1349776827
[Tue Oct 09 13:00:45 2012] [error] [client 10.3.2.10] at /var/www/ErgoQPM/lib/Foswiki/Plugins/FormPlugin.pm line 765, referer: http://10.3.2.156/bin/edit/ErgoQ/CompanyNo0001?t=1349776827
[Tue Oct 09 13:00:45 2012] [error] [client 10.3.2.10] \tFoswiki::Plugins::FormPlugin::_sessionSaveForm('QpmCompanyContactCreate', 'Foswiki::Plugins::FormPlugin::FormData=HASH(0x3333638)') called at /var/www/ErgoQPM/lib/Foswiki/Plugins/FormPlugin.pm line 269, referer: http://10.3.2.156/bin/edit/ErgoQ/CompanyNo0001?t=1349776827
[Tue Oct 09 13:00:45 2012] [error] [client 10.3.2.10] \tFoswiki::Plugins::FormPlugin::_endForm('Foswiki=HASH(0x15b1de0)', 'Foswiki::Attrs=HASH(0x3335b50)', 'CompanyNo0001', 'ErgoQ', 'Foswiki::Meta=HASH(0x2ca6a48)') called at /var/www/ErgoQPM/lib/Foswiki/Func.pm line 609, referer: http://10.3.2.156/bin/edit/ErgoQ/CompanyNo0001?t=1349776827
[Tue Oct 09 13:00:45 2012] [error] [client 10.3.2.10] \tFoswiki::Func::__ANON__('Foswiki=HASH(0x15b1de0)', 'Foswiki::Attrs=HASH(0x3335b50)', 'Foswiki::Meta=HASH(0x2ca6a48)') called at /var/www/ErgoQPM/lib/Foswiki.pm line 3112, referer: http://10.3.2.156/bin/edit/ErgoQ/CompanyNo0001?t=1349776827
[Tue Oct 09 13:00:45 2012] [error] [client 10.3.2.10] \tFoswiki::_expandMacroOnTopicRendering('Foswiki=HASH(0x15b1de0)', 'ENDFORM', undef, 'Foswiki::Meta=HASH(0x2ca6a48)') called at /var/www/ErgoQPM/lib/Foswiki.pm line 2988, referer: http://10.3.2.156/bin/edit/ErgoQ/CompanyNo0001?t=1349776827
[Tue Oct 09 13:00:45 2012] [error] [client 10.3.2.10] \tFoswiki::_processMacros('Foswiki=HASH(0x15b1de0)', '%TABPANE%\\x{a}%TAB{"%JQICON{user}% \\x{ce}\\x{a3}\\x{cf}\\x{84}\\x{ce}\\x{bf}\\x{ce}\\x{b9}\\x{cf}\\x{87}\\x{ce}\\x{b5}\\x{ce}\\x{af}\\x{ce}\\x{b1} \\x{ce}\\x{95}\\x{cf}\\x{84}\\x{ce}\\x{b1}\\x{ce}\\x{b9}\\x{cf}\\x{81}\\x{ce}\\x{b5}\\x{ce}...', 'CODE(0x1530c68)', 'Foswiki::Meta=HASH(0x2ca6a48)', 16) called at /var/www/ErgoQPM/lib/Foswiki.pm line 2785, referer: http://10.3.2.156/bin/edit/ErgoQ/CompanyNo0001?t=1349776827
[Tue Oct 09 13:00:45 2012] [error] [client 10.3.2.10] \tFoswiki::innerExpandMacros('Foswiki=HASH(0x15b1de0)', 'SCALAR(0x153c0c8)', 'Foswiki::Meta=HASH(0x2ca6a48)') called at /var/www/ErgoQPM/lib/Foswiki.pm line 3294, referer: http://10.3.2.156/bin/edit/ErgoQ/CompanyNo0001?t=1349776827
[Tue Oct 09 13:00:45 2012] [error] [client 10.3.2.10] \tFoswiki::expandMacros('Foswiki=HASH(0x15b1de0)', '%TABPANE%\\x{a}%TAB{"%JQICON{user}% \\x{ce}\\x{a3}\\x{cf}\\x{84}\\x{ce}\\x{bf}\\x{ce}\\x{b9}\\x{cf}\\x{87}\\x{ce}\\x{b5}\\x{ce}\\x{af}\\x{ce}\\x{b1} \\x{ce}\\x{95}\\x{cf}\\x{84}\\x{ce}\\x{b1}\\x{ce}\\x{b9}\\x{cf}\\x{81}\\x{ce}\\x{b5}\\x{ce}...', 'Foswiki::Meta=HASH(0x2ca6a48)') called at /var/www/ErgoQPM/lib/Foswiki/Meta.pm line 3143, referer: http://10.3.2.156/bin/edit/ErgoQ/CompanyNo0001?t=1349776827
[Tue Oct 09 13:00:45 2012] [error] [client 10.3.2.10] \tFoswiki::Meta::expandMacros('Foswiki::Meta=HASH(0x2ca6a48)', '%TABPANE%\\x{a}%TAB{"%JQICON{user}% \\x{ce}\\x{a3}\\x{cf}\\x{84}\\x{ce}\\x{bf}\\x{ce}\\x{b9}\\x{cf}\\x{87}\\x{ce}\\x{b5}\\x{ce}\\x{af}\\x{ce}\\x{b1} \\x{ce}\\x{95}\\x{cf}\\x{84}\\x{ce}\\x{b1}\\x{ce}\\x{b9}\\x{cf}\\x{81}\\x{ce}\\x{b5}\\x{ce}...') called at /var/www/ErgoQPM/lib/Foswiki/UI/View.pm line 411, referer: http://10.3.2.156/bin/edit/ErgoQ/CompanyNo0001?t=1349776827
[Tue Oct 09 13:00:45 2012] [error] [client 10.3.2.10] \tFoswiki::UI::View::_prepare('%TABPANE%\\x{a}%TAB{"%JQICON{user}% \\x{ce}\\x{a3}\\x{cf}\\x{84}\\x{ce}\\x{bf}\\x{ce}\\x{b9}\\x{cf}\\x{87}\\x{ce}\\x{b5}\\x{ce}\\x{af}\\x{ce}\\x{b1} \\x{ce}\\x{95}\\x{cf}\\x{84}\\x{ce}\\x{b1}\\x{ce}\\x{b9}\\x{cf}\\x{81}\\x{ce}\\x{b5}\\x{ce}...', 'Foswiki::Meta=HASH(0x2ca6a48)', 0) called at /var/www/ErgoQPM/lib/Foswiki/UI/View.pm line 391, referer: http://10.3.2.156/bin/edit/ErgoQ/CompanyNo0001?t=1349776827
[Tue Oct 09 13:00:45 2012] [error] [client 10.3.2.10] \tFoswiki::UI::View::view('Foswiki=HASH(0x15b1de0)') called at /var/www/ErgoQPM/lib/Foswiki/UI.pm line 316, referer: http://10.3.2.156/bin/edit/ErgoQ/CompanyNo0001?t=1349776827
[Tue Oct 09 13:00:45 2012] [error] [client 10.3.2.10] \tFoswiki::UI::__ANON__() called at /usr/share/perl5/Error.pm line 416, referer: http://10.3.2.156/bin/edit/ErgoQ/CompanyNo0001?t=1349776827
[Tue Oct 09 13:00:45 2012] [error] [client 10.3.2.10] \teval {...} called at /usr/share/perl5/Error.pm line 408, referer: http://10.3.2.156/bin/edit/ErgoQ/CompanyNo0001?t=1349776827
[Tue Oct 09 13:00:45 2012] [error] [client 10.3.2.10] \tError::subs::try('CODE(0xbc7b60)', 'HASH(0x15ffcf0)') called at /var/www/ErgoQPM/lib/Foswiki/UI.pm line 435, referer: http://10.3.2.156/bin/edit/ErgoQ/CompanyNo0001?t=1349776827
[Tue Oct 09 13:00:45 2012] [error] [client 10.3.2.10] \tFoswiki::UI::_execute('Foswiki::Request=HASH(0x15b03a0)', 'CODE(0x156eeb8)', 'view', 1) called at /var/www/ErgoQPM/lib/Foswiki/UI.pm line 274, referer: http://10.3.2.156/bin/edit/ErgoQ/CompanyNo0001?t=1349776827
[Tue Oct 09 13:00:45 2012] [error] [client 10.3.2.10] \tFoswiki::UI::handleRequest('Foswiki::Request=HASH(0x15b03a0)') called at /var/www/ErgoQPM/lib/Foswiki/Engine/CGI.pm line 41, referer: http://10.3.2.156/bin/edit/ErgoQ/CompanyNo0001?t=1349776827
[Tue Oct 09 13:00:45 2012] [error] [client 10.3.2.10] \tFoswiki::Engine::CGI::run('Foswiki::Engine::CGI=HASH(0xf95068)') called at /var/www/ErgoQPM/bin/view line 24., referer: http://10.3.2.156/bin/edit/ErgoQ/CompanyNo0001?t=1349776827
Something very similar happened in
NotificationPlugin.
This bug makes current Wiki apps unusable.
--
StefanosKouzof - 09 Oct 2012
Could you post the TML code you've used to create the topic?
--
ArthurClemens - 10 Oct 2012
This is a TML snipet from the topic with the code that creates the topic. All text is translated into english (original in greek)
%TABPANE%
%TAB{"%JQICON{folder}% Case Archive"}%
---+ Company Case Archive
| *Nr* | *Ref. Code* | *Title* | *Start Date* | *Budget* | *Status* |
%SEARCH{ "QpmCaseCompanyForm AND parent.name='%TOPIC%'" excludetopic="QpmCaseCompanyTemplate" pagesize="10" pager="on" scope="text" type="query" nosearch="on" nototal="on" format="| $percntCALC{\"$ROW(-1)\"}$percnt | $formfield(RefCode) | $topic | $createdate | $formfield(EndOffer) | $formfield(CaseStatus) |" }%
%ENDTAB%
%TAB{"%JQICON{application_form}% Submit Case"}%
---+ Submit New Case
<!--
%SEARCH{ "." topic="CompanyCaseNo*" scope="title" web="%WEB%" nonoise="on" reverse="on" format="" footer=" * $percntCALC{$SET(casecount, $nhits)}$percnt"}%
-->
%STARTFORM{name="QpmCaseCompanyCreate" action="save" web="%WEB%" topic="CompanyCaseNoAUTOINC0001" onSubmit="return notify(this)" method="post"}%
%FORMELEMENT{name="topicparent" type="hidden" default="%INCLUDINGTOPIC%"}%
%FORMELEMENT{name="TopicTitle" type="text" size="60" title="Case Title" mandatory="on"}%
%FORMELEMENT{name="RefCode" type="hidden" default="%CALC{"$EVAL( $VALUE($GET(casecount)) + 1 )"}%"}%
%FORMELEMENT{name="Client" type="hidden" value="%FORMFIELD{"TopicTitle"}%"}%
%FORMELEMENT{name="CaseInfo" type="textarea" rows="5" cols="80" title="Case Subject:"}%
%FORMELEMENT{name="templatetopic" type="hidden" default="QpmCaseCompanyTemplate"}%
%FORMELEMENT{name="action" type="submit" buttonlabel="Submit"}%
%ENDFORM%
%ENDTAB%
%ENDTABPANE%
--
StefanosKouzof - 10 Oct 2012
Or this one TML snipet, (in greek).
%TABPANE%
%TAB{"%JQICON{user}% Στοιχεία Εταιρείας"}%
%STARTFORM{name="QpmCompanyUpdate" action="save" topic="%WEB%.%TOPIC%" onSubmit="return notify(this)" method="post"}%
%FORMELEMENT{name="Status" type="radio" title="Κατάσταση Πελάτη:" cssclass="formPluginInlineLabels" options="Νέος, Ενεργός, Ανενεργός, Αρχείο" value="%FORMFIELD{"Status"}%"}%
%FORMELEMENT{name="CompanyName" type="text" size="93" title="Επωνυμία:" mandatory="on" value="%FORMFIELD{"CompanyName"}%" hint="To oνοματεπώνυμο, εάν είναι ατομική επιχείρηση"}%
%FORMELEMENT{name="Address" type="text" size="40" title="Διεύθυνση:" value="%FORMFIELD{"Address"}%"}%
%FORMELEMENT{name="Email" type="text" size="40" title="E-mail" value="%FORMFIELD{"Email"}%"}%
%FORMELEMENT{name="WorkPhone" type="text" size="40" title="Τηλέφωνο - Σταθερό:" value="%FORMFIELD{"WorkPhone"}%"}%
%FORMELEMENT{name="Url" type="text" size="40" title="Ιστοσελίδα:" value="%FORMFIELD{"Url"}%"}%
%FORMELEMENT{name="Fax" type="text" size="40" title="Φαξ" value="%FORMFIELD{"Fax"}%"}%
%FORMELEMENT{name="PostCode" type="text" size="40" title="Ταχ.Κώδικας" value="%FORMFIELD{"PostCode"}%"}%
%FORMELEMENT{name="Afm" type="text" size="40" title="ΑΦΜ:" value="%FORMFIELD{"VatNo"}%"}%
%FORMELEMENT{name="Doy" type="text" size="40" title="Δ.Ο.Υ:" value="%FORMFIELD{"IrsDesc"}%"}%
%FORMELEMENT{name="MeetingType" type="select" size="1" value="%FORMFIELD{"MeetingType"}%" options=" ,Δημόσιες Σχέσεις, Συνεργάτες, Web Site, Υφιστάμενος Πελάτης, Άλλο" title="Τρόπος γνωριμίας και σύστασης"}%
%FORMELEMENT{name="Description" type="textarea" rows="5" cols="88" title="Σχόλια" value="%FORMFIELD{"Description"}%"}%
%FORMELEMENT{name="TopicTitle" type="hidden" title="Τίτλος" value="%FORMFIELD{"TopicTitle"}%"}%
%FORMELEMENT{name="action" type="submit" buttonlabel="Ενημέρωση Στοιχείων"}%
%ENDFORM%
---++ Επαφές Εταιρείας
| *A/A* | *Ονοματεπώνυμο* | *Τηλ. - Σταθερό* | *Τηλ.- Κινητό* | *E-mail* | *Κατηγορία Επαφής* | *Σχόλια* |
%SEARCH{ "QpmContactCompanyForm AND parent.name='%TOPIC%'" excludetopic="ContactTemplate" scope="text" type="query" nosearch="on" nototal="on" format="| $percntCALC{\"$ROW(-1)\"}$percnt | [[$topic$][$formfield(TopicTitle)]] | $formfield(WorkPhone) | $formfield(MobilePhone) | $formfield(Email) | $formfield(Category) | $formfield(Description,60,...) |" }%
%ENDTAB%
%TAB{"%JQICON{group}% Καταχώρηση Επαφής"}%
---+ Καταχώρηση Νέας Επαφής
%STARTFORM{name="QpmCompanyContactCreate2" action="save" topic="ContactNoAUTOINC0001" onSubmit="return notify(this)" method="post"}%
%FORMELEMENT{name="topicparent" type="hidden" default="%INCLUDINGTOPIC%"}%
%FORMELEMENT{name="TopicTitle" type="text" title="Ονοματεπώνυμο" size="90" mandatory="on"}%
%FORMELEMENT{name="Email" type="text" size="40" title="E-mail"}%
%FORMELEMENT{name="WorkPhone" type="text" size="40" title="Τηλέφωνο - Σταθερό:"}%
%FORMELEMENT{name="MobilePhone" type="text" size="40" title="Τηλέφωνο - Κινητό:"}%
%FORMELEMENT{name="Category" type="radio" title="Κατηγορία Επαφής" options="Κύρια Επαφή, Δευτερεύουσα Επαφή"}%
%FORMELEMENT{name="Description" type="textarea" rows="5" cols="90" title="Σχόλια"}%
%FORMELEMENT{name="templatetopic" type="hidden" default="QpmContactCompanyTemplate"}%
%FORMELEMENT{name="action" type="submit" buttonlabel="Υποβολή"}%
%ENDFORM%
%ENDTAB%
%ENDTABPANE%
All greek characters are converted by the editor to HTML entities. The last form is named "QpmCompanyContactCreate2", because with the original form (named "QpmCompanyContactCreate") FOSWIKI was crashing
--
StefanosKouzof - 10 Oct 2012
It looks like SpreadSheetPlugin is acting up.
I get better results with escaping the CALC:
%FORMELEMENT{name="RefCode" type="hidden" default="$percntCALC{$quot$EVAL( $VALUE($GET(casecount)) + 1 )$quot}$percnt"}%
--
ArthurClemens - 10 Oct 2012
This change in behavior was unexpected, but the escaping worked like a charm. Thank you!
--
StefanosKouzof - 11 Oct 2012