Media Library Theme Reset, a requirement for this module, is unsupported, an alternative is needed.

If you're updating from an earlier version, this module no longer requires Media Library Theme Reset (because it's unsupported). The update might cause the module to be removed entirely from your codebase, in which case you should uninstall Media Library Theme Reset before deploying the update (it can be done manually or in a post update hook). Failure to do so will result in an error message:

The following module is marked as installed in the core.extension configuration, but it is missing:
media_library_theme_reset

If you'd still like the functionality from Media Library Theme Reset you can try

Command icon 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

Grabby created an issue. See original summary.

mark_fullmer’s picture

Due to concern over the "unsupported" status of Media Library Theme Reset, the maintainers have set it back to "supported" and instead marked the module as "deprecated." A summary of this, along with a timeline for marking it as "unsupported," is at #3325258: Mark Media Library Theme Reset as "Deprecated".

So sites using Bootstrap Styles may continue using Media Library Theme Reset. However, we encourage you to switch to using https://www.drupal.org/project/layout_builder_iframe_modal , as it will improve the user experience. I have functionally tested integration with Bootstrap Styles and Layout Builder Iframe Modal and everything works as expected, and the media library looks better: it matches whatever the site's administrative theme is, and does not employ any CSS overrides to do so.

Switching to Layout Builder Iframe Modal

The project page of Bootstrap Styles lists Media Library Theme Reset as a needed module. However, it is not a dependency in code. Therefore, sites should be able to switch as follows:

1. Add "Layout Builder Iframe Modal" to the site codebase. https://www.drupal.org/project/layout_builder_iframe_modal
2. If the site is using the alternate module "Layout Builder Modal," uninstall it and remove it from the codebase.
3. Enable "Layout Builder Iframe Modal."
4. Uninstall "Media Library Theme Reset" and remove it from the codebase.

rajab natshah’s picture

mylocaltrades’s picture

You can't currently do this:

1. Add "Layout Builder Iframe Modal" to the site codebase. https://www.drupal.org/project/layout_builder_iframe_modal
2. If the site is using the alternate module "Layout Builder Modal," uninstall it and remove it from the codebase.
3. Enable "Layout Builder Iframe Modal."
4. Uninstall "Media Library Theme Reset" and remove it from the codebase.

The Bootstrap Styles module adds the Media Library Theme Reset module as a dependency in it's info.yml file.

I have tested this manually by removing the dependency and it works fine using the Layout Builder Iframe Modal module. So I think we just need to change or remove the dependency in the Bootstrap styles module info file?

hfernandes’s picture

I did some tests disabling the layout_builder_modal and enabling the layout_builder_iframe_modal module.
Unfortunately, it's not as simple as that. The layout breaks because there are some CSS files manipulating the #layout-builder-modal and the #drupal-off-canvas (for the default drupal behavior).

My suggestion for this issue is:
1) Adjust the bootstrap_styles_page_attachments_alter hook to properly include the CSS files based on the routes configured on /admin/config/content/layout_builder_iframe_modal;
2) Adjust the module CSS to work with layout_builder_iframe_modal;
3) Remove the media_library_theme_reset dependency from bootstrap_styles.info.yml and composer.json files;
4) Update the module's composer.json to "suggest" the layout_builder_iframe_modal - https://getcomposer.org/doc/04-schema.md#suggest

rajab natshah’s picture

Agrees with Halison.
It's not easy. We are doing that in Varbase 10.0.x branch.
Made all the needed changes. Still needs more refactoring work tho.

A bit of issues with styling an iframe in iframe in iframe
Some issues like:
#3326497: Switch from hard coded removes of regions and elements which not needed for the block edit form
Having more work on this to support Gin ( Dark and Light) mode, and Claro.
About the same like what Sascha did in #3276164: Add style overrides for the Gin admin theme
https://git.drupalcode.org/project/autocomplete_deluxe/-/commit/0e54417#...

acnimda’s picture

For me the truth is.

1. Uncomment - media_library_theme_reset:media_library_theme_reset in bootstrap_styles.yml.
2. uninstall media_library_theme_reset | drush pmu media_library_theme_reset
3. Delete from codebase composer remove drupal/media_library_theme_reset or rm -f web/modules/contrib/media_library_theme_reset

Conclusion: media_library_theme_resetIs not essential to this module

mark_fullmer’s picture

Conclusion: media_library_theme_resetIs not essential to this module

I agree with this framing of the issue, provided that there is not literally "breakage" as reported previously:

