Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 293569

Apply formatters and widgets to Node base fields

$
0
0

Updated: Comment #0

Problem/Motivation

The following base fields of the Node entity type are still handled through custom code in entity forms and entity views (basically everything except the title):

  1. author (uid)
  2. publication date (created)
  3. language (langcode)
  4. published (status)
  5. stick at top of lists (sticky)
  6. revision log message (log)

Proposed resolution

Move to widgets and formatters, including many new ones:

  1. author (uid): AuthorFormatter (generic, for EntityOwnerInterface entities) + RouteBasedAutocompleteWidget (generic, to not depend on entity_reference.module) + AuthorAutocompleteWidget (extends the previous one with author-specific UX)
  2. publication date (created): TimestampFormatter (generic) + TimestampWidget (generic)
  3. published (status) & stick at top of lists (sticky): BooleanWidget (generic)
  4. revision log message (log)

Only the language (langcode) field (and its corresponding LanguageWidget) will not be done in this issue, for that we have #2230637: Create a Language widget.

And for datetime.module's "enhancing override" to switch the default text field widget to a fancy datetime widget now has a DateTimeTimestampWidget that can be used for any TimestampItem— this also cleans up datetime.module.

Also removes node_field_extra_fields()! :)

And last but not least, this finally makes the node author and date in-place editable! Or well… almost. In-place editing the author fails, for reasons that swentel and I don't yet understand. Hopefully yched, fago or amateescu can shed some light on that.

Remaining tasks

  1. Fix test failures.

User interface changes

None.

API changes

None. The base fields above are rendered using widgets and formatters, and are no longer exposed as an "extra field".


Viewing all articles
Browse latest Browse all 293569

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>