This error message always occurred when a missing scald atom object sid was loaded from the text. The code is trying to check the existence of atom after scald_atom_load_multiple()

 function mee_filter_process($text) {
  // Work on the string as a DOM structure.
  $dom = filter_dom_load($text);

  // Collect the DOM nodes and the corresponding embed data.
  if ($embed_info = _mee_extract_widget_embed_info($dom)) {
    // Collect the corresponding atom ids and load them upfront to benefit from
    // multiple-loading.
    $sids = array();
    foreach ($embed_info as $info) {
      $sids[] = $info['sid'];
    }
    $atoms = scald_atom_load_multiple(array_unique($sids));

    // Replace each DOM node with the themed embed.
    foreach ($embed_info as $info) {
      $html = '';
      if ($atoms[$info['sid']]) {
        $html = theme('mee_widget_embed', array(
          'atom' => $atoms[$info['sid']],
          'context' => $info['context'],
          'options' => $info['options'],
          'align' => $info['align'],
          'caption' => $info['caption'],
          // Only store a SAS code in the filter cache, that will get replaced
          // with the HTML for the rendered atom in
          // mee_field_attach_view_alter().
          'content' => '[scald=' . $info['sid'] . ':' . $info['context'] . ($info['options'] ? ' ' . $info['options'] : '') . ']',
        ));
      }
CommentFileSizeAuthor
#2 undefined_offset_error-2840060-2.patch556 bytesjimmyko
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jimmyko created an issue. See original summary.

jimmyko’s picture

I have created a tiny patch for this issue.

  • nagy.balint committed 08a776c on 7.x-1.x authored by jimmyko
    Issue #2840060 by jimmyko: Undefined offset error occurred within...
nagy.balint’s picture

Status: Active » Fixed

Thanks!

Status: Fixed » Closed (fixed)

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