This question about Using an extension: Asked

Can't use an undefined value as an ARRAY reference at .../foswiki/lib/Foswiki/Plugins/FormPlugin.pm line 556.

-- NicoleMirow - 17 Aug 2012

This is what i see in browser: Foswiki detected an internal error - please check your Foswiki logs and webserver logs for more information.

Can't use an undefined value as an ARRAY reference

The foswiki warn log shows: Can't use an undefined value as an ARRAY reference at .../foswiki/lib/Foswiki/Plugins/FormPlugin.pm line 556

This is what i see in apache log: [warn] mod_fcgid: stderr: Can't use an undefined value as an ARRAY reference at .../foswiki/lib/Foswiki/Plugins/FormPlugin.pm line 556.

Is this a problem in extension FormPlugin or of misuse?

-- NicoleMirow - 17 Aug 2012

I'm experiencing same issue with Foswiki 1.1.6. As I found out does this error occur only if "elementformat" is used. Here is an example I use to reproduce that error:
%STARTFORM{
   elementformat="$t $e $n"
   name="Test"
   action="view"
}%%FORMELEMENT{
   name="test"
   type="text"
   title="Test"
}%%FORMELEMENT{
   name="action"
   type="submit"
   buttonlabel="Submit"
}%%ENDFORM%

   * test = %<nop>URLPARAM{"test"}%

Initially the page is rendered fine. But when entering some text and press submit it results into this "Can't use an undefined value as an ARRAY reference" error. Apaches error.log is reveiving the following messages:

| 2013-01-17T15:22:34Z warning | Can't use an undefined value as an ARRAY reference at /data/www/foswiki/lib/Foswiki/Plugins/FormPlugin.pm line 556.
 at /data/www/foswiki/lib/Foswiki/Plugins/FormPlugin.pm line 556
        Foswiki::Plugins::FormPlugin::__ANON__('t') called at /data/www/foswiki/lib/Foswiki/Plugins/FormPlugin.pm line 584
        Foswiki::Plugins::FormPlugin::_substituteFieldTokens('Foswiki::Request=HASH(0x12ce528)', 'Foswiki::Plugins::FormPlugin::FormData=HASH(0x7f46e7433cb8)') called at /data/www/foswiki/lib/Foswiki/Plugins/FormPlugin.pm line 448
        Foswiki::Plugins::FormPlugin::_redirectToActionUrl('Foswiki::Plugins::FormPlugin::FormData=HASH(0x7f46e7433cb8)') called at /data/www/foswiki/lib/Foswiki/Plugins/FormPlugin.pm line 193
        Foswiki::Plugins::FormPlugin::_verifyForm('Foswiki::Plugins::FormPlugin::FormData=HASH(0x7f46e7436838)') called at /data/www/foswiki/lib/Foswiki/Plugins/FormPlugin.pm line 143
        Foswiki::Plugins::FormPlugin::_startForm('Foswiki=HASH(0x137e330)', 'Foswiki::Attrs=HASH(0x7f46e74362e0)', 'FormPluginTest', 'Sandbox', 'Foswiki::Meta=HASH(0x2d68158)') called at /data/www/foswiki/lib/Foswiki/Func.pm line 609
        Foswiki::Func::__ANON__('Foswiki=HASH(0x137e330)', 'Foswiki::Attrs=HASH(0x7f46e74362e0)', 'Foswiki::Meta=HASH(0x2d68158)') called at /data/www/foswiki/lib/Foswiki.pm line 3142
        Foswiki::_expandMacroOnTopicRendering('Foswiki=HASH(0x137e330)', 'STARTFORM', '\x{a}   elementformat="$t $e $n"\x{a}   name="Test"\x{a}   action="view"\x{a}', 'Foswiki::Meta=HASH(0x2d68158)') called at /data/www/foswiki/lib/Foswiki.pm line 3018
        Foswiki::_processMacros('Foswiki=HASH(0x137e330)', '%STARTFORM{\x{a}   elementformat="$t $e $n"\x{a}   name="Test"\x{a}   act...', 'CODE(0x1243580)', 'Foswiki::Meta=HASH(0x2d68158)', 16) called at /data/www/foswiki/lib/Foswiki.pm line 2815
        Foswiki::innerExpandMacros('Foswiki=HASH(0x137e330)', 'SCALAR(0x124f7f0)', 'Foswiki::Meta=HASH(0x2d68158)') called at /data/www/foswiki/lib/Foswiki.pm line 3324
        Foswiki::expandMacros('Foswiki=HASH(0x137e330)', '%STARTFORM{\x{a}   elementformat="$t $e $n"\x{a}   name="Test"\x{a}   act...', 'Foswiki::Meta=HASH(0x2d68158)') called at /data/www/foswiki/lib/Foswiki/Meta.pm line 3140
        Foswiki::Meta::expandMacros('Foswiki::Meta=HASH(0x2d68158)', '%STARTFORM{\x{a}   elementformat="$t $e $n"\x{a}   name="Test"\x{a}   act...') called at /data/www/foswiki/lib/Foswiki/UI/View.pm line 412
        Foswiki::UI::View::_prepare('%STARTFORM{\x{a}   elementformat="$t $e $n"\x{a}   name="Test"\x{a}   act...', 'Foswiki::Meta=HASH(0x2d68158)', 0) called at /data/www/foswiki/lib/Foswiki/UI/View.pm line 392
        Foswiki::UI::View::view('Foswiki=HASH(0x137e330)') called at /data/www/foswiki/lib/Foswiki/UI.pm line 316
        Foswiki::UI::__ANON__() called at /usr/lib/perl5/site_perl/5.10.0/Error.pm line 419
        eval {...} called at /usr/lib/perl5/site_perl/5.10.0/Error.pm line 411
        Error::subs::try('CODE(0x7aec98)', 'HASH(0x137def8)') called at /data/www/foswiki/lib/Foswiki/UI.pm line 435
        Foswiki::UI::_execute('Foswiki::Request=HASH(0x12ce528)', 'CODE(0x1287078)', 'view', 1) called at /data/www/foswiki/lib/Foswiki/UI.pm line 274
        Foswiki::UI::handleRequest('Foswiki::Request=HASH(0x12ce528)') called at /data/www/foswiki/lib/Foswiki/Engine/CGI.pm line 41
        Foswiki::Engine::CGI::run('Foswiki::Engine::CGI=HASH(0xae9a00)') called at /data/www/foswiki/bin/view line 24.

If I remove the line elementformat="$t $e $n" in the example then everything works fine.

Is there any help available for this problem?

-- MathiasWindt - 17 Jan 2013
 

QuestionForm edit

Subject Using an extension
Extension FormPlugin
Version Foswiki 1.0.9
Status Asked
Related Topics
Topic revision: r2 - 17 Jan 2013, MathiasWindt
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