I've created a block for a widget successfully, and it seems to work fine on its own. However, when I try to place that block in Panels I get a fatal error. Specifically, somewhere in the callstack theme_link() is getting called with the link that is the twitter block block (I can tell because it includes "Tweets by @twitterapi"), and an $options array of "Array". So somewhere somehow that array is getting used in a string context and cast to a string, which then breaks later on.

I was able to look at the call stack, and twitter block wasn't in it. Just lots of ctools. I don't know how to interpret that.

However, I then tried to reload the panel and, lo and behold, I'm getting a fatal error just trying to view the admin page. It dies completely with this fatal error:

Warning: strlen() expects parameter 1 to be string, array given in drupal_validate_utf8() (line 1590 of /stor/sandboxes/garfield/palantirnet/www/includes/bootstrap.inc).
Recoverable fatal error: Argument 2 passed to url() must be an array, string given, called in /stor/sandboxes/garfield/palantirnet/www/includes/theme.inc on line 1634 and defined in url() (line 2178 of /stor/sandboxes/garfield/palantirnet/www/includes/common.inc).

When I try to xdebug the first, again the twitter_block module is not in the call stack. It's somewhere in the depths of form/ctools stuff.

The code in twitter_block_block_view() looks fine to me visually, and the block works on its own, so I have no idea what's going on. It only seems to happen with this module, though.

Comments

Devin Carlson’s picture

I know that ctools only recently added support for blocks that return render arrays in #1925018: Adding a renderable-array block to a page gives errors in the admin UI with the commit http://drupalcode.org/project/ctools.git/commit/280ccd0.

If you use 280ccd0 or later (such as the latest -dev release) do you still get the error messages?

Crell’s picture

Status: Active » Fixed

Ah ha! Yep, upgraing to ctools -dev fixes it, and now the block shows up properly. Thanks!

Status: Fixed » Closed (fixed)

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