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.
Comment | File | Size | Author |
---|---|---|---|
#1 | 2179403-alter-bug.patch | 496 bytes | Crell |
Comments
Comment #1
Crell CreditAttribution: Crell commentedPatch for your convenience.
Comment #2
Wim LeersHAH! Great catch! Thanks!
http://drupalcode.org/project/edit.git/commit/4e68009