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.
| Comment | File | Size | Author |
|---|---|---|---|
| #32 | 2956990-32.patch | 41.39 KB | matsbla |
| #19 | 2956990-19.patch | 41.42 KB | jeroent |
Issue fork menu_multilingual-2956990
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
matsbla commentedThanks for reporting!
I guess really not a regression as that was a dev version.
I guess that was not really intended either.
We could fix it, but then it would need an update as we now made a stable release.
Comment #3
matsbla commentedComment #4
kovden commentedHello! We can't use third-party settings for Menu Multilingual, because Context module doesn't support them (related issue https://www.drupal.org/project/menu_multilingual/issues/2917338).
I've created the Support request with the details https://www.drupal.org/project/context/issues/2992000
Comment #5
matsbla commentedComment #6
matsbla commentedWe need to wait fix this until context module has third party settings support.
Comment #7
matsbla commentedComment #8
jeroentThe module in still in alpha, so an upgrade path is not required. But without one, this change will break all existing sites that use this module.
Comment #9
jeroentAdded an upgrade path and test coverage.
Comment #10
matsbla commentedThanks a lot for the effort.
The problem is that this patch breaks the integration with Context module.
The tests are passing because we are still missing tests for context integration #3037173: Create tests
I tested it manually, but it doesn't seem to work. I don't get the Menu Multilingual options inside menu blocks within contexts.
Comment #11
matsbla commentedComment #12
jeroentDoes this patch still break context integration now that #2953766: Provide a Configuration Schema is committed?
Comment #13
matsbla commented@JeroenT
I tested the patch again now using Context version 8.x-4.0-beta5 where #2953766: Provide a Configuration Schema should be included, however the menu multilingual config options are not displayed on menu blocks inside the contect UI.
Comment #14
matsbla commentedI think this issue needs to be solved first #2992000: Third party settings support
Comment #15
jeroentBack to needs review now that #2992000: Third party settings support is committed.
This issue needs to be tested with the dev version of context.
Comment #16
matsbla commentedGreat, I have already tested and it seems to work now!
Will just look more carefully over the patch.
I also think we should wait until there is a new release for context module which include the patch available.
Comment #17
vlad.dancerOk, the context module now has a stable version with included patch (8.x-4.1 5 August 2021)
So, we need to fix our test then here #3161849: Tests fail.
Comment #18
jeroentPatch no longer applied, so I created a reroll.
Context integration seems to be broken so I added test coverage for context here. Since this patch should fix that.
Issue is still postponed because of #3228412: Replace deprecated code in tests
Comment #19
jeroentComment #20
vlad.dancer@JeroenT, I've enabled "Run on commit and for issues" option.
Comment #21
jeroentThanks @vlad.dancer, seems to be working. See #3228412: Replace deprecated code in tests
Comment #22
vlad.dancerOk, now we've updated deprecated code in tests.
Comment #24
jeroentAccording to me, the patch is almost ready.
The context tests are failing with a strict config schema check, but this needs changes in context. Created an issue for that #3228540: Provide a config schema for block reaction - third party settings
Comment #25
jeroentAnd I created as a follow-up once the context issue is fixed: #3228543: Run context tests with a strict config schema check..
Comment #26
jeroentI reverted the changes in MenuMultilingualLinkTreeModifier.php, so a rebase should be straightforward for both issues.
Comment #27
jeroentI rebased this merge request.
Comment #28
jeroentComment #29
anybody@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?
Comment #30
anybodyComment #31
anybodyAs of the general importance
Comment #32
matsbla commentedTests fail, update require-dev to newest context version.
Comment #33
vlad.dancerHey 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.
There is no 5.1 version for context module but composer will install dev version instead:
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:
Now, small code nitpeaks:)
PHPCS didn't provided any helpfull advices.
But
Seems like odd strings related to search api. Let's update them.
That's all!
Greak work @matsbla, @Jeroen!
Thanks @Anybody for pushing forward.
Comment #34
grevil commented@matsbla please commit your changes to this issue's issue fork, or at least provide an interdiff with your changes. Especially since all the work was already committed on this branch! This makes rebasing the branch, working on the branch and general visibility way easier for others!
Comment #35
vlad.dancerWell, 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
Comment #36
grevil commented@vlad.dancer, thanks!
On it! :)
Comment #37
grevil commentedComment #38
grevil commentedWe 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: #3348699: Enable strict config schema for tests, 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.
Comment #39
vlad.dancerWow, @Grevil. That's great feedback! Thank you.
Comment #40
grevil commentedFound another tiny issue, otherwise code looks great and tests run successful locally! Great work! :)
Let's discuss #38 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.
Comment #41
grevil commented@vlad.dancer, glad I could help! :)
Comment #42
anybodyGreat work @Grevil! Let's set this RTBC for maintainer review and decision regarding #38. I'd vote for a new 2.x semver branch.
Comment #43
vlad.dancerComment #46
vlad.dancerThank you folks! Just merged and commited.
I created 2.x branch, let's plan integration with drupal/context:5.0 now.