Settings no longer stored as third party settings

Created on 29 March 2018, over 6 years ago
Updated 6 June 2023, over 1 year ago

After updating the module from an older version of 8.x-1.0-dev to 8.x-1.0-alpha1, I realized that this module no longer stores its settings as third party settings, but instead the settings are now directly stored as settings of the menu blocks, i.e. the setting 'only_translated_labels' used to be stored in the configuration as 'my_main_menu.third_party_settings.menu_multilingual.only_translated_labels' and now is stored as 'my_main_menu.settings.only_translated_labels'.

From what I can see, this change happened in #2917338 and I am unsure whether this was a desired change or is a regression bug, since the schema.yml of this module still contains the definitions of the third party settings and the change leads to following issues:

- Settings created by the prior version of 8.x-1.0-dev are now ignored (might not be so crucial, since it was a dev release)
- Settings created by 8.x-1.0-alpha1 will remain orphaned in the configuration after uninstalling this module (seems undesirable)

To me the prior way of storing settings as third party settings seemed to be the proper way and I would be glad, if someone could state whether this change now was intended and is incomplete in 8.x-1.0-alpha1 (regarding schema.yml and removing the settings when uninstalling the module) or whether this is a regression bug.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany Sven Michalski

Live updates comments and jobs are added and updated live.
  • Regression

    It restores functionality that was present in earlier versions.

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.

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    @JeroenT what's the status here? Is the MR final?

    The changes look very good and important. Are you using this in production already?
    It also adds very important tests, so let's please finalize this :)

    I'll tag this for review. Any active maintainer who can also have a look? Otherwise, would you perhaps jump in as Co-Maintainer @JeroenT?

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica
  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    As of the general importance

  • πŸ‡³πŸ‡΄Norway matsbla

    Tests fail, update require-dev to newest context version.

  • Status changed to Needs work almost 2 years ago
  • πŸ‡ΊπŸ‡¦Ukraine vlad.dancer Kyiv

    Hey Mats, just tested the patch and found no major issues, only a couple of notes.

    I've tried to test path on Gitpod env via Drupalpod.
    And it seems Drupalpod do not install require-dev packages when you create env right from browser extension.

    Automatic tests.
    In order to run tests there I run manually `composer require drupal/context:^5.1` and similar for menu_block module.

    1. minor issue is in composer deps.

    +++ b/composer.json
    @@ -19,6 +19,7 @@
    +    "drupal/context": "^5.1"
    

    There is no 5.1 version for context module but composer will install dev version instead:

    composer show -a drupal/context
    ...
    versions : * 5.x-dev, 5.0.0-rc1, 4.x-dev, 4.1.0, 4.0.0, 4.0.0-beta6, 4.0.0-beta5, 4.0.0-beta4, 4.0.0-beta3, 4.0.0-beta2, 4.0.0-beta1, 1.x-dev, 1.0.0-alpha1, 0.x-dev, dev-1.x, dev-0.x, * dev-5.x, dev-4.x
    

    I'm not sure but we can update it to ^5.0 or even specify beta. BTW: I used context v4.1 for manuall testing, so this is really minor.

    Manuall testing.
    I used system menus with blocks + context module.
    Created a couple of menu links and translated them, show them in blocks. No issues, works great, as expected.
    Then I ensured that third party settings are in place within exported configs:

    context.context.test_context.yml
    -----
    name: test_context
    reactions:
      blocks:
        id: blocks
        blocks:
          00d9886c-364f-44c6-85f4-a4d86d2adb9e:
            id: 'system_menu_block:main'
            label: 'Main navigation'
            provider: system
            custom_id: system_menu_block_main
            ...
            third_party_settings:
              menu_multilingual:
                only_translated_labels: 1
                only_translated_content: false
    ====
    block.block.olivero_main_menu.yml
    ----
    third_party_settings:
      menu_multilingual:
        only_translated_labels: true
        only_translated_content: true
    ...
    id: olivero_main_menu
    plugin: 'system_menu_block:main'
    settings:
      id: 'system_menu_block:main'
      ...
      provider: system
      level: 1
      depth: 2
      expand_all_items: true
    

    Now, small code nitpeaks:)
    PHPCS didn't provided any helpfull advices.
    But

    +++ b/tests/fixtures/update/menu-multilingual-block-settings.php
    @@ -0,0 +1,58 @@
    + * Contains database additions to search-api-db-base.php.
    + *
    + * Can be used for setting up a base Search API sorts installation.
    

    Seems like odd strings related to search api. Let's update them.

    That's all!

    Greak work @matsbla, @Jeroen!
    Thanks @Anybody for pushing forward.

  • πŸ‡©πŸ‡ͺGermany Grevil

    @matsbla please commit your changes to this issue's issue fork, or at least provide an interdiff with your changes!

  • πŸ‡ΊπŸ‡¦Ukraine vlad.dancer Kyiv

    Well, I updated fork and now @Grevil your turn with help :)
    You could help us in the next ways:
    - create interdiff and ensure that changes were done only in composer.json,
    - or review and give feedback on patch/fork
    - or do manual testing
    - or run automated tests locally

  • πŸ‡©πŸ‡ͺGermany Grevil

    @vlad.dancer, thanks!

    On it! :)

  • Assigned to Grevil
  • πŸ‡©πŸ‡ͺGermany Grevil

    We should think about either dropping the Drupal 8 compatibility entirely, or instead create a new 2.x branch where we drop the Drupal 8 compatibility and drop the Drupal 10 compatibility in the "old" branch. The reasoning behind this is, that "drupal/context" 4.1 is not Drupal 10 compatible, making this module not compatible either. Your decision @vlad.dancer and @matsbla!

    I also found this issue here: πŸ› Enable strict config schema for tests Closed: duplicate , simply removing the variable will lead to the tests failing, which would be out of scope of this issue, so I created a seperate issue.

  • πŸ‡ΊπŸ‡¦Ukraine vlad.dancer Kyiv

    Wow, @Grevil. That's great feedback! Thank you.

  • Issue was unassigned.
  • Status changed to Needs review almost 2 years ago
  • πŸ‡©πŸ‡ͺGermany Grevil

    Found another tiny issue, otherwise code looks great and tests run successful locally! Great work! :)

    Let's discuss #38 πŸ› Settings no longer stored as third party settings Fixed and then get this stuff committed soon! If we decide to use drupal/context:5.0-rc and drop the D8 compatibility, we should quickly do some further manual testing.

  • πŸ‡©πŸ‡ͺGermany Grevil

    @vlad.dancer, glad I could help! :)

  • Status changed to RTBC over 1 year ago
  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Great work @Grevil! Let's set this RTBC for maintainer review and decision regarding #38. I'd vote for a new 2.x semver branch.

  • Status changed to Fixed over 1 year ago
  • πŸ‡ΊπŸ‡¦Ukraine vlad.dancer Kyiv

    Thank you folks! Just merged and commited.
    I created 2.x branch, let's plan integration with drupal/context:5.0 now.

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

Production build 0.71.5 2024