I have a Bootstrap sub theme using CDN working. I have jQuery Update 1.7.1 working. All my nodes per content type have been loading fine. I've installed Media Gallery module (works with Media module). This module adds a content type called Gallery. When I publish a Gallery node only plain vanilla HTML shows up. The theme does not load on these gallery node pages. If I inspect via console I get this error:

[10:15:49.974] GET http://drupal7.localhost/content/test-bootstrap-gallery [HTTP/1.0 500 Internal Server Error 501ms]

Something in Bootstrap appears to be causing this. If I switch my theme back to Bartik or Seven, the Gallery nodes load fine.

Any suggestions?

-Trevor

CommentFileSizeAuthor
#1 screen-bootstrap.png139.44 KBambientdrup

Comments

ambientdrup’s picture

StatusFileSize
new139.44 KB

Attaching a screen shot.

ambientdrup’s picture

Figured this out. Looked at PHP error logs and this error rears its ugly head:

[05-Nov-2013 10:55:41 America/New_York] PHP Fatal error: [] operator not supported for strings in /Applications/MAMP/htdocs/repo/sites/all/themes/bootstrap/theme/menu/menu-local-action.func.php on line 27

So I comment out lines 27-29 in that file and now the Media Gallery loads. This is the function in question:

function bootstrap_menu_local_action($variables) {
  $link = $variables['element']['#link'];

  $options = isset($link['localized_options']) ? $link['localized_options'] : array();

  // If the title is not HTML, sanitize it.
  if (empty($options['html'])) {
    $link['title'] = check_plain($link['title']);
  }

  $icon = _bootstrap_iconize_button($link['title']);

  // Format the action link.
  $output = '<li>';
  if (isset($link['href'])) {
    // Turn link into a mini-button and colorize based on title.
    if ($class = _bootstrap_colorize_button($link['title'])) {
    //  $options['attributes']['class'][] = 'btn';
     // $options['attributes']['class'][] = 'btn-xs';
     // $options['attributes']['class'][] = $class;
    }
    // Force HTML so we can add the icon rendering element.
    $options['html'] = TRUE;
    $output .= l($icon . $link['title'], $link['href'], $options);
  }
  else {
    $output .= $icon . $link['title'];
  }
  $output .= "</li>\n";

  return $output;
}
vbreak’s picture

it's actually not a problem with Bootstrap, but how media gallery renders their theme variables.

Media Gallery has a string on their "class" instead of an array,

$variables['element']['#link']['localized_options']['attributes']['class'] = 'media-gallery-add launcher'

This breaks the l() function when bootstrap is rendering and adding classes to the links.

I'll update media gallery with this.

markhalliwell’s picture