Score:0

create subtheme: permission problem Bootstrap5

fr flag

It is not possible to create a subtheme in Bootstrap5 in Drupal 9. An issue was opened on Drupal.org and it is supposed to have been resolved, but comments continue to arrive from users who continue with the same problem: https://www.drupal.org/project/bootstrap5/issues/3219767

drupal 9.3.2 fresh install with composer on Centos server

composer require 'drupal/bootstrap5:1.1.x-dev@dev'

if i press SUBTHEME create

ERROR: Subtheme cannot be created. Check permissions.

directory themes (drwxrwxr-x) change a chmod 777 themes

ERROR: Subtheme cannot be created. Check permissions.

mkdir custom

chmod 777 custom

if i press SUBTHEME create

ERROR: The website encountered an unexpected error. Please try again later.

Does anyone know the trick to install a subtheme or a guide to correctly manually create a Bootstrap 5 subtheme?

Free Radical avatar
kz flag
Is SELinux enabled on you website? If yes, make sure you disable it. As for manually creating a subtheme, see this comment: https://www.drupal.org/project/bootstrap5/issues/3219767#comment-14433356
cn flag
It sounds like you got past the permissions problems (which aren’t strictly problems, your web server should not be able to write to the themes folder) - but you’ll need to check server error logs to find out what the “unexpected error” was, it’s impossible to guess what it might be from here to advise. If this happens on a fresh install, it’s probably going to need a new bug report to be submitted
fr flag
I found: Got error 'PHP message: Uncaught PHP Exception Drupal\\Core\\File\\Exception\\DirectoryNotReadyException: "The specified file 'themes/contrib/bootstrap5/css/style.css.map' could not be copied because the destination directory '/home/drupal8/domains/MYDOMAIN.COM/public_html/web/themes/contrib/b5subtheme/css' is not properly configured. This may be caused by a problem with file or directory permissions." at /home/drupal8/domains/MYDOMAIN.COM/public_html/web/core/lib/Drupal/Core/File/FileSystem.php line 476', referer: https://MYDOMAIN.COM/admin/appearance/settings/bootstrap5
fr flag
What permissions does the "themes" directory need? Actually is 775. The directory "contib" is 775. Directories "b5subtheme" and "css" were never created, I guess because of the error... Thanks Clive!
Score:0
fr flag

I think this problem is due to security measures on the server where Drupal runs. In order not to touch anything in the server, what I have done:

  1. Install a Xampp in Windows (or Mac or Linux).
  2. Install Drupal & Bootstrap 5
  3. I have created the sub-theme with the proper name, etc.
  4. Upload the new folder to the production server to themes/contrib
  5. Change owner: chown -Rf myuser:myuser subthemename
  6. Activate subtheme in Drupal: /admin/appearance

It works perfectly.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.