Forum

Thread tagged as: Problem, Error

Error message started on a page

Grateful for any help, site has started this - other pages set up similar are ok. Thank you.

Error message, Diagnostics, template included


Warning: strlen() expects parameter 1 to be string, array given in /home/estherco/public_html/perch/core/lib/PerchTemplate.class.php on line 323 ~~~~
Perch: 2.8.17, PHP: 5.3.29, MySQL: 5.5.52, with PDO
Server OS: Linux, cgi-fcgi
Installed apps: content (2.8.17), assets (2.8.17), categories (2.8.17)
App runtimes: <?php include(PERCH_PATH.'/core/apps/content/runtime.php'); ?>
PERCH_LOGINPATH: /perch
PERCH_PATH: /home/estherco/public_html/perch
PERCH_CORE: /home/estherco/public_html/perch/core
PERCH_RESFILEPATH: /home/estherco/public_html/perch/resources
Image manipulation: GD
PHP limits: Max upload 100M, Max POST 512M, Memory: 512M, Total max file upload: 100M
Resource folder writeable: Yes
DOCUMENT_ROOT: /home/estherco/public_html
HTTP_HOST: esthercommunity.org.uk
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php

Template

<div class="col-sm-6 col-md-6 col-lg-6">

<perch:if exists="image"> <p><img class="img-responsive" src="<perch:content id="image" type="image" label="Image" width="640" />" alt="<perch:content type="text" id="alt" label="Description" help="SEO description of image" />"></p> <perch:content id="image" type="image" label="Image" width="165" suppress="true" /> <perch:content id="image" type="image" label="Image" width="125" suppress="true" /> </perch:if>

</div> <div class="col-sm-6 col-md-6 col-lg-6">

<p class="date"><perch:content id="date" type="date" label="Date" format="%d %B %Y" required="true" /></p>

<h2><perch:content id="newstitle" type="text" label="News title" required="true" title="true" suppress="true"/></h2>

<h2><perch:content id="newsdescription" type="textarea" label="News Article Summary (150 characters for SEO description also appears at top of article)" editor="markitup" html="false" help="Important for SEO" /></h2>

<perch:content id="desc" type="textarea" label="News text" editor="ckeditor" html="true" />

<p><button class="button" onclick="goBack()">« Back</button></p>

</div>

<perch:content id="slug" for="newstitle" type="slug" suppress="true" />

~~~~

Phil Wragg

Phil Wragg 0 points

  • 4 years ago

Hi Phil,

The first thing I would do is update Perch to the latest version - this might not fix the issue but that's what the Perch guys will say to try first.

Drew McLellan

Drew McLellan 2638 points
Perch Support

What changed between when it was last working and now?

Any reason not to update here?

Ok have updated - still get error sorry

Warning: strlen() expects parameter 1 to be string, array given in /home/estherco/public_html/perch/core/lib/PerchTemplate.class.php on line 348~~~

Perch: 2.8.34, PHP: 5.3.29, MySQL: 5.5.52, with PDO
Server OS: Linux, cgi-fcgi
Installed apps: content (2.8.34), assets (2.8.34), categories (2.8.34)
App runtimes: <?php include(PERCH_PATH.'/core/apps/content/runtime.php'); ?>
PERCH_LOGINPATH: /perch
PERCH_PATH: /home/estherco/public_html/perch
PERCH_CORE: /home/estherco/public_html/perch/core
PERCH_RESFILEPATH: /home/estherco/public_html/perch/resources
Image manipulation: GD
PHP limits: Max upload 100M, Max POST 512M, Memory: 512M, Total max file upload: 100M
F1: 6a33f95eca3667f9e0c39bf5ca2980fe
Resource folder writeable: Yes
DOCUMENT_ROOT: /home/estherco/public_html
HTTP_HOST: esthercommunity.org.uk
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php

~~~

Drew McLellan

Drew McLellan 2638 points
Perch Support

What changed between when it was last working and now?

Nothing - site has been untouched.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Something must have changed - did the server get upgraded?

What happens why you re-save the content?

Does the same happen in your dev environment?

Same after re save.

Just thought the error message might mean something to someone.

Its a 3 year old site. On typical reseller account.

Drew McLellan

Drew McLellan 2638 points
Perch Support

That error is from the chars tag attribute, but the template you're showing us does not use that attribute.

Is this the right template?

Thanks Drew for persisting!

Ok that's it. I had a small template for the meta (below). I've deleted the description element with the 'chars'and all ok. To be honest cant remember what I was attempting there! Looks dubious! ~~~

<title><perch:content id="newstitle" type="text" label="News title" /></title> <meta name="description" content="<perch:content id="newsdescription" chars="160" append="..." />">

~~~~

Drew McLellan

Drew McLellan 2638 points
Perch Support

Looks like you're missing the type attribute.