Problem/Motivation

Child 3 of #3624396: Plan: Harden InstanceInterface, IslandInterface and DisplayBuildableInterface as public API before RC1, split in two: this one is the interfaces around the instance, child 3a the instance itself.

  • ProfileInterface::setIslandConfiguration() and PageLayoutInterface::setSources() return nothing, where a Drupal setter returns the object.
  • DisplayBuildableOverrideInterface::revert() does two jobs under one name: it empties the override field and saves the content entity at once, a permanent write, and it returns the sources of the default display. PublishableInterface::revert() on the instance has the same name and another meaning: it puts those sources in the draft, as an undoable step.
  • DisplayBuilderEntityDisplayInterface::isDisplayBuilderEnabled() declares no return type.
  • The cardinality docblocks say any number that is not strictly positive means unlimited. The code treats only a negative number as unlimited: a cardinality of 0 means always full.
  • PublishableInterface still speaks of saving where it means publishing.

Proposed resolution

  • setIslandConfiguration() and setSources() return static.
  • DisplayBuildableOverrideInterface::revert() splits in two: getDefaultSources(): array, which only reads, and deleteOverride(): void, which empties the field and saves the entity. revert() is removed, with no deprecation: the API freezes at RC1. Instance::revert() uses the two new methods.
  • isDisplayBuilderEnabled(): bool.
  • The cardinality docblocks say what the code does: DisplayBuildableInterface::CARDINALITY_UNLIMITED, a negative number, means unlimited.
  • PublishableInterface docblocks speak of publishing. HistoryInterface::setNewPresent() names its argument as Instance does.

Remaining tasks

None.

User interface changes

None.

API changes

  • ProfileInterface::setIslandConfiguration() and PageLayoutInterface::setSources() return static, were void.
  • New DisplayBuildableOverrideInterface::getDefaultSources() and deleteOverride(). revert() removed.
  • DisplayBuilderEntityDisplayInterface::isDisplayBuilderEnabled() returns bool.

Data model changes

None.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mogtofu33 created an issue. See original summary.

mogtofu33’s picture

Assigned: Unassigned » pdureau
Status: Active » Needs review
mogtofu33’s picture

Issue summary: View changes
pdureau’s picture

Assigned: pdureau » mogtofu33
Status: Needs review » Reviewed & tested by the community

The method names and docblocks make more sense 👍

mogtofu33’s picture

Issue summary: View changes
mogtofu33’s picture

Assigned: mogtofu33 » Unassigned
Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • mogtofu33 committed 99bd5b3b on 1.0.x
    task: #3627285 Profile, page layout, override and display interfaces:...