Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Can't use string ("separator") as an ARRAY ref

Quote Reply
Can't use string ("separator") as an ARRAY ref
A user is getting the following error from one of my plugins
Can't use string ("separator") as an ARRAY ref ... admin/Links/Utils.pm line 492.

Utils .pm line 492 is in the sub format_title().

All my plugin is doing at this point is displaying a simple page Unsure
I do not have access to the admin yet.

Is there a way for me to check if the templates are where they should be
without actually looking on the server? :-)

I do know that the template that should be displayed has a crumb on it...
<div class="crumb"><%Links::Utils::format_title($main_title_loop, separator => $crumb_separator, no_escape_separator => $no_escape_crumb_separator, include_home => 1, link_type => 2)%></div>

And in my script, this is what displays the page...
print Links::SiteHTML::display('zipcode_search', { main_title_loop => Links::Build::build('title', Links::language('ZIP_SEARCH'), "$CFG->{db_cgi_url}/zipcode_search.cgi") });

Any suggestions are appreciated

Thank you,
Chris
RGB World, Inc. - Software &amp; Web Development.
rgbworld.com
Quote Reply
Re: [rgbworld] Can't use string ("separator") as an ARRAY ref In reply to
It looks like it's trying to use 'separator' as the main_title_loop, so there's probably something wrong with main_title_loop. Try doing a <%DUMP $main_title_loop%> to see what's in it.

Adrian
Quote Reply
Re: [brewt] Can't use string ("separator") as an ARRAY ref In reply to
Well I have some more info, but I am denied access to the admin, so my hands are tied.

For starts, deleting the crumb line from the template lets the page display.
But it does not even know the config options which should are obtained with:
Code:
<%Links::Plugins::get_plugin_user_cfg('ZipCodeSearch')%>
at the top of the template. Now I get unknown tag errors for items that are simple config settings

To me, the template looks like a mess. there are multiple doctypes, head and body tags.
My plugin was written to use the luna template set, and I believe it was installed to 'default' template set.

Is this going to work with the "default" templates? Because frankly it does not seem like this is my plugin's issue,
and I have never even looked at default templates. I thought those wre for pre 3.1 GLinks :-/

Here's a snippet of the html source code
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Zip Code Search</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="http://www.domain.com/static/utils.js"></script>
<script type="text/javascript">
//<![CDATA[
registerEvent(window, 'onload', function () {
var loginbar = document.getElementById('loginbar');
if (!loginbar)
return;
var loginlink = loginbar.firstChild;
if (loginlink.className != 'out')
return;
var cookies = document.cookie.split(';');
for (var i = 0; i <cookies.length; i++) {
if (cookies.match(/^\s*s=[0-9a-f]{32}\s*$/)) {
loginlink.href = 'http://www.domain.com/cgi-bin/links/user.cgi?logout=1';
loginlink.className = 'in';
loginlink.firstChild.nodeValue = 'Logout';
break;
}
}
});
//]]>
</script>
</head>
<body id="zipcode_search">
<div id="accessibility"><a href="#content">Skip to Content</a></div>
<hr class="hide" />
<div id="wrapper">

### This is not part of my template and must have been added by user ############

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML><HEAD><TITLE>ABC Film Guides: Your Guide To Entertainment</TITLE>
<LINK href="http://www.domain.com/css/style.css" type=text/css
rel=stylesheet>
<META http-equiv=Content-Type content=text/html;charset=ISO-8859-1>
<META content="MSHTML 6.00.2713.1100" name=GENERATOR></HEAD>
<BODY bgcolor="">
<FORM action="http://www.domain.com/links/cgi-bin/search.cgi" method="get">
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TR>
<TD bgColor=#958bf3 height=30>
<TABLE cellSpacing=0 cellPadding=6 width="100%" border=0>
<TR>
<TD class=toptext>&nbsp;&nbsp;&nbsp;ABC Film Guides</TD>
<TD class=toptext> <a href="http://www.domain.com/links/cgi-bin/user.cgi?signup_form=1"><div align="center">
<img src="http://www.domain.com/pics/join.gif" border="0" title="Join A Discussion Today, Dont Get Left Out !"></div></a> </TD>

<TD class=toptext align=right>Search: <INPUT
style="FONT-SIZE: 12px; BORDER-LEFT-COLOR: black; BORDER-BOTTOM-COLOR: black; COLOR: #000000; BORDER-TOP-STYLE: solid;
BORDER-TOP-COLOR: black; FONT-FAMILY: verdana, helvetica, sans-serif; BORDER-RIGHT-STYLE: solid; BORDER-LEFT-STYLE: solid;
BACKGROUND-COLOR: #ffffff; BORDER-RIGHT-COLOR: black; BORDER-BOTTOM-STYLE: solid"
name="query"> <input type=submit value="Search!"></TD></TR></TABLE></TD></TR>
<TR>
<TD bgColor=#000000 height=1></TD></TR>
<TR>
<TD class=pagetitle bgColor=#5666d1 height=75>&nbsp;&nbsp;Welcome</A></TD></TR>
<TR>
<TD bgColor=#000000 height=1></TD></TR>
<TR>
<TD bgColor=#b0e6ed height=1></TD></TR>
<TR>
<TD bgColor=#61ccda height=8>&nbsp;&nbsp;&nbsp; </TD></TR>
<TR>
<TD bgColor=#000000 height=1></TD></TR></TABLE></FORM>

################### End user mod #############################

<div id="ocwrapper">
<div id="icwrapper" class="clear">
<div id="leftsidebar">
</div>
<div id="contentwrapper" class="shadowleft">
<div class="shadowtop"><div class="shadowtopleft"></div><div class="shadowtopright"></div></div>
<div class="shadowright">
<div id="content">
<h2>Zip Code Search</h2>
<p>
Find links by zip code.
<br><br>
<form action="http://www.domain.com/cgi-bin/links/zipcode_search.cgi">
<div class="row required clear">
<label for="query" class="name">Zip Code:</label>

<div class="value">
<input type="text" id="query" name="query" value="" class="text" />
</div>
</div>
<div class="row required clear">
<label for="dist" class="name">Distance in Unknown Tag: 'units's:</label>
<div class="value">
<input type="text" id="dist" name="dist" value="" class="text" />
</div>
</div>
<div class="row searchoption clear">
<label for="mh" class="name">Links per page:</label>
<div class="value">
<select id="mh" name="mh">
<option>10</option>

<option selected="selected">25</option>
<option>50</option>
<option>100</option>
</select>
</div>
</div>
<div class="formsubmit">
<input type="submit" value="Search" class="submit" />
</div>
</form>
</p>
</div>
</div>
<div class="shadowbottom"><div class="shadowbottomleft"></div><div class="shadowbottomright"></div></div>

</div>
<div id="rightsidebar">
</div>
</div>
</div>

</div>
</body>
</html>

Units above in red, is simply the word "Miles" and should be coming from the plugin config options.

Thanks again for any input.
Chris
RGB World, Inc. - Software &amp; Web Development.
rgbworld.com