Problem/Motivation

WidgetBase passes itself along when invoking alters, allowing third party code to have access to their third party settings.

FormatterBase does not pass along the third party settings.

Proposed resolution

Add it to the pile of information passed along

Remaining tasks

N/A

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A

Comments

tim.plunkett created an issue. See original summary.

tim.plunkett’s picture

Status: Active » Needs review
StatusFileSize
new635 bytes

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

fenstrat’s picture

Status: Needs review » Reviewed & tested by the community

This makes sense.

xjm’s picture

Status: Reviewed & tested by the community » Needs work

Thanks @fenstrat!

I think this still needs test coverage, though.

bobbygryzynger’s picture

Issue tags: +Seattle2019
StatusFileSize
new2.63 KB
new3.26 KB
new2.49 KB

Adds test coverage.

bobbygryzynger’s picture

StatusFileSize
new3.25 KB
new2.63 KB
new454 bytes

Cleans up namespace copypasta.

bobbygryzynger’s picture

Status: Needs work » Needs review
johnwebdev’s picture

  1. +++ b/core/modules/field/tests/src/Kernel/FieldFormatterTest.php
    @@ -0,0 +1,99 @@
    +    $this->display = entity_get_display($entity_type, $bundle, 'default')
    

    entity_get_display is deprecated

bobbygryzynger’s picture

StatusFileSize
new2.77 KB
new3.39 KB
new1.02 KB

Replaces deprecated function call.

The last submitted patch, 10: 3029627-tps-10-test-only.patch, failed testing. View results

tim.plunkett’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs tests

Great work @bobbygryzynger, thanks!

xjm’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs change record

Great work on the test coverage!

Can we have a small CR to let extending forms/alters know this is now available? Thanks!

bobbygryzynger’s picture

I started a CR, but feel free to edit it. I wrote up the use-case for #3001313: Field blocks in the layout builder do not have view mode suggestions, but there are likely others that could be added.

bobbygryzynger’s picture

Status: Needs work » Needs review
tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs change record

Thanks @bobbygryzynger, that looks good! I tweaked it only slightly.

alexpott’s picture

Saving credit.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed a40136a and pushed to 8.8.x. Thanks!

I think there are good arguments that this should be backported to 8.7.x but I didn't do that because of the change record. If you want that to be done please re-open and and get release manager approval.

  • alexpott committed a40136a on 8.8.x
    Issue #3029627 by bobbygryzynger, tim.plunkett, xjm, johndevman:...

Status: Fixed » Closed (fixed)

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

anybody’s picture

Confirming that the patch applies to 8.7.3 where it helped to fix this issue: #3018654: Fences seems to be ignored by Layout Builder. So +1 for a backport to 8.7.x!

tim.plunkett’s picture

Version: 8.8.x-dev » 8.7.x-dev
Status: Closed (fixed) » Needs review
annisar’s picture

I confirm this patch works in 8.7x. Along with the patch 3001313-41 on https://www.drupal.org/project/drupal/issues/3001313 I am able to get the view mode suggestions.

anybody’s picture

Status: Needs review » Reviewed & tested by the community

We're also using this on 8.7.x successfully since a month. RTBC!

sam152’s picture

Following as a reminder to commit #3018654: Fences seems to be ignored by Layout Builder, if this gets backported.

larowlan’s picture

catch’s picture

Since this is blocking at least one more issue and the actual change is adding an additional array key I think it's fine to backport. Removing the tag.

  • larowlan committed 94f7984 on 8.7.x authored by alexpott
    Issue #3029627 by bobbygryzynger, tim.plunkett, xjm, johndevman:...
larowlan’s picture

Status: Reviewed & tested by the community » Fixed

c/p as 94f798456c to 8.7.x

Status: Fixed » Closed (fixed)

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