Subtheme adds version and packaging info

Created on 12 January 2024, 10 months ago
Updated 18 April 2024, 7 months ago

When creating a sub theme using boostrap_barrio and bootstrap_sass, the following is added:

e.g.

# Information added by Drupal.org packaging script on 2022-08-14
version: '5.0.6'
project: 'mytheme_bootstrap_sass'
datestamp: 1660517237

This causes no packages found error on /admin/reports/updates

🐛 Bug report
Status

Needs work

Version

5.5

Component

Code

Created by

🇬🇧United Kingdom 2dareis2do

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @2dareis2do
  • Status changed to Needs review 8 months ago
  • Open on Drupal.org →
    Core: 10.1.0-alpha1 + Environment: PHP 7.4 & MySQL 5.7
    last update 8 months ago
    Waiting for branch to pass
  • 🇮🇳India Rajan Kumar@2026

    hii @2dareis2do
    Added "Subtheme adds version and packaging info" Barrio Bootstrap base theme.

  • 🇬🇧United Kingdom 2dareis2do

    Thanks Rajan

    I am not sure what your change does but I don't think this is what this ticket is about

    1. The package info appears to be copied from /bootstrap_sass/bootstrap_sass.info.yml not boostrap_barrio/subtheme/bootstrap_barrio_subtheme.info.yml not

    e.g. I have

    # Information added by Drupal.org packaging script on 2023-09-26
    version: '5.0.10'
    project: 'bootstrap_sass'
    datestamp: 1695756932

    in /bootstrap_sass/bootstrap_sass.info.yml

    and the same more or less in

    # Information added by Drupal.org packaging script on 2023-09-26
    version: '5.0.10'
    project: 'my_bb_sass_subtheme'
    datestamp: 1695756932

    in my_theme/my_bb_sass_subtheme.info.yml

    and in bootstrap_sass.info.yml

    2. I am wondering if it is necessary to have packaging info in the sub- theme but (tbh I also don't think this is relevant here)

    e.g. in bootstrap_barrio_subtheme.info.yml we have

    # Information added by Drupal.org packaging script on 2023-12-03
    version: '5.5.16'
    project: 'bootstrap_barrio'
    datestamp: 1701646129
    

    which is also added in bootstrap_barrio.info.yml

    e.g.

    # Information added by Drupal.org packaging script on 2023-12-03
    version: '5.5.16'
    project: 'bootstrap_barrio'
    datestamp: 1701646129
    

    Maybe this is added by drupal but it seems a bit strange to me?

    As mentioned earlier, having packaging info in the info.yml is unnecessary and also causes a no packages found error.

    From what I can tell is is possible to substitute or remove certain items in that bootstrap_sass/scripts/create-subtheme.sh

    e.g we are already swapping out the theme machine name and name when creating a sub-theme.

    #!/bin/bash
    # Script to quickly create sub-theme.
    
    echo '
    +------------------------------------------------------------------------+
    | With this script you could quickly create bootstrap_sass sub-theme     |
    | In order to use this:                                                  |
    | - bootstrap_sass theme (this folder) should be in the contrib folder   |
    +------------------------------------------------------------------------+
    '
    echo 'The machine name of your custom theme? [e.g. mycustom_bootstrap_sass]'
    read CUSTOM_BOOTSTRAP_SASS
    
    echo 'Your theme name ? [e.g. My custom bootstrap_sass]'
    read CUSTOM_BOOTSTRAP_SASS_NAME
    
    if [[ ! -e ../../custom ]]; then
        mkdir ../../custom
    fi
    cd ../../custom
    cp -r ../contrib/bootstrap_sass $CUSTOM_BOOTSTRAP_SASS
    cd $CUSTOM_BOOTSTRAP_SASS
    for file in *bootstrap_sass.*; do mv $file ${file//bootstrap_sass/$CUSTOM_BOOTSTRAP_SASS}; done
    for file in config/*/*bootstrap_sass*.*; do mv $file ${file//bootstrap_sass/$CUSTOM_BOOTSTRAP_SASS}; done
    
    # Remove create_subtheme.sh file, we do not need it in customized subtheme.
    rm scripts/create_subtheme.sh
    
    # mv {_,}$CUSTOM_BOOTSTRAP_SASS.theme
    grep -Rl bootstrap_sass .|xargs sed -i -e "s/bootstrap_sass/$CUSTOM_BOOTSTRAP_SASS/"
    sed -i -e "s/SASS Bootstrap Starter Kit Subtheme/$CUSTOM_BOOTSTRAP_SASS_NAME/" $CUSTOM_BOOTSTRAP_SASS.info.yml
    echo "# Check the themes/custom folder for your new sub-theme."

    I suspect that's where this change needs to go.

  • 🇬🇧United Kingdom 2dareis2do

    Adding

    +version: '5.0.6'
    +project: 'mytheme_bootstrap_sass'  

    Is simply wrong as this is added by Drupal packaging script afaik

  • Status changed to Needs work 8 months ago
  • 🇬🇧United Kingdom 2dareis2do

    I am not sure if this has been mentioned or is in fact intentional, but regarding the script I also seem to have a lot of files suffixed with -e e.g. composer.json-e

  • 🇬🇧United Kingdom 2dareis2do

    With regards the creation of the subtheme, the original change includes the use of additional '' following the -e flag e.g.

    grep -Rl bootstrap_sass .|xargs sed -i '' -e "s/bootstrap_sass/$CUSTOM_BOOTSTRAP_SASS/"
    sed -i '' -e "s/SASS Bootstrap Sttest2arter Kit Subtheme/$CUSTOM_BOOTSTRAP_SASS_NAME/" $CUSTOM_BOOTSTRAP_SASS.info.yml

    Adding these prevents the duplicates files being created with the -e suffix

  • 🇬🇧United Kingdom 2dareis2do

    Sorry the issue with create_subtheme.sh is actually with bootstrao_sass

    bootstrap _barrio seems to handle this.

    e.g.

    if [[ "$OSTYPE" == "darwin"* ]]; then
      grep -Rl bootstrap_barrio_subtheme .|xargs sed -i '' -e "s/bootstrap_barrio_subtheme/$CUSTOM_BARRIO/"
    else
      grep -Rl bootstrap_barrio_subtheme .|xargs sed -i -e "s/bootstrap_barrio_subtheme/$CUSTOM_BARRIO/"
    fi
  • 🇬🇧United Kingdom 2dareis2do

    Added related issue that also mentions packaging info having to be deleted

Production build 0.71.5 2024