The layout breaks because there are some CSS files manipulating the #layout-builder-modal and the #drupal-off-canvas (for the default drupal behavior).

drupalnesia’s picture

Since Media Library Theme Reset is "deprecated" again now, this Bootstrap_styles module needs to update its code, see: https://www.drupal.org/project/bootstrap_styles/issues/3325150#comment-1...

socialnicheguru’s picture

Upload a patch to remove the deprecated module and replace with layout_builder_iframe_modal.
This is an initial step as other issues must be addressed.

socialnicheguru’s picture

StatusFileSize
new887 bytes

This patch is a mistake. The other is fine

socialnicheguru’s picture

ivnish’s picture

Version: 1.0.3 » 1.1.0
Status: Active » Reviewed & tested by the community

Patch #11 works

vlad.dancer’s picture

Status: Reviewed & tested by the community » Needs work

Path #11 is no more compatible with 1.x version.
See https://git.drupalcode.org/project/bootstrap_styles/-/blob/1.0.x/bootstr...
I think it was designed for 2.x version.

vlad.dancer’s picture

Status: Needs work » Needs review
shaunole’s picture

Status: Needs review » Reviewed & tested by the community

No issues found when testing//validating @vlad.dancer 's MR !55 against the 1.0.x branch. Updating status to RTBC

dastan56’s picture

hi, the patch #11 was not working with 1.1.0, so i created this new patch, it removes media_library_theme_reset in both info.yml and composer.json file and replaces it with layout_builder_iframe_modal

dastan56’s picture

if you are getting still issue in applying the patch #22 then following this article: https://chromatichq.com/insights/patching-info-files-composer/

i used this command and the patch applied cleanly:

composer require 'drupal/bootstrap_styles:^1.1' --prefer-source

dastan56’s picture

Status: Reviewed & tested by the community » Needs review
socialnicheguru’s picture

StatusFileSize
new880 bytes

Update:
@dastan56 was correct in comment #20

not sure why that is but it does work.

--
None of the ones above applied for me.
The MR did not apply either.
I rerolled to apply to bootstrap_styles 1.1

socialnicheguru’s picture

Status: Needs review » Needs work

in #6 the first 2 items have not been addressed:

1) Adjust the bootstrap_styles_page_attachments_alter hook to properly include the CSS files based on the routes configured on /admin/config/content/layout_builder_iframe_modal;
2) Adjust the module CSS to work with layout_builder_iframe_modal;

flyke’s picture

StatusFileSize
new873 bytes

Since layout_builder_iframe_modal seems problematic on frontend theme (see this issue) wouldn't it make more sense to require layout_builer_modal instead of layout_builder_iframe_modal ?

flyke’s picture

StatusFileSize
new859 bytes

Forgot something in previous patch.
Also please note that
composer require 'drupal/bootstrap_styles:^1.1' --prefer-source
is the working command, just regular composer require or composer install wont apply the patch for some reason.

flyke’s picture

So, If you are planning to use layout_builder_iframe_modal, use patch #22.
If you want to use layout_builder_modal, use patch #25.

When I use layout_builder_iframe_modal then I am having serious layout problems.
When I use layout_builder_modal, then the section settings open off canvas, which I dont want.
So I also use patch #3214458 for layout_builder_modal so that the section settings also open in a modal.
And now... everything still kinda sucks unfortunately.

So I am open for recommended approaches.
- I want to use modals when you create/edit sections or blocks
- I want the content of the create/edit section or block to look ok

flyke’s picture

StatusFileSize
new53.09 KB

Update: the layout is actually ok when using layout_builder_modal.
Apparently I forgot that I had gin_lb module enabled. Using bootstrap_styles + layout_builder_modal without gin_lb module is exactly what I was looking for.

thomas kaisuka’s picture

StatusFileSize
new127.59 KB

Hello flyke I have used patch #25. Initially failed to apply but with "composer require 'drupal/bootstrap_styles:^1.1' --prefer-source" did apply.

So MLTR is now removed from all my dependencies and am good to go.

So am using Layout Builder Modal just as before without the worry of MLTR, which i have now disabled

c.altosax’s picture

I applied the patch from #22, and confirmed that Bootstrap Styles' info.yml and composer.json files were updated as expected. I ran `composer require 'drupal/bootstrap_styles:^1.1' --prefer-source`.

