Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Help with this Error

Quote Reply
Help with this Error
Hello,

Just started to receive this error:



A fatal error has occured:
Illegal modulus zero at /hsphere/local/home/rascal/mysite.com/cgi-bin/links/admin/Links/Utils.pm line 513.What happened?

Quote Reply
Re: [rascal] Help with this Error In reply to
Can you show the relevant section of code?

The error would be caused when performing a modulus against zero, for example....

Code:
$somthing % $this;

...where $this is 0.

So perhaps a variable isn't being set correctly?
Quote Reply
Re: [Hargreaves] Help with this Error In reply to
Thanks for responding:


sub column_split {
# -------------------------------------------------------------------
# Calculate where the columns should be
#
my ($items, $columns) = @_;
#LINE 513 if ($items % $columns > 0) {
$items += ($columns - $items % $columns);
}
return $items / $columns;
}
Quote Reply
Re: [rascal] Help with this Error In reply to
Can anyone help with this problem!
Quote Reply
Re: [rascal] Help with this Error In reply to
Hi,

It seems that the $column is empty. Where do you call that?

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [rascal] Help with this Error In reply to
If you aren't sure where the code is being called from, just after:

Code:
my ($items, $columns) = @_;

...you can put:

Code:
print STDERR ("Caller: " . join(', ', caller()) . "\n");

...and then check your error log to see what it says.
Quote Reply
Re: [Hargreaves] Help with this Error In reply to
With your code in its place I received the following:



A fatal error has occured:
Undefined subroutine &Links::Utils::image_url called at /hsphere/local/home/XXX/mysite.com/cgi-bin/links/admin/Links/Utils.pm line 220.

Quote Reply
Re: [rascal] Help with this Error In reply to
That shouldn't happen. The code I gave should print some information for you in your web server error log and let the script continue to execute.

Can you show me what you now have?...perhaps there's a syntax error somewhere.
Quote Reply
Re: [Hargreaves] Help with this Error In reply to
Thank you so much for your help, but I must leave for work.

I will be back on at 11:30pm eastern standard time, hopefully you can continue to help if possible.
Quote Reply
Re: [rascal] Help with this Error In reply to
column_split is used in two places in the luna template set: home.html and category.html. The value that is passed in as the second argument comes from the globals home_category_cols and category_cols. So, your problem is either that you set those globals to 0, or removed them.

Adrian
Quote Reply
Re: [brewt] Help with this Error In reply to
Adrian,

Thanks for your help.


I checked the Home and Category Templates and column_split code looks ok, I do
not see anything in the globals.

What should be there?
Quote Reply
Re: [rascal] Help with this Error In reply to
Hi Rascal,

If you go into the admin panel in build > globals you will see that there are values attributed to :

'category_cols' => 2,
'category_separator' => ' > ',
'crumb_separator' => ' > ',
'detailed_max_reviews' => 5,
'home_category_cols' => 2,

This was taken from the globals.txt file in the luna template folder (better and quicker to do just change these through the admin panel though).

John
Significant Media
Quote Reply
Re: [Jag] Help with this Error In reply to
Thanks Jag,
Thanks Adrian,

That is what was missing from my globals file, still don't have any idea how it happened, very strange.

My site seems to be functioning ok but when I checked the Environment I receive the following:

