Closed (fixed)
Project:
Manage display
Version:
2.0.0-alpha1
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
17 Jun 2022 at 10:48 UTC
Updated:
27 Jul 2022 at 15:09 UTC
Jump to comment: Most recent
When updating to 2.x with composer on a larger site, it crashed with having manage_display_fix_title installed.
Fortunately, I could roll back and uninstall manage_display_fix_title first.
composer update --with-all-dependencies
Is there a way to stop composer update if manage_display_fix_title is installed?
I know you could use:
"conflict": {
"drupal/manage_display": "*"
}But that feels like an excessive solution and I'm not sure how to detect a sub-module.
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
adamps commentedUnfortunately in Drupal composer is totally unaware of sub-modules.
We could try to have an update hook that removes the sub-module - provided that it gets to run before Drupal crashes.
Comment #3
neograph734Perhaps ensure that version 2.0 can only be installed in 9.4 and above and push an update to version 1 that limits it at 9.3.*.
Then in 2.0 you could empty the module, but keep the info file and mark it as deprecated or hidden?
I suppose it could then uninstall itself in an update hook?
Comment #4
adamps commentedAlready done in info.xml
I reckon that composer is "too smart" for that to work. It could find a "solution" using 9.4 and the existing beta. So we could instead push 1 1.x that works with 9.4. This IS says "it crashed" - please can someone add the actual error message?
Good idea - if the update hook doesn't work on its own that's the solution.
Patches welcome - I've not had time yet to try 9.4.
Comment #5
greg boggsI think adding an uninstall in an update hook will fix everything.
Comment #6
adamps commentedGreat patches welcome
Comment #7
adamps commentedI just updated a site to D9.4 and it worked fine.
The described step to reproduce is this
Which I guess has also caused an update of manage_display to 2.x. That would make much more sense to explain the reported symptoms. I updated the title and IS. If anyone does not agree then please comment to explain.
Comment #8
adamps commentedI added an instruction to the release note to explain the need to remove manage_display_fix_title manually. Definitely would still be good to have a fix here.
Comment #9
neograph734Won't you run into these issues then? https://www.drupal.org/node/2487215
I think a decent uninstall is still a better solution then just deleting it (could be in the main module as well though).
Comment #12
WebbehTaking the direction from #5, MR for review.
Comment #13
adamps commentedThanks for the patch. For me it reports an error, which I can ignore and continue.
Options I can see
Comments anyone?
Comment #14
neograph734Read the link in #9 ;)
Comment #15
adamps commentedOK I read it😃. Please can you explain in more detail what you mean by "a decent uninstall "?
Comment #16
neograph734Let me start by saing that I don't have any experience with this either. All I know is that Drupal really does not like it when an installed module's files are suddenly missing.
What I meant is also listed as the preferred solution in the above link. Restore the files to their original location and have Drupal uninstall the module. That basically would result in option 2 from the above post. Hide the info file as explained in #3. It can then be dropped on the next major release at the soonest I think...
Option 3 can (and perhaps should) be done regardless of all this. And should mitigate the issue for most users.
For the 33 (registed, but could be more) users that installed this module I am wondering what would be neat. Theoretically it is an alpha relaese, which also suggests that some issues can be expected
All users that upgraded to an alpha release perhaps should be prepared to run into some issues... ? That would be options 1 and 3.
I have been thinking if something with hook_requirements could work. Maybe you can detect if the title fix module is installed during update and runtime. But then instruct the user to first downgrade and then uninstall the submodule before updating again is also a bit silly I guess.
Comment #17
WebbehI think we can use hook_requirements to remind folks to uninstall the module if they somehow reinstall it (warning at runtime).
We could honestly just turn the submodule into a stub (that doesn't do anything) in the 2.0.0 branch, then have the 2.0.0 update hook remove it if it's enabled, and remove it entirely in a future update. That way, more users have the likelihood of uninstalling the module prior to it vanishing into the sunset.
Comment #18
adamps commentedThanks for the comments. So it seems like we should put back the info file, marking the module as hidden. In addition to that I made some minor comments in the MR.
I'm not so worried about the 33 sites on 2.x alpha already as most likely they solved the problem and it's anyway an alpha. Also I'm not so worried about people who reinstall the hidden module again after the update hook removed it as I feel they created their own problems.
Comment #19
WebbehAssigning to myself.
Comment #20
WebbehI actually wonder if lifecycle: obsolete will do everything we want (show error and push people to remove it)?
Comment #21
adamps commentedGreat thanks for the new patch.
Sounds like a good idea however lifecycle_link is required also - tests are failing.
I feel we might as well keep the update hook now that it's already been written.
There was a mixup on one of my comments in the MR - I made a new comment there.
Comment #22
WebbehAdded lifecycle_link here to link to the removal of the submodule in 2.x - should be for review.
No idea why the extra line comments in the MR were showing that way - I undid the original interpretation and I think went in the route you want. Feel free to go in there and adjust as needed if I'm not reading that correctly.
For review.
Comment #23
adamps commentedComment #25
adamps commentedGreat thanks. The obsolete method works really well.
Comment #26
neograph734I am bit late to comment, but shouldnt we only automatically uninstall on >D9.4 systems? Or update the minimal version to 9.4?
Theoretically this sub module is still relevant for 9.3 systems because there the fix is not yet in core right?
Update, nevermind the module is empty anyway.
Comment #27
adamps commentedThis fix is only in 2.x which already requires minimum D9.4