While the patch appears to have applied correctly, composer still says that "drupal/bootstrap_styles 1.1.5 requires drupal/media_library_theme_reset (^1.0)." I can't remove MLTR, and Composer also didn't install Layout Builder iFrame Modal like I expected it to. It doesn't consider it to be a dependency, despite it being listed as such in the Bootstrap Styles composer.json.

What am I missing? It seems like Composer must be loading the dependencies from the Drupal.org version of Bootstrap Styles as opposed to my locally installed/patched version.

Edit: I can uninstall MLTR through the Drupal web UI, though its code is still present because Composer won't let me remove it. However, uninstalling it through the UI is enough for Drupal to stop warning about having a deprecated module installed. I can also install Layout Builder iFrame Modal, and it works as expected. As was mentioned in earlier comments, the styling is far from perfect, but it technically works.

trevorbradley’s picture

Just wandered in here from the Bootstrap Media Theme Reset module. It appears to have finally moved into its unsupported state. See: https://www.drupal.org/project/media_library_theme_reset

andileco’s picture

StatusFileSize
new880 bytes

The --prefer-source flag was not working for us, so attempting a different version of the patch based on the 1.1.5 tag rather than the 1.0.x branch. Hoping this works!

ivnish’s picture

Version: 1.1.0 » 1.1.5
Status: Needs work » Needs review
gerzenstl’s picture

We are planning to use layout_builder_iframe_modal module.

I was able to apply from patch #31 by using the workaround of installing the module from source. I used the following in composer.json file:

{
    ...
    "config": {
        "preferred-install": {
            "drupal/bootstrap_styles": "source",
            "*": "dist"
        },
    }
    ...
}

and then apply the patch by running composer install

The patch from #22 and #31 works on my setup.

websiteworkspace’s picture

With notes above lasting for over a year, why couldn't the maintainers of these various modules have coordinated better with each other so that users of these modules aren't left with the glaring "Not Supported!" in their site's available updates.

There are about three dozens reports now above about the difficulties users have experienced trying to migrate by hand from "media library them reset" to the newly support layout_builder_iframe_modal module.

Note that #33 is just three days old, but the problem reports date back as far as an entire year.

--

This type of lack of planning, and lack of coordination, is part of why the Drupal user base keeps getting smaller and smaller and smaller.

https://www.drupal.org/project/usage/drupal

dehacker’s picture

Applied patch #31 locally with ddev and was able to get the expected result. Also with #33.

However, build failed on Pantheon, due to upstream patch error in build for unknown reasons Pantheon was not able to help resolve.

Asking the maintainers of this module to fix that dependency problem to make this module Drupal 10 compatible.

drupalnesia’s picture

Why takes more than 1 year to fix the "Media Library Theme Reset" issue?

rajab natshah’s picture

jaypan’s picture

websiteworkspace - Drupal is open source. It's not fair to complain, when all the work is done by volunteers. The module wouldn't even exist in the first place without their time.

If you want a new version released faster, speak to the developer about funding a module upgrade.

mahmoud-zayed’s picture

Agree with you Jaypan, I love open source and I contribute to it as much as I can!

BLB modules are widely used even by big tech companies. No doubts funding these modules will make them better, there are a lot of great ideas that can be added to improve BLB ecosystem.

finn lewis’s picture

Status: Needs review » Reviewed & tested by the community

Hey people!

The patch in #31 works for me with the suggestion in #33

It looks like the merge request https://git.drupalcode.org/project/bootstrap_styles/-/merge_requests/55/... does the same as the patch, so setting this RTBC as it sounds like a simple solution that is working for a few people.

Any chance of a merge and release?

Many thanks!

Finn

dehacker’s picture

After updating to Drupal 10.2.3 our site has fatal error WSOD from 'Layout Builder Blocks' module, which relies on this module. The fatal error was caused by a patch for depreciation messages emanating from this module. The solution was to remove the patch from composer.json.

