Views should respect the field formatter's isApplicable() method

Created on 9 August 2018, over 6 years ago
Updated 22 March 2023, over 1 year ago

Problem/Motivation

Core only example:

  1. Install a clean Umami D8 instance
  2. Go to the content view
  3. Edit the title field
  4. look at the available formatters
  5. see a bizar number of options

Contrib example using commerce:

  1. Create a view with commerce order items.
  2. Add a "Total price" field

.

The "Calculated" formatter is visible among the field settings, although it should not be there, due to Drupal\commerce_price\Plugin\Field\FieldFormatter\PriceCalculatedFormatter::isApplicable().

πŸ› Bug report
Status

Needs work

Version

10.1 ✨

Component
ViewsΒ  β†’

Last updated about 2 hours ago

Created by

πŸ‡ΈπŸ‡°Slovakia kaszarobert

Live updates comments and jobs are added and updated live.
  • Needs subsystem maintainer review

    It is used to alert the maintainer(s) of a particular core subsystem that an issue significantly impacts their subsystem, and their signoff is needed (see the governance policy draft for more information). Also, if you use this tag, make sure the issue component is set to the correct subsystem. If an issue significantly impacts more than one subsystem, use needs framework manager review instead.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Brought this up in #contribute with @lendude

  • πŸ‡·πŸ‡ΊRussia Chi

    That has already been indicated in #17 that isApplicable() is still used at run-time. What kind of BC issues could we face here?

  • πŸ‡¦πŸ‡ΊAustralia acbramley

    Yup as stated in #17, I don't think the BC issues are that bad as long as we set the default formatter when editing a field that was referencing a non-applicable formatter (or we have an upgrade path that does that for us but that seems like it would be fairly difficult to get right).

Production build 0.71.5 2024