We've also encountered the same issues as outlined in #5 while testing Drupal 10.3. Patch #2 seemed to resolve the issue, but I believe the issue stems from something in the Bootstrap theme as mentioned in #1 and #2. I've experimented with switching to the core Olivero theme and the contrib Bootstrap5 theme and the issue wasn't present.
johns996, is your team using a sub-theme based on Bootstrap? If so, that may further confirm my suspicion and likely points to this issue needing to move over there instead of in Core.
hummeldon β created an issue.
I am testing this in our environment as well. I couldn't get the library pulled in through composer and had to resort to manually adding it as mlecha mentioned.
Can we expect a 3.1.0 release expected to be released soon? D9 EoL is quickly approaching!
I can confirm that #2 resolves the issue for our sites.
PHP 8.1.22
Drupal 9.5.10
Our team has had this module sitting unused and unable to uninstall for the same reasons. I finally wanted to take a stab and fixing the issue.
Problem
Uninstalling Mobile Device Detection will delete blocks that have the module listed as a dependency.
Solution
Added code to the mobile_device_detection_uninstall()
hook to iterate through all config files with the block.block
prefix:
- Removes instances of 'mobile_device_detection' under dependencies.module
- Removes instances of 'mobile_device_detection' under visibility
Notes
Drupal will warn you of blocks that will be deleted on uninstall. I believe this is because Drupal detects the dependencies prior to the uninstall hook resolving the dependency issues. In my testing with this patch, these are false alarms.
To aid users with identifying affected blocks, I've included a log notice upon uninstall that mentions any blocks that were modified.
This patch is not intended to included in a release of this module. It is simply to assist others with uninstalling this unmaintained and problematic module. My suggestion would be that this module be fully retired and point users to Mobile Detect β
Finally, I want to stress that you should absolutely test this in a dev environment before attempting to use it on a production environment. Regardless of my experience with the patch, there is still a risk that blocks will be deleted and you should be certain it works in your environment beforehand.
Also, this is my first ever contribution to the Drupal community! I hope this helps people out.