"drupal/layout_builder_blocks": {
                "Deprecation notices fix" : "https://www.drupal.org/files/issues/2023-05-30/3363647-3-deprecateds.patch"
maxilein’s picture

which patch? This patch? Could you please be specific?

drupler8’s picture

@mahmoud-zayed

Mahmoud, you and your team are great! Why don't you set up something like jrockowitz https://www.drupal.org/project/webform where people can donate 5 dollars a month toward the development of bootstrap styles / layout builder.

I would think many others are a touch nervous about the media library theme reset module messing up these great projects.
https://www.drupal.org/project/bootstrap_layout_builder/issues/3325151#c...

I posted this https://www.drupal.org/project/bootstrap_layout_builder/issues/3325151#c...

Is the answer definitively to go with Layout Builder iFrame Modal?

Thanks so much for your teams efforts and open source support!

flyke’s picture

I was unable to apply patch #31 to bootstrap_styles v1.1.5 for some reason.
Testing another patch for that.

flyke’s picture

Nevemind.
I am working with a main drupal project and a dependent custom drupal module on a private company repository which in turns depends on layoutbuilder etc. I have not quite nailed it in the custom module as its a bit hard to keep testing the custom module requirements and patches via the main project. On first sight there is nothing wrong with patch #31, So i'm hiding this test patch in favor of that.

flyke’s picture

The MR55 also works. You just have to use instructions from #33.
Composer.json:

{
    ...
    "require": {
        ...
        "drupal/bootstrap_layout_builder": "^2.1",
        "drupal/bootstrap_styles": "^1.1",
        "drupal/layout_builder_iframe_modal": "^1.3"
    },
    "config": {
        "preferred-install": {
            "drupal/bootstrap_styles": "source",
            "*": "dist"
        }
    },
    "extra": {
        "patches": {
            "drupal/bootstrap_layout_builder": {
                "#3325151": "https://git.drupalcode.org/project/bootstrap_layout_builder/-/merge_requests/22.diff"
            },
            "drupal/bootstrap_styles": {
                "#3325150": "https://git.drupalcode.org/project/bootstrap_styles/-/merge_requests/55.diff"
            }
        }
    }
}

This is what worked for me.
After that, I could successfully run:
drush pmu media_library_theme_reset

juagarc4’s picture

Hi all,

I tried the solution of #33 and it works properly. The patch could be applied properly.

Information for all of you that tried to remove the source code using composer once applied the patch.

You will never be able to remove the source code using composer, because the patch is applied after the composer installation. This
produces that the composer.lock file still contains the requirement of media_library_theme_reset in to the bootstrap_styles entry.

So if you try to run 'composer remove drupal/media_library_theme_reset' you will be warned that boostrap_styles still requires this module and it won't be uninstalled.

The only way to get the source removed is not to install it at all, but it will be only possible once the MR has been merged into the base code.

andileco’s picture

For some reason that I can't figure out, I can't get any patch for this module to apply on my hosting provider (Pantheon). It works fine locally. So if anyone else is facing this situation, here's what I did:

1) I removed my patch in composer.json

2) I created replace_bootstrap_styles_yml.php inside a directory I named "scripts" inside my root, with the following inside:

<?php

// Define the path to the file.
$file_path = './web/modules/contrib/bootstrap_styles/bootstrap_styles.info.yml';

// Read the current content of the file.
$content = file_get_contents($file_path);

// Replace the specified line.
$new_content = str_replace(
  '  - media_library_theme_reset:media_library_theme_reset',
  '  - layout_builder_iframe_modal:layout_builder_iframe_modal',
  $content
);

// Write the updated content back to the file.
file_put_contents($file_path, $new_content);

echo "Replacement complete.\n";

3) I added the following inside my composer.json:

    "scripts": {
        "post-update-cmd": ["php ./scripts/replace_bootstrap_styles_yml.php"],
        "post-install-cmd": ["php ./scripts/replace_bootstrap_styles_yml.php"]
    },

