Part of #1989974: [meta] Clean up/improve consistency of Edit:

  • Rename EditorDecorationView to EditedElementDecorationView.

Rationale:

  • Back when Edit.module used Create.js, this was a decorator for "editors", but now it is effectively a decorator on the underlying element that is being edited.
  • This is not an API change.
CommentFileSizeAuthor
#9 2133889-9.patch3.49 KBWim Leers
#1 2133889-1.patch3.55 KBWim Leers
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Wim Leers’s picture

Status: Active » Needs review
FileSize
3.55 KB

After manual testing, everything continues to work fine.

Status: Needs review » Needs work

The last submitted patch, 1: 2133889-1.patch, failed testing.

Wim Leers’s picture

Status: Needs work » Postponed
jessebeach’s picture

Status: Postponed » Needs review

1: 2133889-1.patch queued for re-testing.

jessebeach’s picture

Introducing "Element" creates a dichotomy with "Field". Are these two things really different here? Could we call it EditedFieldDecorationView?

Wim Leers’s picture

#5: IIRC, the reasoning behind "EditedElement" rather than "EditedField" is because in the case of a plain text field, the decorated element is not the field, it's a specific item of the field.

A field is always rendered like this:

<div class="field-wrapper">
  <div class="field-item">
    VALUE
  </div>
</div>

There may be many .field-items. Usually, the edited element is the .field-wrapper (i.e. "the field"). But in the case of in-place editing a single-valued textual field (whether plain or rich text), the edited element is .field-item (i.e. "a field item").

However, I see your point. Maybe it's better to persist the frequently occurring analogy of "if the logic exists for the Entity, it also exists for the Field" in Edit, in which case FieldDecorationView would actually be the most fitting name. Especially because it would be the perfect analogy for #2134929: Clean up Edit: rename EntityView to EntityDecorationView.

Wim Leers’s picture

jessebeach’s picture

FieldDecorationView is cool with me!

Wim Leers’s picture

Title: Clean up Edit: rename EditorDecorationView to EditedElementDecorationView » Clean up Edit: rename EditorDecorationView to FieldDecorationView
FileSize
3.49 KB

Okay, done :)

jessebeach’s picture

Status: Needs review » Reviewed & tested by the community

Verified the object name change and manually regression tested. Looks good.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 8.x. Thanks.

Wim Leers’s picture

Issue tags: -sprint
Wim Leers’s picture

Now also backported to the Drupal 7 contrib module: http://drupalcode.org/project/edit.git/commit/8e34208.

nod_’s picture

Issue tags: +JavaScript

Status: Fixed » Closed (fixed)

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