The special characters error appears to have come back in the 16-Dec dev:

    * warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/htdocs/drupal/includes/bootstrap.inc on line 857.
    * warning: implode() [function.implode]: Invalid arguments passed in /home/htdocs/drupal/sites/all/modules/views/handlers/views_handler_argument_string.inc on line 276.

The first error seems to be extensively abused in various threads...I don't have the capacity to figure out where to start from that side of things.

In terms of troubleshooting, I can definitely say that this error was not ocurring in the Dec-14 dev. Immediately after upgrade it appears.

What can I add to assist?

Comments

merlinofchaos’s picture

We'll need to know precisely what was happening at the time of the error. What I can tell from the error is that a string argument is involved. So there's a view with an argument somehow involved here, and my guess is that somehow there's some bad data getting to that argument.

boabjohn’s picture

Howdy Merlin: thanks for the fast response...but can you tell me what you need?

What was happening (transaction wise) was nothing....I had taken the site offline, backed up the data, and then used drush to dl the Dec 16 dev...I did not drush up, otherwise I would have been able to get back to the Dec 14 dev.

I also updated the imagefield and filefield modules to matching 6.x-3.9 releases.

I'm still on D6.19

When I cleared cache and started clicking through the site several things were obvious:

- the errors cited above
- all of the layout on the front page is missing, leaving only the node content
- all of the sidebar menus are gone.

In 20+ sites I've never seen this sort of combined error...obviously it may not be only Views involved: but that's the central item that has changed.

What can I provide to assist with troubleshooting?

merlinofchaos’s picture

Well, we really need to try and reduce it to which view it is. Does the error happen on every page? If so, that suggests it's either a block view or a view with a visible menu item, since those are the only views that are going to be referenced on every page. You can then go through your block UI and start disabling views and menu blocks to see if something changes. If you've got a view in the primary links you probably can't disable that from the blocks as easily, but you can disable that just by disabling the view.

With a little clicking around we should be able to isolate where this is happening.

From the sound of the error, this is also the kind of thing I've seen reports about if both the tracker view is enabled and the tracker module is enabled. Views' attempts to steal menu items from existing modules is not perfect and that's one place that it's known to cause problems.

boabjohn’s picture

StatusFileSize
new59.17 KB

A brief update: I do have a dev site set up and was able to grab the previous version of Views (Dec 14 dev) and install it on the broken production site. The error has continues. That doesn't fit my theory that something inside the latest Views is causing the problem.

The error is not on every page.

I have turned the Tracker module off: errors persisted. I need the Tracker view...and the errors are showing up on pages w/out the Tracker view.

Following your advice, I've taken a problem page and turned the views/panel_panes off until I could isolate the problem view.

It occurs in the "blog" view which I've exported and attached here for reference.

Problem displays (for certain) are panel panes 1 and 2

What can I do next?

tomtom122’s picture

StatusFileSize
new34.39 KB

I have the same error.

I've attached my exported views.

Renee S’s picture

I'm seeing it too, when I have a panel pane view enabled. Block view and context view works fine. Views3, PHP5.3.

nchase’s picture

Same issue. Working fine with views 2 and views alpha 3 . Latest dev gives this error:

warning: htmlspecialchars() expects parameter 1 to be string, array given in /includes/bootstrap.inc on line 857.
warning: implode() [function.implode]: Invalid arguments passed in /sites/all/modules/views/handlers/views_handler_argument_string.inc on line 276.
warning: htmlspecialchars() expects parameter 1 to be string, array given in /includes/bootstrap.inc on line 857.

I have to check which view is causing the error.

zuzu83’s picture

same error

heyyo’s picture

I also have this error with a view pane listing nodes in current user language from a nodequeue (nodequeue relationship + nodequeue filter + nodequeue argument term id received by panel context)

kurt-s’s picture

Im Getting the same error too, After updating to the newest dev. At least im not alone i guess. Any help would be awesome. Thanks.

warning: htmlspecialchars() expects parameter 1 to be string, array given in includes/bootstrap.inc on line 857.
warning: implode() [function.implode]: Invalid arguments passed in sites/all/modules/views/handlers/views_handler_argument_string.inc on line 276.

Anonymous’s picture

subscribe

Renee S’s picture

Ok, I'm getting it on a calendar page with a custom path and argument as well (ie: booking/room/% in a Calendar Page view - so, say, booking/room/CMP230/2011-01).

heyyo’s picture

