Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Jump.pm -- bug suspected, found and fixed

Quote Reply
Jump.pm -- bug suspected, found and fixed
Sorry if this appears elsewhere -- we searched, but found no reference to it.

If the site is disabled, we would expect jump.cgi to display the error.html template if clicked in a static page.
But it didn't. We got ...
Code:
A fatal error has occured:

Undefined subroutine &Links::SiteHTML::display called at
<PATH_TO>/admin/Links.pm line 154.

Line 154 is
Code:
print Links::SiteHTML::display('error', { error => Links::language('GENERAL_DISABLED') });

SiteHTML.pm definitely has a sub display.
Other user .CGIs display error.html as expected. Only jump.cgi failed.

Here is the Stack Trace ...
Code:
Links (538309): Links::environment called at <PATH_TO>/admin/Links.pm line 430 with no arguments.

Links (538309): Links::fatal called at <PATH_TO>/admin/Links.pm line 154 with arguments
(Undefined subroutine &Links::SiteHTML::display called at <PATH_TO>/admin/Links.pm line 154.
).

Links (538309): Links::check_request called at <PATH_TO>/admin/GT/Plugins.pm line 108 with no arguments.

Links (538309): GT::Plugins::dispatch called at <PATH_TO>/jump.cgi line 25 with arguments
(GT::Plugins, <PATH_TO>/admin/Plugins, check_request, CODE(0x1b1d4b4)).

Line 25 of jump.cgi is identical in all the other user CGIs ...
Code:
if (GT::Plugins->dispatch ($CFG->{admin_root_path} . '/Plugins', 'check_request', \&Links::check_request)) {

Because of this, we thought the problem might be in Jump.pm. Comparing with Add.pm, etc, we noticed the absence of
use Links::SiteHTML;
at line 18.

The first 5 code lines of .../admin/Links/User/Jump.pm are now ...
Code:
package Links::User::Jump;
# ==================================================================
use strict;
use Links qw/$DB $IN $USER $CFG/;
use Links::SiteHTML;
... which fixes the problem.