Stack Trace
======================================
Links (22649): Links::environment called at GT::Template::_call_func line 737 with arguments
(0).
Links (22649): GT::Template::_call_func called at /hsphere/local/home/folder/mysite.com/cgi-bin/links/admin/templates/admin/compiled/setup_env.html.compiled line 261 with arguments
(GT::Template=HASH(0x9139f30), Links::environment, 0).
Links (22649): GT::Template::parsed_template called at /hsphere/local/home/folder/mysite.com/cgi-bin/links/admin/GT/Template.pm line 525 with arguments
(GT::Template=HASH(0x9139f30)).
Links (22649): GT::Template::_parse called at /hsphere/local/home/folder/mysite.com/cgi-bin/links/admin/GT/Template.pm line 139 with arguments
(GT::Template=HASH(0x9139f30), setup_env.html, HASH(0x9128738)).
Links (22649): GT::Template::parse called at Links::admin_page line 305 with arguments
(GT::Template, setup_env.html, ARRAY(0x9170bf8), HASH(0x9128738)).
Links (22649): Links::admin_page called at admin.cgi line 50 with no arguments.
Links (22649): main::main called at admin.cgi line 24 with no arguments.
Quote Reply
Re: [rascal] Help with this Error In reply to
Also Thank You Hargreaves for your help.
Quote Reply
Re: [rascal] Help with this Error In reply to
As I suspected more problems:
Content-type: text/html

<p><font face='Tahoma,Arial,Helvetica' size=2>A fatal error has occured:</font></p><blockquote><pre>Failed to execute query: 'SELECT lsql_Users.Username,lsql_Users.Email,lsql_Users.Name,lsql_Links.ID,lsql_Links.Title,lsql_Links.ExpiryDate FROM lsql_Links,lsql_Users WHERE lsql_Links.LinkOwner = lsql_Users.Username AND (lsql_Links.ExpiryDate < '1131902461' AND lsql_Links.ExpiryDate > '-1' AND lsql_Links.ExpiryNotify < '2') ORDER BY Username': MySQL server has gone away at /hsphere/local/home/rascal/mysite.com/cgi-bin/links/admin/Links/Payment.pm line 1450.
</pre></blockquote><p><font face='Tahoma,Arial,Helvetica' size=2>Please enable debugging in setup for more details.</font></p>
Failed to execute query: 'SELECT lsql_Users.Username,lsql_Users.Email,lsql_Users.Name,lsql_Links.ID,lsql_Links.Title,lsql_Links.ExpiryDate FROM lsql_Links,lsql_Users WHERE lsql_Links.LinkOwner = lsql_Users.Username AND (lsql_Links.ExpiryDate < '1131902461' AND lsql_Links.ExpiryDate > '-1' AND lsql_Links.ExpiryNotify < '2') ORDER BY Username': MySQL server has gone away at /hsphere/local/home/rascal/mysite.com/cgi-bin/links/admin/Links/Payment.pm line 1450.
Quote Reply
Re: [rascal] Help with this Error In reply to
Solved problem by changing the Select Call, then changing it back again.
Sounds strange, but it solved the problem.

It seems like Mysql was locked-up or something.

I have found no other problems, could someone explain why I'm getting this:


Stack Trace
======================================
Links (22649): Links::environment called at GT::Template::_call_func line 737 with arguments
(0).
Links (22649): GT::Template::_call_func called at /hsphere/local/home/folder/mysite.com/cgi-bin/links/admin/templates/admin/compiled/setup_env.html.compiled line 261 with arguments
(GT::Template=HASH(0x9139f30), Links::environment, 0).
Links (22649): GT::Template::parsed_template called at /hsphere/local/home/folder/mysite.com/cgi-bin/links/admin/GT/Template.pm line 525 with arguments
(GT::Template=HASH(0x9139f30)).
Links (22649): GT::Template::_parse called at /hsphere/local/home/folder/mysite.com/cgi-bin/links/admin/GT/Template.pm line 139 with arguments
(GT::Template=HASH(0x9139f30), setup_env.html, HASH(0x9128738)).
Links (22649): GT::Template::parse called at Links::admin_page line 305 with arguments
(GT::Template, setup_env.html, ARRAY(0x9170bf8), HASH(0x9128738)).
Links (22649): Links::admin_page called at admin.cgi line 50 with no arguments.
Links (22649): main::main called at admin.cgi line 24 with no arguments.
Quote Reply
Re: [rascal] Help with this Error In reply to
There's no error there, it's just debugging.
Quote Reply
Re: [Hargreaves] Help with this Error In reply to
Thanks Hargreaves,

I can stop being nervous now!