Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

undefined array

Quote Reply
undefined array
I have a problem and I hope you can help me. If I search something with search.cgi, sometime I get the following software error (always with the same words):

Can't use an undefined value as an ARRAY reference at admin/Links/Search.pm line 923.

The same search-words in search-ni.cgi work fine. I did a reindex. I have found something in this forum here, but the tips are already in LinksSQL 1.13.

Most of my search-words work, but some not. I have added some new table fields, may it be that? Every day I do an update, therefore I add some new links with the editor cgi. I think those new links cause this error (but I am not sure). Hope you can help me! Thanks!

Quote Reply
Re: undefined array In reply to
If your line 923 is the same as mine, it's the 'mh' variable.

You are probably not setting it from some forms, and if it's 'undefined' when it hits an 'if' test, you generate warnings and/or errors.

Make sure you have 'mh' defined from your forms, or defined at the top of the search.cgi -- or at least set to default to a reasonable value such as '10' or '15' if no value is passed.

http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/

Quote Reply
Re: undefined array In reply to
Thanks for your answer, but that is it not. The search-string passed to search.cgi contains mh=25. I do use the original search.html and (almost) the original search.cgi. Other search-queries do work well, but only some not. It must have something to do either with adding new fields to the table or with importing links via editor.cgi. I guess... Any ideas? But thanks for your help!!

Quote Reply
Re: undefined array In reply to
Sounds like the result of a mod to search.cgi!!

I had a similar problem after I'd modified search.cgi - "Software error: Range iterator outside integer range at search.cgi line 244." - and it only occured with certain words, the rest of the time it worked fine.

To confirm it was something I'd done, I uploaded the original version of search.cgi from the LSQL zip file and it worked fine - even with the words that produced the error in my modified version.

I'd have a good look at any mods you might have done to search.cgi, or maybe upload the original one and add your mods one at a time to see which one might be causing the problem.

All the best
Shaun

Quote Reply
Re: undefined array In reply to
I thought the same, but search.cgi is not the matter. I uploaded the orginal one, but the same error. I'll try deleting the links and reimport them. Maybe that works. The problem is, that importing from a file is not that easy as it should be (my provider is reeeaally slow...). I'll tell you if it worked. Thanks a lot!