My bug comes from misconfiguration of panel argument sended to views for argument: "Nodequeue: Subqueue reference"
I didn't find yet how to set up argument for this kind of views. It seems that "Nodequeue: Subqueue reference" doesn't work correctly with term id argument.

On my panel page /taxonomy/term/% i would like to display a list of nodes according to a taxonomy queue.

It's alreading working but with this error...

Any suggestion ? or any tutorial ?

thomas73’s picture

I have the same error.

gateway69’s picture

yea im getting the same, i fear its the dreaded php 5.3 string/array issue that seems to plague most of drupal core .. here is a snippet and I think u can easily set up the following

php 5.3
drupal 6.19/20
advance profile kit
panels 3

It seems to be something in the panels, a view or some sorts that gets an array when exiting a string for php 5.3

I would bet most of you seeing this have php 5.3.. which is the default install for any ubuntu server..

Lots of info here.. http://drupal.org/node/829250

gateway69’s picture

adding in this code around line 856 (drupal 6.20)

    if (is_array($text)) {  //add
      dsm($text);         //this
    }                   //lines

I get this data back...

http://grab.by/84eW

it seems that the user name is an array, aka in my situation i see admin as the array thats going though bootstrap.

merlinofchaos’s picture

Can you repeat your experiment and add a vsm_trace() along with your dsm?

gateway69’s picture

hmm not enough room for a screen shot but here is cut and paste


#

    *
      ... (Array, 1 element)
          o
            0 (String, 5 characters ) admin
    *
      Krumo version 0.2a
      | http://krumo.sourceforge.net
      Called from /var/www/iphone1/includes/bootstrap.inc, line 858  

#

views_handler_argument_string.inc: check_plain line 284
views_handler_argument_string.inc: views_handler_argument_string->title_query line 276
views_handler_argument.inc: views_handler_argument_string->title line 700
view.inc: views_handler_argument->get_title line 484
view.inc: view->_build_arguments line 639
view.inc: view->build line 732
view.inc: view->execute line 790
views_plugin_display.inc: view->render line 2220
view.inc: views_plugin_display->preview line 943
views.module: view->preview line 1301
facebook_status.module: views_embed_view line 610
theme.inc: call_user_func_array line 656
facebook_status_stream.inc: theme line 34
content.inc: facebook_status_facebook_status_stream_content_type_render line 283
panels_renderer_standard.class.php: ctools_content_render line 540
panels_renderer_standard.class.php: panels_renderer_standard->render_pane_content line 481
panels_renderer_standard.class.php: panels_renderer_standard->render_pane line 462
panels_renderer_standard.class.php: panels_renderer_standard->render_panes line 376
panels_renderer_standard.class.php: panels_renderer_standard->render_layout line 347
panels.module: panels_renderer_standard->render line 698
panels.module: panels_display->render line 1023
panel_context.inc: panels_render_display line 290
context-task-handler.inc: panels_panel_context_render line 46
user_view.inc: ctools_context_handler_render line 77
menu.inc: call_user_func_array line 348
index.php: menu_execute_active_handler line 18

#

    *
      ... (Array, 1 element)
          o
            0 (String, 5 characters ) admin
    *
      Krumo version 0.2a
      | http://krumo.sourceforge.net
      Called from /var/www/iphone1/includes/bootstrap.inc, line 858  

#

views_handler_argument_string.inc: check_plain line 284
views_handler_argument_string.inc: views_handler_argument_string->title_query line 276
views_handler_argument.inc: views_handler_argument_string->title line 700
view.inc: views_handler_argument->get_title line 484
view.inc: view->_build_arguments line 639
view.inc: view->build line 732
view.inc: view->execute line 790
views_plugin_display.inc: view->render line 2220
view.inc: views_plugin_display->preview line 943
views.module: view->preview line 1301
facebook_status.module: views_embed_view line 610
theme.inc: call_user_func_array line 656
facebook_status.module: theme line 374
user.module: facebook_status_user line 22
user_view.inc: user_module_invoke line 85
menu.inc: call_user_func_array line 348
index.php: menu_execute_active_handler line 18
gateway69’s picture

also a updated screen shot with one view on the page.. this is fb style status updates.. only one post.. it barfs with the user name for some reason..

http://grab.by/84lI

dawehner’s picture

Status: Active » Needs review
StatusFileSize
new527 bytes

This patches fixes the issue for me.

Since the break_argument patch $this->value is always an array, so check_plain doesn't work.

heyyo’s picture

#20 works for me, really happy to not see this bug anymore in my dblog :-)

gateway69’s picture

