I was wondering if I could get some assistance to this bug I am having with ctools automodal. It seems to me having a path prefix of "eng" is completely breaking my site.

Below is the stack trace from my CI Travis Server:

[Mon Sep  3 23:44:17 2012] PHP Fatal error:  [] operator not supported for strings in /home/travis/builds/wet-boew/github_wet_distro/profiles/wetkit/modules/ctools_automodal/ctools_automodal.module on line 77
[Mon Sep  3 23:44:17 2012] PHP Stack trace:
[Mon Sep  3 23:44:17 2012] PHP   1. {main}() /home/travis/builds/wet-boew/github_wet_distro/index.php:0
[Mon Sep  3 23:44:17 2012] PHP   2. menu_execute_active_handler() /home/travis/builds/wet-boew/github_wet_distro/index.php:21
[Mon Sep  3 23:44:17 2012] PHP   3. drupal_deliver_page() /home/travis/builds/wet-boew/github_wet_distro/includes/menu.inc:531
[Mon Sep  3 23:44:17 2012] PHP   4. drupal_deliver_html_page() /home/travis/builds/wet-boew/github_wet_distro/includes/common.inc:2476
[Mon Sep  3 23:44:17 2012] PHP   5. drupal_render_page() /home/travis/builds/wet-boew/github_wet_distro/includes/common.inc:2588
[Mon Sep  3 23:44:17 2012] PHP   6. admin_menu_page_build() /home/travis/builds/wet-boew/github_wet_distro/includes/common.inc:5621
[Mon Sep  3 23:44:17 2012] PHP   7. admin_menu_output() /home/travis/builds/wet-boew/github_wet_distro/profiles/wetkit/modules/contrib/admin_menu/admin_menu.module:201
400[Mon Sep  3 23:44:17 2012] PHP   8. drupal_render() /home/travis/builds/wet-boew/github_wet_distro/profiles/wetkit/modules/contrib/admin_menu/admin_menu.module:500
[Mon Sep  3 23:44:17 2012] PHP   9. drupal_render() /home/travis/builds/wet-boew/github_wet_distro/includes/common.inc:5779
[Mon Sep  3 23:44:17 2012] PHP  10. drupal_pre_render_link() /home/travis/builds/wet-boew/github_wet_distro/includes/common.inc:5751
[Mon Sep  3 23:44:17 2012] PHP  11. l() /home/travis/builds/wet-boew/github_wet_distro/includes/common.inc:5477
[Mon Sep  3 23:44:17 2012] PHP  12. theme() /home/travis/builds/wet-boew/github_wet_distro/includes/common.inc:2394
[Mon Sep  3 23:44:17 2012] PHP  13. ctools_automodal_preprocess_link() /home/travis/builds/wet-boew/github_wet_distro/includes/theme.inc:1106
[Mon Sep  3 23:44:17 2012] 127.0.0.1:46881 [200]: /eng - [] operator not supported for strings in /home/travis/builds/wet-boew/github_wet_distro/profiles/wetkit/modules/ctools_automodal/ctools_automodal.module on line 77

Comments

sylus’s picture

Title:I18n Paths breaks CTools Automodal» Path Prefixes (i18n?) breaks CTools Automodal

Changing title

populist’s picture

It looks like the line that is causing trouble here is $variables['options']['attributes']['class'][] = 'ctools-use-modal' which I don't think is a problem with CTools Automodal. Might there be a module that sets $variables['options']['attributes']['class'] to a string?

sylus’s picture

StatusFileSize
new36.62 KB

Thanks for the pointer @populist, I set a breakpoint in ctools automodal where that assignment happens and it seems the only time it gets hit is by admin_menu.

I have attached a screenshot of what I think is the offending culprit in admin_menu_toolbar.module.

Dave Reid’s picture

Yep that code needs to be:

'attributes' => array('class' => array('shortcut-toggle')),
sylus’s picture

Status:Active» Closed (works as designed)

Thanks @Dave Reid and @populist I have committed a patch at: http://drupal.org/node/1772766

This does indeed fix the problem.

Marking this issue as works as designed but if I could get either of your comments for the fix over at the other issue that would be grand :)

sylus’s picture

StatusFileSize
new9.42 KB

Reopening to ask a question but feel free to close.

While the patch (from linked issue) does work I still have a problem in that when I select from admin_menu the default shortcut arrow, this will automatically fire up the ctools automodal dialog and cause an ajax error.

Should this issue be filed here or over still at admin_menu?

sylus’s picture

Status:Closed (works as designed)» Active

Setting to active for now.

adrupalfan’s picture

I had the same error message as above but the culprit was the colorbox module.

The fix is the same - I edited line 182 of the file "colorbox_handler_field_colorbox.inc" from:

'class' => 'colorbox-inline',

to:

'class' => array('colorbox-inline'),

which fixed the error.

SocialNicheGuru’s picture

#8 has been fixed in colorbox as of 11/7/2014 dev version.