Problem/Motivation

See #2992410-27: Provide placeholders for empty blocks (for example, an empty Views listing)

Proposed resolution

Rename PlaceholderInterface to PreviewFallbackInterface
Rename getPlaceholderString() to getPreviewFallbackString()

Remaining tasks

Do it

User interface changes

N/A

API changes

Yes

Data model changes

N/A

CommentFileSizeAuthor
#2 3013187-placeholder-2.patch6.51 KBtim.plunkett

Comments

tim.plunkett created an issue. See original summary.

tim.plunkett’s picture

Status: Active » Needs review
StatusFileSize
new6.51 KB
wim leers’s picture

Status: Needs review » Reviewed & tested by the community

Thanks! 👍

larowlan’s picture

Status: Reviewed & tested by the community » Needs work
  1. +++ b/core/lib/Drupal/Core/Block/BlockBase.php
    @@ -256,7 +256,7 @@ public function getMachineNameSuggestion() {
    -  public function getPlaceholderString() {
    +  public function getPreviewFallbackString() {
    

    This is a BC break, we need to retain the old method and defer to the new one, with a trigger_error (and a legacy test)

  2. +++ b/core/lib/Drupal/Core/Block/BlockBase.php
    diff --git a/core/lib/Drupal/Core/Render/PlaceholderInterface.php b/core/lib/Drupal/Core/Render/PlaceholderInterface.php
    deleted file mode 100644
    
    +++ /dev/null
    @@ -1,21 +0,0 @@
    -interface PlaceholderInterface {
    

    We can't remove an interface - its a BC break. Can you reinstate it and deprecate it with a legacy test and a trigger_error

tim.plunkett’s picture

Afaik this was never in a tagged release, doesn't that exempt it?

tim.plunkett’s picture

Also it could be reverted and reworked if that helps, process-wise

larowlan’s picture

Status: Needs work » Reviewed & tested by the community

You're correct, this was only backported to 8.6 6 days ago.

  • larowlan committed d1c7fa1 on 8.7.x
    Issue #3013187 by tim.plunkett: Rename PlaceholderInterface to...

  • larowlan committed 8e63304 on 8.6.x
    Issue #3013187 by tim.plunkett: Rename PlaceholderInterface to...
larowlan’s picture

Version: 8.7.x-dev » 8.6.x-dev
Status: Reviewed & tested by the community » Fixed

Committed d1c7fa1 and pushed to 8.7.x. Thanks!

Cherry-picked to 8.6.x as 8e63304170

wim leers’s picture

🎉

Status: Fixed » Closed (fixed)

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