Getting

Warning: Illegal offset type in _bootstrap_is_simple_string() (line 1224 of /home/solution/public_html/solutionsnetwork.ch/themes/bootstrap/includes/common.inc).

on the 4/9/2015 dev build.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

platinum1 created an issue. See original summary.

markhalliwell’s picture

Status: Active » Postponed (maintainer needs more info)
platinum1’s picture

The site is a Beta 14 build upgraded to Beta 15. The log shows the error when calling up basic pages and articles.

Additional info:

PHP 5.5.29
MySQL
LiteSpeed

Haza’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Needs review
FileSize
20.51 KB
587 bytes

I have the same issue.

I guess we have this error because we try to do some string work on an object, as you can see here :

$string is a FieldFilteredMarkup object.

A simple patch that for the $string variable to actually be a string is attached.

Haza’s picture

FileSize
1.33 KB

Just updating the docblock.

markhalliwell’s picture

Status: Needs review » Needs work
Issue tags: +Needs backport to D7

Instead of assuming that every string passed will be an FieldFilteredMarkup object, which is not the intent of the procedural function and thus changes the function signature, it should instead do a check inside the function at the very top. Something like:

// Check if string is an object.
$string_clone = is_object($string) ? $string->__toString() : $string;

Because objects are natively passed by reference, and to avoid replacing the entire object, the rest of the code following this line in the function should be changed to reference the new $string_clone variable (or whatever name you think is better).

Haza’s picture

Status: Needs work » Needs review
FileSize
1.54 KB

Thanks for the feedbacks. You're right, we should not assume that we'll always have a string here.

He is an updated patch.

  • Haza authored b762a1c on 8.x-3.x
    Issue #2565217 by Haza: Warning: Illegal offset type in...
neardark’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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