Dear maintainers, I have this issue running Drupal 7.7 (latest) locally with Views Slideshow. The same issue with Drupal 7.0.

In order to create a simple news scroll, I created a view showing a block showing the last 5 teasers of a content type "news": I used the plugin of type slideshow (see the exported view).
The block looks fine, and the news are scrolling OK, but if you click on the title of the teaser or on the "read more" link to access the full news, then you got the error with the following stack:

( ! ) Fatal error: [] operator not supported for strings in D:\temp\wamp\www\example.com\includes\common.inc on line 2319
Call Stack
# Time Memory Function Location
1 0.0035 368704 {main}( ) ..\index.php:0
2 0.2582 23566920 menu_execute_active_handler( ) ..\index.php:21
3 0.2663 23610008 drupal_deliver_page( ) ..\menu.inc:518
4 0.2663 23610608 drupal_deliver_html_page( ) ..\common.inc:2437
5 0.2664 23611008 drupal_render_page( ) ..\common.inc:2542
6 0.2677 23672464 block_page_build( ) ..\common.inc:5490
7 0.2761 23730280 block_get_blocks_by_region( ) ..\block.module:268
8 0.2761 23730400 block_list( ) ..\block.module:315
9 0.2761 23730400 _block_render_blocks( ) ..\block.module:658
10 0.2775 23735104 module_invoke( ) ..\block.module:828
11 0.2775 23735536 call_user_func_array ( ) ..\module.inc:795
12 0.2775 23735720 views_block_view( ) ..\module.inc:0
13 0.3780 28397608 view->execute_display( ) ..\views.module:573
14 0.3926 29406480 views_plugin_display_block->execute( ) ..\view.inc:936
15 0.3926 29406512 view->render( ) ..\views_plugin_display_block.inc:48
16 0.4289 30526216 views_plugin_display->render( ) ..\view.inc:873
17 0.4323 30826360 theme( ) ..\views_plugin_display.inc:2242
18 0.4356 31202856 template_preprocess_views_view( ) ..\theme.inc:858
19 0.4356 31202856 views_plugin_style->render( ) ..\theme.inc:45
20 0.4357 31203544 views_plugin_row->render( ) ..\views_plugin_style.inc:233
21 0.4359 31204624 theme( ) ..\views_plugin_row.inc:140
22 0.4361 31206936 template_preprocess_views_view_row_node( ) ..\theme.inc:858
23 0.4373 31214976 drupal_render( ) ..\node.views.inc:685
24 0.4374 31216552 theme( ) ..\common.inc:5627
25 0.4390 31249384 theme_render_template( ) ..\theme.inc:937
26 0.4396 31320608 include( 'D:\temp\wamp\www\example.com\themes\marinelli\templates\node--teaser.tpl.php' ) ..\theme.inc:1247
27 0.4402 31324624 l( ) ..\node--teaser.tpl.php:41

*****************************************************************************

This is the export of the view

$view = new view;
$view->name = 'news_scroll_1';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'node';
$view->human_name = 'news scroll 1';
$view->core = 7;
$view->api_version = '3.0-alpha1';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'news scroll 1';
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'full';
$handler->display->display_options['pager']['options']['items_per_page'] = '5';
$handler->display->display_options['style_plugin'] = 'slideshow';
$handler->display->display_options['row_plugin'] = 'node';
/* Field: Content: Title */
$handler->display->display_options['fields']['title']['id'] = 'title';
$handler->display->display_options['fields']['title']['table'] = 'node';
$handler->display->display_options['fields']['title']['field'] = 'title';
$handler->display->display_options['fields']['title']['label'] = '';
$handler->display->display_options['fields']['title']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['title']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['title']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['title']['alter']['trim'] = 0;
$handler->display->display_options['fields']['title']['alter']['word_boundary'] = 0;
$handler->display->display_options['fields']['title']['alter']['ellipsis'] = 0;
$handler->display->display_options['fields']['title']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['title']['alter']['html'] = 0;
$handler->display->display_options['fields']['title']['hide_empty'] = 0;
$handler->display->display_options['fields']['title']['empty_zero'] = 0;
$handler->display->display_options['fields']['title']['link_to_node'] = 1;
/* Sort criterion: Content: Post date */
$handler->display->display_options['sorts']['created']['id'] = 'created';
$handler->display->display_options['sorts']['created']['table'] = 'node';
$handler->display->display_options['sorts']['created']['field'] = 'created';
$handler->display->display_options['sorts']['created']['order'] = 'DESC';
/* Filter criterion: Content: Published */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'node';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = 1;
$handler->display->display_options['filters']['status']['group'] = 0;
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
/* Filter criterion: Content: Type */
$handler->display->display_options['filters']['type']['id'] = 'type';
$handler->display->display_options['filters']['type']['table'] = 'node';
$handler->display->display_options['filters']['type']['field'] = 'type';
$handler->display->display_options['filters']['type']['value'] = array(
'news' => 'news',
);

