- Issue created by @jurgenhaas
- ๐จ๐ฆCanada Liam Morland Ontario, CA ๐จ๐ฆ
There should be an update hook if a new module needs to be installed.
A change like this should not be done in a patch-level release.
- ๐ฉ๐ชGermany jurgenhaas Gottmadingen
An update hook would be too late in this case, since processes like a cache refresh will have failed by then already. That's why this one is really tricky.
- ๐ฎ๐นItaly finex
Hi, until the bug is not solved please add a warning on the description in the module page. Thank you.
- First commit to issue fork.
- ๐ฏ๐ดJordan Rajab Natshah Jordan
Followed with ๐ Option to merge terms (Term Merge integration) Needs review
As- term_merge:term_merge
is in dependencies
Quick fixdrush en term_merge
is needed in old sitesI suggest a quick fix follow up release with a hook update will help a lot
/** * Issue #3444071: Enable the Term Merge module */ function taxonomy_manager_update_8201() { if (!\Drupal::moduleHandler()->moduleExists('term_merge')) { \Drupal::service('module_installer')->install(['term_merge'], FALSE); } }
- Status changed to Needs review
7 months ago 9:36am 30 April 2024 - ๐ฉ๐ชGermany jurgenhaas Gottmadingen
In some cases, this may work. But if the latest composer update brought some new services, then you would have to refresh cache before you can run the update, but that cache refresh fails.
- Status changed to RTBC
7 months ago 9:43am 30 April 2024 - ๐บ๐ฆUkraine vselivanov Kyiv, Ukraine
Yes, just worked with the same fix.
Tested and looks good for me with taxonomy_manager 2.0.10 and Drupal 10.2.5Solution depends on the pipeline. hook update works for me with such deploy:
1. composer install
2. drush updb -y
3. drush cim -y
4. drush cr
Note, that on local I run drush updb with this patch and exported configs with enabled term_merge module. - Status changed to Needs review
7 months ago 12:33pm 30 April 2024 - ๐บ๐ฆUkraine vselivanov Kyiv, Ukraine
I re-tested #7-9 with fresh install and had error for not enabled term_reference_change module dependency:
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: The service "term_merge.term_merger" has a dependency on a non-existent service "term_reference_change.migrator".
Fixed, updated MR and created this patch.
- Status changed to RTBC
7 months ago 12:54pm 30 April 2024 - ๐ฏ๐ดJordan Rajab Natshah Jordan
Got it.
I agrees with Volodymyr .. Keep the default code for install.
In my testing round I did not face issues.Switching to your MR changes and patch.
Better logic. - ๐จ๐ฒCameroon stephane888
Thanks Vselivanov,
Path #12 works on Drupal 10.2.4 - ๐จ๐ฆCanada Liam Morland Ontario, CA ๐จ๐ฆ
If updates need to be run before a cache clear, that should be clearly documented on the release notes.
- ๐น๐ญThailand Nick Hope
Patch #12 works for me.
This was my experience coming from 2.0.9 in Drupal 10.2:
- Updated 2.0.9 to 2.0.10 via `composer update`.
- term_merge and term_reference_change modules got installed with 2.0.10.
- Ran `drush updb` and got the error "Error: Class "Drupal\term_merge\Form\MergeTerms" not found in include() (line 21 of /var/www/html/web/modules/contrib/taxonomy_manager/src/Form/MergeTermsForm.php) #0 /var/www/html/vendor/composer/ClassLoader.php(576): include()"
- Applied patch #12 in Composer with cweagans/composer-patches => `composer update`.
- `drush updb` => 'yes' at the prompt.
- `drush cex` => 'yes' at the prompt.
- `drush cr`
All seems OK.
On a 2nd site, I added the patch before updating and it went smoothly.
- Status changed to Needs work
7 months ago 11:57am 3 May 2024 - ๐ฉ๐ชGermany stborchert
As Jรผrgen already said, simply enabling the module in an update hook won't work. Using automatic deployments you cannot simply run
drush updb
multiple times, they will break on errors.
If some parts of your code rely on external modules, it's advisable to move this code into a submodule. In this case, all code related toMergeTermForm
should live in a submodule of Taxonomy Manager.
Otherwise you'll break the majority of the sites having Taxonomy Manager. - ๐จ๐ฆCanada ryanrobinson_wlu
Same issue. I enabled term_merge on my local development containers and the error is now gone - I have not yet tested our automated deployment to other servers - but I agree that there needs to be a smoother upgrade path in place.
- ๐ฏ๐ดJordan Rajab Natshah Jordan
- Smoother update process
- Smoother deployable process
I agree with Stefan on
In this case, all code related to MergeTermForm should live in a submodule of Taxonomy Manager.
- ๐บ๐ฆUkraine andriy khomych
Well, based on D7 version and https://www.drupal.org/project/term_merge/issues/3160872 โจ Integration with Taxonomy Manager Needs review it seems taxonomy_manager had built-in term merge integration, so I don't agree to move it to the separate module. Besides, we should add it to the taxonomy_manager module composer.json dependency.
However, it is an issue and the upgrade path should be tested. - ๐จ๐ฆCanada Liam Morland Ontario, CA ๐จ๐ฆ
A change this big should not be done in a patch-level release. This is a breaking change. Adding it as a submodule would be fine.
- Merge request !33Issue #3444071: move term_merge related function to submodule โ (Merged) created by stborchert
- Status changed to Needs review
7 months ago 6:58pm 6 May 2024 - ๐ฉ๐ชGermany stborchert
I've reverted the commits integrating Term Merge and added a submodule to provide the functionality.
- ๐บ๐ฆUkraine andriy khomych
> A change this big should not be done in a patch-level release. This is a breaking change. Adding it as a submodule would be fine.
Well, a new major version sounds like a good approach. As it was said and if we check the official module info - https://www.drupal.org/project/taxonomy_manager โ and
D7 version had this functionality without submodules (correct me if I'm wrong). And I think it makes sense to provide this support out of the box.
To me, it sounds like a missed feature request. - ๐บ๐ฆUkraine andriy khomych
This is a critical issue, I've discussed it with one more maintainer (Klausi) and we agreed to use a submodule approach.
I'll merge this PR and prepare a new release. -
Andriy Khomych โ
committed d3b55bd7 on 2.0.x authored by
stBorchert โ
Issue #3444071 by vselivanov, Rajab Natshah, stBorchert, Andriy Khomych...
-
Andriy Khomych โ
committed d3b55bd7 on 2.0.x authored by
stBorchert โ
- Status changed to Fixed
7 months ago 8:32am 7 May 2024 - ๐บ๐ฆUkraine andriy khomych
A new release is here - https://www.drupal.org/project/taxonomy_manager/releases/2.0.11 โ
I'm moving it to fixed. For term merge submodule issues let's open new issues. - ๐ฉ๐ชGermany stborchert
Great!
> For term merge submodule issues let's open new issues.
Uhm, the merge request already includes the new submodule: Taxonomy Manager Merge. All code related to the integration of Term Merge went into this module.
- ๐บ๐ฆUkraine andriy khomych
> Uhm, the merge request already includes the new submodule: Taxonomy Manager Merge. All code related to the integration of Term Merge went into this module.
Yup, I worked fast on this issue, so in case we have some submodule issues, let's open new issues :)
- ๐ฉ๐ชGermany jurgenhaas Gottmadingen
So, removing that dependency and publishing yet another minor, just broke some sites again, since an enabled module is no longer available, as it's removed from the requirement list. :-( Just saying, as people who fixed the problem manually, they just got hit a second time.
- ๐จ๐ฆCanada Liam Morland Ontario, CA ๐จ๐ฆ
One suggestion: When making a release, make an
-rc
release and wait for it to be two weeks old without any release-blocker issues arising before making a full release. Most problems like this would be caught in the release candidate stage. - ๐น๐ญThailand Nick Hope
Follow-up issue for 'missing module' problems after updating to 2.0.11: https://www.drupal.org/project/taxonomy_manager/issues/3445744 ๐ Missing modules after updating from 2.0.10 to 2.0.11 RTBC
- ๐ฉ๐ชGermany stborchert
> just broke some sites again, since an enabled module is no longer available, as it's removed from the requirement list
Uhm, I hate to say this, but you should always export your configuration if you change anything on your site (including updating modules). If you did, the list of enabled modules is saved to {config-export-directory}/core.extension.yml and no module is uninstalled accidentally because it isn't required by other config anymore.
At least the release notes should have made some notes about the changes and possible outcomes.
- ๐ฉ๐ชGermany jurgenhaas Gottmadingen
@stBorchert, that's not the issue. Of course, we have saved config. But the code of the enabled module is no longer there, because the 2.0.11 update removed that dependency and now the modules is gone, but still enabled.
- ๐บ๐ฆUkraine andriy khomych
> One suggestion: When making a release, make an -rc release and wait for it to be two weeks old without any release-blocker issues arising before making a full release. Most problems like this would be caught in the release candidate stage.
Thanks, I will take it into account.
> At least the release notes should have made some notes about the changes and possible outcomes.
Yeah, I've updated the release notes.
> So, removing that dependency and publishing yet another minor, just broke some sites again, since an enabled module is no longer available, as it's removed from the requirement list. :-( Just saying, as people who fixed the problem manually, they just got hit a second time.
I see :( Well, in such a case I suggest adding them manually back and uninstalling them. Sorry for the inconvenience.
Automatically closed - issue fixed for 2 weeks with no activity.