Closed (fixed)
Project:
Easy Breadcrumb
Version:
6.x-1.15
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
21 Jun 2012 at 15:05 UTC
Updated:
26 Jul 2012 at 16:26 UTC
Hi,
I'm not sure if this is related to http://drupal.org/node/1591784 but when I enable the module I get :
warning: htmlspecialchars() expects parameter 1 to be string, array given in /opt/drupal/core/corporate/6.25/includes/bootstrap.inc on line 860.
disable the module and it disappears. My easy_breadcrumb settings are default.
Can you help?
Comments
Comment #1
Dimitris Nik commentedHi,
I have exactly the same problem. The module is great and works great. The generated breadcrumb is correct but always get this warning:
warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/mywebsite/public_html/mywebsite.com/includes/bootstrap.inc on line 860.
warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/mywebsite/public_html/mywebsite.com/includes/bootstrap.inc on line 860.
warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/mywebsite/public_html/mywebsite.com/includes/bootstrap.inc on line 860.
Every breadcrumb item returns an error warning. I'm using Easy Breadcrumb 6.x-1.13 and Drupal 6.25. Any idea to solve this?
Comment #2
sonemonu commentedFixed in 6.x-1.14.
Comment #3
ycle commentedno, it still exists on 6.26 having those modules activated:
SELECT name, info FROM `system` WHERE (status='1' and type='module')
"admin_menu","6.x-1.8\"
"block","6.26\"
"blog","6.26\"
"book","6.26\"
"book_block_panel","6.x-1.13\"
"ckeditor","6.x-1.10\"
"collapse_text","6.x-2.7\"
"color","6.26\"
"comment","6.26\"
"content","6.x-2.9\"
"content_copy","6.x-2.9\"
"content_permissions","6.x-2.9\"
"ctools","6.x-1.8\"
"ctools_access_ruleset","6.x-1.8\"
"ctools_ajax_sample","6.x-1.8\"
"ctools_custom_content","6.x-1.8\"
"customfilter","6.x-1.0-rc2\"
"dblog","6.26\"
"draggableviews","6.x-3.5\"
"easy_breadcrumb","6.x-1.14\"
"fieldgroup","6.x-2.9\"
"filter","6.26\"
"geshifield","6.x-1.4\"
"geshifilter","6.x-1.4\"
"geshinode","6.x-1.4\"
"help","6.26\"
"imce","6.x-2.3\"
"jquerymenu","6.x-3.3\"
"jquery_ui","6.x-1.5\"
"ldapauth","6.x-1.0-beta2\"
"ldapgroups","6.x-1.0-beta2\"
"lightbox2","6.x-1.11\"
"lineage","6.x-1.1\"
"menu","6.26\"
"menu_per_role","6.x-1.11\"
"node","6.26\"
"nodeaccess","6.x-1.3\"
"nodeaccess_book_inherit","6.x-1.x-dev\"
"nodeorder","6.x-1.1\"
"nodereference","6.x-2.9\"
"number","6.x-2.9\"
"optionwidgets","6.x-2.9\"
"page_manager","6.x-1.8\"
"panels","6.x-3.10\"
"panels_ipe","6.x-3.10\"
"panels_mini","6.x-3.10\"
"panels_node","6.x-3.10\"
"path","6.26\"
"pathauto","6.x-1.6\"
"search","6.26\"
"securepages","6.x-1.9\"
"stylizer","6.x-1.8\"
"subpath_alias","6.x-1.1\"
"system","6.26\"
"taxonomy","6.26\"
"taxonomy_access","6.x-1.3\"
"text","6.x-2.9\"
"token","6.x-1.18\"
"trigger","6.26\"
"update","6.26\"
"upload","6.26\"
"url_alter","6.x-1.2\"
"user","6.26\"
"userreference","6.x-2.9\"
"vertical_tabs","6.x-1.0-rc2\"
"views","6.x-3.0\"
"views_accordion","6.x-1.5\"
"views_content","6.x-1.8\"
"views_export","6.x-3.0\"
"views_ui","6.x-3.0\"
Comment #4
ycle commentedre-open, sry..
Comment #5
jinky32 commentedyep, still exists for me too. Sorry
Comment #6
chandra_drupal commentedany other solution for bread crumb ? please if you found any
Comment #7
stuart.crouch commentedHi
I've had a look at the code and I think the problem is that you've created the options array that you pass to the l() function incorrectly.
You are creating an array containing attributes, which contains class.
The value of class is meant to be a string, that the l() function then appends " active" if necessary.
Because you've passed an array of classes rather than a string containing the list of classes you want, this function replaces the array with an array of the word active. This is then passed through via about 4 functions to htmlspecialchars() and an error is thrown.
If you change your code as follows, the error disappears and I think it keeps the functionality you were trying to achieve.
line 30
$breadcrumb[] = l($front_text, '', array('attributes' => array('class' => $segments_classes[1])));
line 87
$breadcrumb[] = l($segment_text, $segment_url, array('attributes' => array('class' => $segments_classes[1])));
line 118
$breadcrumb[] = l($page_title, $alias, array('attributes' => array('class' => $segments_classes[1])));
Of course this means your code can be re-factored as you don't need the $segments_classes array at all.
Let us know if that helps, we at the OU are very keen to use this module but the amount of errors it throws into the logs makes site debugging very difficult at the moment.
Comment #8
sonemonu commentedCorrected in 6.x-1.15.
Thanks stuart.crouch, it was useful. The thing is this is a port of the original D7 released version, in D7 the function "l" receives an array for the attribute 'class', D6 does receives a string (as you pointed out). Thanks.
Btw: I used the "join" function of PHP, since the position number [1] of the $segments_classes is variable.
Comment #9
stuart.crouch commentedGlad I could help nail down the cause. I didn't know if what I'd come up with would match exactly what you needed, but it looks like you sussed it from this new build. Nice work.