/* Display: Page */
$handler = $view->new_display('page', 'Page', 'page');
$handler->display->display_options['path'] = 'news-scroll-1';

/* Display: Block */
$handler = $view->new_display('block', 'Block', 'block');
$translatables['news_scroll_1'] = array(
t('Master'),
t('news scroll 1'),
t('more'),
t('Apply'),
t('Reset'),
t('Sort by'),
t('Asc'),
t('Desc'),
t('Items per page'),
t('- All -'),
t('Offset'),
t('Page'),
t('Block'),
);

CommentFileSizeAuthor
#16 1237020-16.patch745 bytesgaurav.kapoor
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kibo’s picture

I had the same problem and I changed the critical line 2319 from this:
$options['attributes']['class'][] = 'active';
to this:
$options['attributes']['class'] = 'active';
and it running. but its only hotfix...

tilla23’s picture

I use this, because original class remains (tagedelic module generated this error too):

if(isset($options['attributes']['class'])) $options['attributes']['class'] .= ' active';
else $options['attributes']['class'] = 'active';

Solv’s picture

I have this problem. Thanks kibo for hotfix

ngstigator’s picture

+1

danieljulia’s picture

I had the same problem.
Hotfix working for me too, great!

iamacyborg’s picture

Same problem here. The fix mentioned worked me as well.

redndahead’s picture

Status: Active » Postponed (maintainer needs more info)

This seems like it would be a core issue or a views issue. Do you get the same error if you use unformatted instead of slideshow?

ckng’s picture

Project: Views Slideshow » Marinelli
Version: 7.x-3.x-dev » 7.x-3.0-beta9
Status: Postponed (maintainer needs more info) » Needs review

Don't hack core. =)

The culprit is marinelli/templates/node--teaser.tpl.php as shown in the stack.

The class attribute passed to l() is not an array.
Change this (Line 41)

array('attributes' => array('class' => t('node-readmore-link'))));

to

array('attributes' => array('class' => array('node-readmore-link'))));
chinmay.sahoo’s picture

+1

Holygoe’s picture

Hotfix working for me too, thx. I use BlogBuzz 2 theme. Is it can be source of that error?

charlie charles’s picture

I got the same error message using omega theme. the hotfix worked or me too

phponwebsites’s picture

I have also same problem. But the hotfox is not a good solution. We need to find where the real problem is raise?

rohithpv23’s picture

The class attribute must be an array. Here is the documentation

epavlov’s picture

After minor update to 7.36 I got this issue on all views pages. Fix in common.inc file still do the magic, but I wonder where it is coming from.

gaurav.kapoor’s picture

FileSize
745 bytes
BhumikaVarshney’s picture

Status: Needs review » Reviewed & tested by the community

After applying this patch, if you click on the title of the teaser or on the "read more" link to access the full news, then no error stack is there.

  • gaurav.kapoor committed 4ef5cf0 on 7.x-4.x
    Issue #1237020 by gaurav.kapoor: Fatal error: [] operator not supported...
gaurav.kapoor’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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