edit_field_formatter_info_alter() sets a default editor of "form" for all fields that do not yet have an editor defined. However, its check to see if one is already defined is wrong. It is checking for:

  foreach ($info as $key => $settings) {
    // Set in-place editor to 'form' if none is supplied.
    if (empty($settings['edit'])) {
      $info[$key]['settings']['edit'] = array('editor' => 'form');
    }
  }

It takes a keen eye to notice that the empty() check is wrong. It should be checking for $settings['settings']['edit']. (At least my eyes didn't catch that for quite a while of staring at it, wondering why my editor wasn't registering.) $settings['edit'] is a top-level key, not the settings sub-array.

Without that change, it is impossible for a formatter to define its own editor. I do not know if a similar issue is present in Drupal 8, as the formatter API is quite different.

CommentFileSizeAuthor
#1 2179403-alter-bug.patch496 bytesCrell
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Crell’s picture

Status: Active » Needs review
FileSize
496 bytes

Patch for your convenience.

Wim Leers’s picture

Version: 7.x-1.0-rc2 » 7.x-1.0
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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