Views text area plugin does not declare a dependency on the text format it uses

Created on 21 October 2017, over 7 years ago
Updated 22 March 2025, 3 months ago

Problem/Motivation

This was uncovered by #2916898: Do not use basic_html text format for 'No log messages available.' message β†’ .

If you add a custom text with a text format to a views area (for example the empty text of many views), the view will not have a dependency on that text format, so that it will break when that text format is missing.

Proposed resolution

Add a dependency on the text format.

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component

views.module

Created by

πŸ‡©πŸ‡ͺGermany tstoeckler Essen, Germany

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

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

  • First commit to issue fork.
  • Merge request !11568Views text area format dependency β†’ (Open) created by dcam
  • Pipeline finished with Failed
    3 months ago
    Total: 153s
    #454678
  • Pipeline finished with Failed
    3 months ago
    Total: 411s
    #454681
  • Pipeline finished with Failed
    3 months ago
    Total: 686s
    #454688
  • Pipeline finished with Failed
    3 months ago
    Total: 588s
    #455117
  • Pipeline finished with Failed
    3 months ago
    Total: 269s
    #455134
  • Pipeline finished with Success
    3 months ago
    Total: 599s
    #455141
  • Pipeline finished with Failed
    3 months ago
    Total: 299s
    #455182
  • Pipeline finished with Failed
    3 months ago
    Total: 367s
    #455196
  • Pipeline finished with Failed
    3 months ago
    Total: 410s
    #455200
  • Pipeline finished with Canceled
    3 months ago
    Total: 192s
    #455738
  • Pipeline finished with Failed
    3 months ago
    Total: 672s
    #455741
  • Pipeline finished with Success
    3 months ago
    Total: 777s
    #455778
  • πŸ‡ΊπŸ‡ΈUnited States dcam

    I converted the patch in #2 to an MR. Then I fixed it because the return value from calculateDependencies() was incorrect. I added a test. At some point I realized that this needed an update path. So I wrote that and added a test for it too.

    I did not address the question in #13. I wasn't sure if it's necessary since plugins are @internal.

  • πŸ‡¬πŸ‡§United Kingdom MrDaleSmith

    Change applies cleanly, test pass and the correct dependency is now added to the exported config. I think this is OK to go.

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

    Probably need to update any default views that ship with core to include these. Example views.view.frontpage.yml in node, there may be others.

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

    Results of grep -rn "plugin_id: text$" --include views.view.*.yml:

    core/profiles/demo_umami/config/install/views.view.frontpage.yml:303:          plugin_id: text
    core/profiles/demo_umami/config/install/views.view.frontpage.yml:373:          plugin_id: text
    core/modules/content_translation/tests/modules/content_translation_test_views/test_views/views.view.test_entity_translations_link.yml:104:          plugin_id: text
    core/modules/views/tests/fixtures/update/views.view.test_filter_format_dependencies.yml:164:          plugin_id: text
    core/modules/views/tests/fixtures/update/views.view.test_entity_id_argument_update.yml:193:          plugin_id: text
    core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display_empty.yml:34:          plugin_id: text
    core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display_empty.yml:40:          plugin_id: text
    core/modules/views/tests/modules/views_test_config/test_views/views.view.test_entity_id_argument.yml:160:          plugin_id: text
    core/modules/views/tests/modules/views_test_config/test_views/views.view.test_tokens.yml:109:          plugin_id: text
    core/modules/views/tests/modules/views_test_config/test_views/views.view.test_tokens.yml:141:          plugin_id: text
    core/modules/views/tests/modules/views_test_config/test_views/views.view.test_destroy.yml:50:          plugin_id: text
    core/modules/views/tests/modules/views_test_config/test_views/views.view.test_destroy.yml:56:          plugin_id: text
    core/modules/views/tests/modules/views_test_config/test_views/views.view.test_destroy.yml:148:          plugin_id: text
    core/modules/views/tests/modules/views_test_config/test_views/views.view.test_destroy.yml:154:          plugin_id: text
    core/modules/views/tests/modules/views_test_config/test_views/views.view.test_destroy.yml:161:          plugin_id: text
    core/modules/views/tests/modules/views_test_config/test_views/views.view.test_destroy.yml:167:          plugin_id: text
    core/modules/views/tests/modules/views_test_config/test_views/views.view.test_token_view.yml:205:          plugin_id: text
    core/modules/views_ui/tests/modules/views_ui_test/config/install/views.view.sa_contrib_2013_035.yml:178:          plugin_id: text
    
  • Pipeline finished with Success
    3 months ago
    Total: 593s
    #459094
  • πŸ‡ΊπŸ‡ΈUnited States dcam

    Not all of those views specified the content of the text, so there was nothing to update in those cases. But I updated the ones that needed a dependency.

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

    Believe all views in core have been addressed, double checked that views.view.front in node actually didn't have any format use also (just to follow up on #22)

  • The Needs Review Queue Bot β†’ tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

    This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

    Consult the Drupal Contributor Guide β†’ to find step-by-step guides for working with issues.

  • Pipeline finished with Success
    about 2 months ago
    Total: 802s
    #493230
  • πŸ‡ΊπŸ‡ΈUnited States dcam

    Restoring RTBC status

  • Status changed to RTBC 2 days ago
  • πŸ‡ΊπŸ‡ΈUnited States xjm

    It even has an upgrade path test. Excellent.

    Saving issue credits.

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

    Regarding #15:

    Should we deprecate calling this without an EntityTypeManager?

    I think since it has a factory method, BC-and-deprecation for the constructor is not necessary. But I will confirm.

  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10
  • πŸ‡ΊπŸ‡ΈUnited States xjm

    OK, I asked in committer Slack about the constructor deprecation, and got feedback from @larowlan:

    I would ask for it - even though the policy doesn't require it.
    It takes us not much effort and makes minor to minor updates less painful

    ...Which is what I'm more comfortable with anyway; I was just trying not to be over-restrictive or NW unnecessarily in case we had become less restrictive about this since I last worked the RTBC queue. πŸ˜€

    So let's add a default null value and a deprecation to the constructor. However, it does not require a deprecation test, nor a change record mention of the added service.

    ...Though, we probably should have a change record of the added config dependency. Generally, anything that needs an upgrade path also wants a CR.

    Thanks everyone!

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

    I added the change record. I haven't addressed other feedback yet.

Production build 0.71.5 2024