4) Committed and pushed (Pantheon - if you're using the "build step" - runs composer install each time you push, which triggers this script).

Note that you'll need to adjust this based on whether or not you're using the "web" directory or if you have a different name for the folder your "contrib" modules go into.

The code for media_library_theme_reset will still exist in your codebase, but because the dependency for it is no longer in bootstrap_styles, you can uninstall the module via Drush or via that UI.

rajab natshah’s picture

Title: Media Library Theme Reset not supported » Remove not supported Media Library Theme Reset module

Thank you, for following up on this issue.

Decided to only remove the media_library_theme_reset:media_library_theme_reset
Developers in projects can manage any type of modals on their own way.

Allowing Developers to use Layout Builder Modal or Layout Builder iFrame Modal

  • Rajab Natshah committed 5be964ee on 1.0.x
    Issue #3325150: Remove not supported Media Library Theme Reset module
    

  • Rajab Natshah committed 6c783697 on 2.0.x
    Issue #3325150: Remove not supported Media Library Theme Reset module
    
rajab natshah’s picture

rajab natshah’s picture

Status: Reviewed & tested by the community » Fixed
rajab natshah’s picture

Issue summary: View changes
StatusFileSize
new46.89 KB
szy’s picture

I'm not sure, if everything goes according to the plan ;)

After updating the site with composer:

Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 1 update, 1 removal
  - Removing drupal/media_library_theme_reset (1.5.0)
  - Upgrading drupal/bootstrap_styles (1.1.5 => 1.1.6)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 1 update, 1 removal
  - Downloading drupal/bootstrap_styles (1.1.6)
  - Removing drupal/media_library_theme_reset (1.5.0)
  - Upgrading drupal/bootstrap_styles (1.1.5 => 1.1.6): Extracting archive
 0/2 [>---------------------------]   0%Deleting /var/www/html/web/modules/contrib/media_library_theme_reset - deleted

... I see in the status report:

The following module is marked as installed in the core.extension configuration, but it is missing:
media_library_theme_reset

Review the suggestions for resolving this incompatibility to repair your installation, and then re-run update.php.

So it looks like the media_library_theme_reset is removed, but it wasn't completely uninstalled from the system.

Szy.

rajab natshah’s picture

Szymon, you are right.

The module is not follwoing with latest Drupal changes.

Removed the module.

Unsupported

Not supported (i.e. abandoned), and no longer being developed. Learn more about dealing with unsupported (abandoned) projects

For sure the module can be required by the following if the project still needs it:
composer require 'drupal/media_library_theme_reset:^1.5'

Recommended to switch to other ways.

kevin.pfeifer’s picture

We solved this problem with the latest version by

  1. composer require 'drupal/media_library_theme_reset'
  2. Manually uninstalling the module in the drupal backend
  3. composer remove 'drupal/media_library_theme_reset'

would be nice if a drush updb hook would be added in the next patch release to do that automatically

papagrande’s picture

Status: Fixed » Needs work

Unfortunately, this is not fixed.

- media_library_theme_reset:media_library_theme_reset needs to be removed from bootstrap_styles.info.yml to get rid of the dependency.

Edit: Something else is blocking the update for this module.

papagrande’s picture

Status: Needs work » Fixed
papagrande’s picture

For anyone else having trouble updating to 1.1.6 and beyond, remove any special settings in repositories or conflict in your composer.json file that were added to make the patch work.

Status: Fixed » Closed (fixed)

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

xurizaemon’s picture

Title: Remove not supported Media Library Theme Reset module » Remove unsupported Media Library Theme Reset module, require Layout Builder Iframe Modal

Updating title since patch proposes to add a replacement rather than just removing

leducdubleuet’s picture

Title: Remove unsupported Media Library Theme Reset module, require Layout Builder Iframe Modal » Remove unsupported Media Library Theme Reset module

The module Layout Builder Iframe Modal is not required by version 1.1.6 so I removed the last part added to the title ", require Layout Builder Iframe Modal".

xurizaemon’s picture

Thanks LeDucDeBleuet! Yeah I was assisting someone in Slack and they were referencing this issue in trying to apply the patch.

After a closer read I see that in comment 49 @Rajab decided

Decided to only remove the media_library_theme_reset:media_library_theme_reset
Developers in projects can manage any type of modals on their own way.

I am hiding the patch from 31 (since now that #49 was committed, that patch doesn't apply).

marassa’s picture

Shouldn't the description on the module page be corrected accordingly? I see some people confused over the requirement present in the module description but not in the module code anymore.

freddy rodriguez’s picture

#57 +1

andyf’s picture

Just to echo the first part of #55, if you install vanilla Drupal with bootstrap styles 1.1.5 and then update to 1.1.6 you will end up with an error message because you didn't uninstall media library theme reset before it got removed from the codebase. I think this needs a really clear warning in the release notes.

Re the last part of #57 I don't think it can be solved in code (eg. in an update) because it's plausible a site still wants the module enabled (it might even be a hard dependency of some other module on the site).

rajab natshah’s picture

Listed in the release note as provided by Andy
https://www.drupal.org/project/bootstrap_styles/releases/1.1.6

If you're updating from an earlier version, this module no longer requires Media Library Theme Reset (because it's unsupported). The update might cause the module to be removed entirely from your codebase, in which case you should uninstall Media Library Theme Reset before deploying the update (it can be done manually or in a post update hook). Failure to do so will result in an error message:

The following module is marked as installed in the core.extension configuration, but it is missing:
media_library_theme_reset

If you'd still like the functionality from Media Library Theme Reset you can try

rajab natshah’s picture

Issue summary: View changes