Discussed with nod_, he agrees. This will significantly simplify long-term maintenance of the Drupal 7 Edit module, because it will very closely resemble the Drupal 8 equivalent, which is almost guaranteed to receive more attention.

This is part of #1947802: Clean up Edit's PHP to make it more maintainable: Drupal 8-style in-place editor definitions.

Comments

wim leers’s picture

Status: Active » Fixed
Issue tags: +Spark
  • Major: backported MetadataGenerator(Interface), EditorSelector(Interface) and EditEntityFieldAccessCheck(Interface). This has allowed a lot of code to be removed from pages.inc. The remaining code is now fully documented. It will also simplify adding test coverage, because it should be possible to mostly copy the tests from Drupal 8 (same logic, different syntax & function calls).
  • Major: part of the complexity in includes/pages.inc was the special handling for "special fields" (node title/author/date). At #1968524: Edit module maintainability: Rename _edit_is_special_field() to _edit_is_extra_field() this was renamed to "extra fields", for consistency with the rest of Drupal. Now, the big part: the introduction of a hook_edit_extra_fields_info() to allow us to cleanly specify "extra fields" for Edit, along with all necessary metadata to make them in-place editable. This effectively means that it makes it possible to make *anything* on an entity that is not part of Field API in-place editable. Hence, it closes #1895526: Add a way to make things that don't use Field API in-place editable.
    Currently only node.module is supported, see the new node.inc. Consequently, it made sense to move the special handling for node title/author/date in fape.inc out of there and into node.inc.
    This new hook/API is not yet documented, because I want to make sure first that it is sufficiently flexible and complete. See node.inc as the guiding example for now.
  • Minor: hook_edit_editor_metadata_alter() made little sense: parts of its $context were invalid, the $editor parameter was pointless because that information is already inside $metadata

http://drupalcode.org/project/edit.git/commit/8ec0760

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