Item14786: Undeclared variable in JsonSQLPlugin

pencil
Priority: Normal
Current State: New
Released In: n/a
Target Release: patch
Applies To: Extension
Component: JsonSQLPlugin
Branches:
Reported By: IgorGiunta
Waiting For:
Last Change By: MichaelDaum
After manual installation, was performing the test according to https://foswiki.org/Extensions/SolrPlugin#Test

root@vm.foswiki:/www/foswiki-test/tools# ./solrindex topic=Main.WebHome
when is experimental at /usr/local/share/perl/5.22.1/JsonSQL/Param/Join.pm line 42.
when is experimental at /usr/local/share/perl/5.22.1/JsonSQL/Param/Join.pm line 43.
when is experimental at /usr/local/share/perl/5.22.1/JsonSQL/Param/Join.pm line 44.
when is experimental at /usr/local/share/perl/5.22.1/JsonSQL/Param/Join.pm line 45.
when is experimental at /usr/local/share/perl/5.22.1/JsonSQL/Param/Join.pm line 46.
when is experimental at /www/Foswiki-2.1.6/lib/Foswiki/Plugins/JsonSQLPlugin.pm line 160.
when is experimental at /www/Foswiki-2.1.6/lib/Foswiki/Plugins/JsonSQLPlugin.pm line 161.
| 2018-11-15T10:49:08+01:00 error | Foswiki::Plugins::JsonSQLPlugin could not be loaded.  Errors were:
Bareword "DEBUG" not allowed while "strict subs" in use at /www/Foswiki-2.1.6/lib/Foswiki/Plugins/JsonSQLPlugin.pm line 164.
Bareword "DEBUG" not allowed while "strict subs" in use at /www/Foswiki-2.1.6/lib/Foswiki/Plugins/JsonSQLPlugin.pm line 165.
Bareword "DEBUG" not allowed while "strict subs" in use at /www/Foswiki-2.1.6/lib/Foswiki/Plugins/JsonSQLPlugin.pm line 170.
Bareword "DEBUG" not allowed while "strict subs" in use at /www/Foswiki-2.1.6/lib/Foswiki/Plugins/JsonSQLPlugin.pm line 180.
Bareword "DEBUG" not allowed while "strict subs" in use at /www/Foswiki-2.1.6/lib/Foswiki/Plugins/JsonSQLPlugin.pm line 195.
Bareword "DEBUG" not allowed while "strict subs" in use at /www/Foswiki-2.1.6/lib/Foswiki/Plugins/JsonSQLPlugin.pm line 235.
Bareword "DEBUG" not allowed while "strict subs" in use at /www/Foswiki-2.1.6/lib/Foswiki/Plugins/JsonSQLPlugin.pm line 336.
Bareword "DEBUG" not allowed while "strict subs" in use at /www/Foswiki-2.1.6/lib/Foswiki/Plugins/JsonSQLPlugin.pm line 337.
Bareword "DEBUG" not allowed while "strict subs" in use at /www/Foswiki-2.1.6/lib/Foswiki/Plugins/JsonSQLPlugin.pm line 338.
Bareword "DEBUG" not allowed while "strict subs" in use at /www/Foswiki-2.1.6/lib/Foswiki/Plugins/JsonSQLPlugin.pm line 345.
Compilation failed in require at (eval 117) line 2.
BEGIN failed--compilation aborted at (eval 117) line 2.

---- |
Indexing topic Main.WebHome

Looking closer at the code
root@vm.foswiki:/www/foswiki-test/tools# vim /www/Foswiki-2.1.6/lib/Foswiki/Plugins/JsonSQLPlugin.pm

I remarked that the debug toogle variable is undefined, since commented:
#use constant DEBUG => 1;    # toggle me

Once set to zero like this
use constant DEBUG => 0;    # toggle me

I got the expected result:
root@vm.foswiki:/www/foswiki-test/tools# ./solrindex topic=Main.WebHome
when is experimental at /usr/local/share/perl/5.22.1/JsonSQL/Param/Join.pm line 42.
when is experimental at /usr/local/share/perl/5.22.1/JsonSQL/Param/Join.pm line 43.
when is experimental at /usr/local/share/perl/5.22.1/JsonSQL/Param/Join.pm line 44.
when is experimental at /usr/local/share/perl/5.22.1/JsonSQL/Param/Join.pm line 45.
when is experimental at /usr/local/share/perl/5.22.1/JsonSQL/Param/Join.pm line 46.
when is experimental at /www/Foswiki-2.1.6/lib/Foswiki/Plugins/JsonSQLPlugin.pm line 161.
when is experimental at /www/Foswiki-2.1.6/lib/Foswiki/Plugins/JsonSQLPlugin.pm line 162.
Indexing topic Main.WebHome

-- IgorGiunta - 15 Nov 2018

This is indeed an error in JsonSQLPlugin that probably fills your logs even without calling solr.

-- MichaelDaum - 15 Nov 2018
 
Topic revision: r3 - 16 Apr 2019, MichaelDaum
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