#20 also works, and confirmed to remove my issues!

RavenHursT’s picture

I tried placing this patch into the root dir of the views module... then I tried applying it w/ tortoiseSVN.. no dice.. am I doing something wrong?? I went ahead and just changed the line by hand.. and it's working.. but would love some help as to why the patch isn't applying..

bojanz’s picture

Status: Needs review » Reviewed & tested by the community

Per #20, #21, #22.

AlexisWilke’s picture

RTBC here too 8-)

zuzu83’s picture

#20 works for me :-)

yngens’s picture

Status: Reviewed & tested by the community » Active

Views from 2011-Jan-01 still gives the error on /glossary

patching gives:
can't find file to patch at input line 5

yngens’s picture

Status: Active » Reviewed & tested by the community

Sorry, I just needed to show correct path:

Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git handlers/views_handler_argument_string.inc handlers/views_handler_argument_string.inc
|index 2753d95..bf3d47a 100644
|--- handlers/views_handler_argument_string.inc
|+++ handlers/views_handler_argument_string.inc
--------------------------
File to patch: handlers/views_handler_argument_string.inc  
patching file handlers/views_handler_argument_string.inc
root@host:/usr/drupal/sites/all/modules/views#

Anyway, the patch was not committed to the version from Jan-01. Changing status back to RTBC.

achton’s picture

#20 worksformetoo.

ikeigenwijs’s picture

subscribe

merlinofchaos’s picture

Version: 6.x-3.x-dev » 7.x-3.x-dev
Assigned: Unassigned » dawehner
Status: Reviewed & tested by the community » Patch (to be ported)

Committed. Doesn't apply to D7, tho it seems like it should be needed.

RavenHursT’s picture

Uh yes.. let's PLEASE make sure this is in 7.x

dawehner’s picture

Well just this bugfix does nothing without porting the original patch :) #783514: implement a break_strings method and use it in string argument handler

Bensbury’s picture

#20 works for me.

ikeigenwijs’s picture

I have this problem in drupal 6.20

dawehner’s picture

Status: Patch (to be ported) » Fixed

Applied patch.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Steel Rat’s picture

I suddenly started getting a similar error, though it was due to exhausted memory (which is set to over 40meg). Here's the error:

Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 3690208 bytes) in /home/rpgmap/public_html/includes/bootstrap.inc on line 857

This just started happening within the last few days, no new modules or updates added. Happens with Admin or authenticated user trying to create any content (blog, page, etc.)

AlexisWilke’s picture

Steel Rat,

Do you have Boost installed? Because at the time you hit Save, Boost will go through all your views and check what content to "un-cache".

Thank you.
Alexis Wilke

bradspry’s picture

Version: 7.x-3.x-dev » 6.x-2.12

The following embedded view is causing the error for me.

example url: http://hostname.domain.com/directory/employee/3

$path =  $_GET['q'];
$alias = drupal_get_path_alias($path);
$parts = explode('/', $alias);
$term = $parts[2];
$viewName = 'employee_directory';
$display_id = 'default';
print views_embed_view($viewName, $display_id, array($term));
dawehner’s picture

It should be

$path =  $_GET['q'];
$alias = drupal_get_path_alias($path);
$parts = explode('/', $alias);
$term = $parts[2];
$viewName = 'employee_directory';
$display_id = 'default';
print views_embed_view($viewName, $display_id, $term);

In general i didn't wrote that this code is a good one.

bradspry’s picture

Thank you so much @dereine :-)

STINGER_LP’s picture

Version: 6.x-2.12 » 6.x-3.0-alpha4
Status: Closed (fixed) » Active

Having this errors on user's profile panel editing page:

warning: htmlspecialchars() expects parameter 1 to be string, array given in .../includes/bootstrap.inc on line 856.
warning: htmlspecialchars() expects parameter 1 to be string, array given in .../includes/bootstrap.inc on line 856.
technikh’s picture

Same issue here. I see the errors on user registration.

bsandor’s picture

I got the same error. My system:
D6.22
Views 6.x-2.16
Rules 6.x-1.4
OG 6.x-2.1
Mime Mail 6.x-1.0

I am about writing my own module that is sending Mime Mails to OG Group Members using Rules API, OG, Mime Mail, No Views.

Everything was OK until in my own module started generation an error giving a string instead of an array. This error message was belonging to my module.

Since then I get this 'line 857 in bootstrap.inc' error even after deleting my module's files completely from my HDD.

I am going to delete my project so I won't be able to give more info.

mustanggb’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)