warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/cyberfan/htdocs/includes/bootstrap.inc on line 857.
warning: htmlspecialchars() expects parameter 1 to be string, array /bootstrap.inc on line 857.

This happens when loading feed list.

Comments

alex_b’s picture

Status: Active » Postponed (maintainer needs more info)

Needs more info:

What exactly is the 'feed list', what importer configuration are you using?

AntiNSA’s picture

This is an awkward error that disappeared after deleting and replacing my entire previous feeds directory.

socialnicheguru’s picture

Status: Postponed (maintainer needs more info) » Active

I just enabled devel backtrace

It looks like this sentence is causing it "This content type is being used for automatically aggregated content from feeds".

They are found:
feeds_defaults/feeds_defaults.module:30: 'description' => t('This content type is being used for automatically aggregated content from feeds.'),
feeds_news/feeds_news.features.inc:32: 'description' => t('This content type is being used for automatically aggregated content from feeds.'),

copy of backtrace:

... (Array, 13 elements)
backtrace_error_handler (Array, 2 elements)
function (String, 23 characters ) backtrace_error_handler | (Callback) backtrace_error_handler();
args (Array, 5 elements)
0 (Integer) 2
1 (String, 64 characters ) htmlspecialchars() expects parameter 1 to be st...
htmlspecialchars() expects parameter 1 to be string, array given

2 (String, 69 characters ) ...
3 (Integer) 857
4 (Array, 2 elements)

htmlspecialchars (Array, 4 elements)
file (String, 69 characters ) ...
line (Integer) 857
function (String, 16 characters ) htmlspecialchars | (Callback) htmlspecialchars();
args (Array, 3 elements)
0 (Array, 2 elements)
0 (String, 80 characters ) This content type is being used for automatical...
This content type is being used for automatically aggregated content from feeds.

1 (String, 80 characters ) This content type is being used for automatical...
This content type is being used for automatically aggregated content from feeds.

1 (Integer) 3
2 (String, 5 characters ) UTF-8

check_plain (Array, 4 elements)
file (String, 66 characters ) ...
line (Integer) 1546
function (String, 11 characters ) check_plain | (Callback) check_plain();
args (Array, 1 element)
0 (Array, 2 elements)
0 (String, 80 characters ) This content type is being used for automatical...
1 (String, 80 characters ) This content type is being used for automatical...

drupal_attributes (Array, 4 elements)
file (String, 66 characters ) ...
line (Integer) 1611
function (String, 17 characters ) drupal_attributes | (Callback) drupal_attributes();
args (Array, 1 element)
0 (Array, 2 elements)
title (Array, 2 elements)
class (String, 47 characters ) path-node-add-feed-item path-node-add path-node

l (Array, 4 elements)
file (String, 92 characters ) ...
profiles/openatrium/themes/rubik/template.php

line (Integer) 467
function (String, 1 characters ) l | (Callback) l();
args (Array, 3 elements)
0 (String, 74 characters ) Array ArrayArray

1 (String, 18 characters ) node/add/feed-item
2 (Array, 2 elements)
attributes (Array, 2 elements)
title (Array, 2 elements)
class (String, 47 characters ) path-node-add-feed-item path-node-add path-node

html (Boolean) TRUE

brycesenz’s picture

subscribe.

danny_joris’s picture

I have the same issue in combination with #908458: warning: mysql_real_escape_string() .

qmhao99’s picture

I am having the same issue. It happens whenever I update a node, regardless what is being updated. If I delete and recreate the same node, error won't happen. However it happens again if I update the node. It appears that something ill functioned validation is only performed at update time. Maybe some one experienced with Drupal can tell why this happens only after update?

qmhao99’s picture

I added the following line at Line# 845 of includes/bootstrap.inc and it seems to be make the warning message go away.
if (is_array($text)) $text = $text[0];

Not sure if it is a real fix but at least it is a workaround for me.

thelingokid’s picture

Same issue. qmhao99 Thanks for the temporary fix.

frob’s picture

subscribing.

This happened to me sometimes when doing form alters.

frob’s picture

The only way that I can recreate this in a controlled environment is with this code

$null = new stdClass();
check_plain($null);

and

$null = array();
check_plain($null);

I have tried send through every other data type. The thing is there is no where in my code that I send an array through check_plain, t() or any of those.

I do not think that this is a feeds issue, I think it is a core issue.

guusbosman’s picture

I can reproduce this issue as follows.

I temporary altered bootstrap.inc as follows:

if (is_array($text)) {
return "Deeeebbbuuuuuggg" . $text[0];
}

Then if I go to my search page (/search/node/texttolookfor) and I click on "Advanced Search", in the list with "Only of the type(s): " the following two entries appear:

DeeeebbbuuuuugggFeed
DeeeebbbuuuuugggFeed Item

(Entries from other modules do not have Deeeebbbuuuuuggg in front of them).

I then changed feeds_defaults/feeds_defaults.module:

$items['feed_item'] = array(
'name' => t('Feed item Debug Debug'),
'module' => 'node',
...

That confirmed that 'name' => t('Feed item Debug Debug') is returning an array instead of a String, somehow.

Hope this helps.

limex67’s picture

subscribe. Issues started with update to 6.x-1.0-beta10

David Goode’s picture

Version: 6.x-1.0-beta5 » 6.x-1.0-beta10
Status: Active » Postponed (maintainer needs more info)

Can anyone confirm this still happens in beta10? If so, try to find out where? The files in question don't even exist anymore (they've been moved to features). Thanks.

Crom’s picture

Hi David,

I can confirm that at 6.x-1.0-rc4 I have found this error. I am attempting to upload a CSV file containing letters like "ü".

Let me know if I can help with further testing.

Cheers,
Crom

skizzo’s picture

I am running 6.x-1.0-beta10 and see this error frequently but inconsistently. Maybe it has nothing to do with feeds, but it's not a core issue either. See http://drupal.org/node/829250#comment-3444480 . Workaround #7 by qmhao99 works for me, hiding the problem and keeping the watchdog clean

TimeBandit’s picture

Thank you for this module.
I'm running 6.x-1.0-beta10 and see this error with special characters. I setup a PHP script to cleanse the files first before import, swapping entity symbols for entity names or numbers. So for example I swapped é with é. If I recall I think it also had to do with the type of field I was importing into, whether it was set to plain text or rich text.

I believe the file I was working with was an Excel CSV export, and so the MIME type was application/octet-stream instead of text/csv. The characters were showing "correctly" in some of my text editors and not others (I'm on a Mac). However when I tried to import without cleansing first I'd get the special characters bootstrap error.

twistor’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Closing very old issues. Feel free to re-open.

spade’s picture

This workaround worked for me:
https://www.drupal.org/node/908452#comment-3675868

It happend after building a view with a date filter.

Probably not much more I can say ...