After updating to 7.28 and (+ media_ckeditor 7.x-2.1 module), I get the following watchdog anytime a user clicks to create a new forum topic:

PHP Notice: Undefined index: #value in media_wysiwyg_pre_render_text_format() (line 124 of media_wysiwyg.module).

The media_wysiwyg_pre_render_text_format() function is looking for $element['summary']['#value'] in order to build a map of media tags in the element for javascript settings so that the media tags can be transformed when the editor is being displayed. However in this case, $element['summary'] has no such ['#value'] of course since it's a new node.

I'm trying to track down why this module is even involved on a new node from users who do not even have the 'use media wysiwyg' permission in the first place.

Suggestion:

<?php
  foreach (array('value', 'summary') as $column) {
    if (isset($element[$column])) { // CHANGE THIS TO if (!empty($element[$column]['#value'])) {
      $tagmap += _media_wysiwyg_generate_tagMap($element[$column]['#value']);
    }
  }
?>
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

blasthaus created an issue. See original summary.

  • joseph.olstad authored f0b1473 on 7.x-2.x
    Issue #2889284 by joseph.olstad, blasthaus: PHP Notice when new node has...

  • joseph.olstad authored f0b1473 on 7.x-3.x
    Issue #2889284 by joseph.olstad, blasthaus: PHP Notice when new node has...
joseph.olstad’s picture

Status: Needs review » Fixed

fixed in 7.x-2.x-dev and 7.x-3.x-dev

blasthaus’s picture

thanks for the fast commit!

Status: Fixed » Closed (fixed)

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