I noticed that a website I work on tried to load themes/contrib/themes/contrib/bootstrap_barrio/images/required.svg, but failed. I was able to locate the CSS statement that caused the issue in the file css/components/webform.css.

The attached patch fixes the issue.

Best regards
Lukas

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

lukas_w created an issue. See original summary.

dharti patel’s picture

Assigned: Unassigned » dharti patel
dharti patel’s picture

Assigned: dharti patel » Unassigned
Status: Active » Needs review

Reviewd this patch and it's working fine. Need to move RTBC.

Thanks!

hatuhay’s picture

The exact location depends on the file structure of your site.
In some cases you should overwrite the location on your subtheme.

floown’s picture

I have not this problem.

I'm on 5.5.6 now, and in my style.css I did have to patch with these lines:
.form-required::after {
content: "";
vertical-align: super;
display: inline-block;
background-image: url(../img/required.svg);
background-repeat: no-repeat;
background-size: 7px 7px;
width: 7px;
height: 7px;
margin: 0 0.3em;
}

Now I have comment all this css block and the red star display themself like a charm from form.css

jan-e’s picture

The exact location depends on the file structure of your site.
In some cases you should overwrite the location on your subtheme.

IMHO, the path should be relative to the root of the theme. webform.css is in bootstrap_barrio/css/components. You have to go 2 up and then down to images. New patch attached.

jan-e’s picture

Version: 5.5.5 » 5.5.x-dev

The same issue exists in version 5.5.6

  • hatuhay committed 48869e4 on 5.5.x
    Issue #3303726 by lukas_w, Jan-E: Wrong path of required.svg in webform....
hatuhay’s picture

Status: Needs review » Fixed
jurgenhaas’s picture

Status: Fixed » Needs work

I tend to disagree with this approach, because this breaks the location when used from a sub-theme. What should be done here is to introduce a variable for the root directory of the bootstrap_barrio theme. This could then be overwritten by a subtheme.

The same applies not only for webform.scss but also for files.scss and form.scss.

jurgenhaas’s picture

Status: Needs work » Needs review

Have provided an MR with the variable being defined and used in the 3 files where relative paths are in use.

super_romeo’s picture

I agree with @jurgenhaas.

jurgenhaas’s picture

Unfortunately, this is again missing in the latest release. It's been fixed in the files.scss but not in webform.scss or form.scss

Could that please being added too? I've prepared everything in a patch file for you.

jurgenhaas’s picture

Re-rolled to fix indentation.

jurgenhaas’s picture

Got confused somehow, the file.scss wasn't fixed either. The latest patch now contains the fix for all 3 scss files.

jurgenhaas’s picture

Also bringing back the missing $barrio_path_images variable

  • hatuhay committed c125bf6f on 5.5.x authored by jurgenhaas
    Issue #3303726 by jurgenhaas, lukas_w, Jan-E, hatuhay: Wrong path of...
hatuhay’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

londova’s picture

I still have this error message after installing the last version 5.5.12

maxmendez’s picture

StatusFileSize
new14.61 KB

This problem persist on 5.5.12 and 5.5.x-dev.

Seems to be only in the compile files.
files

The correct value must be:
background-image: url(../../images/required.svg);

2dareis2do’s picture

If creating sub theme using bootstrap_sass, it is likely that the image path should be relative to the css file that is referencing it. This should likely be as follows:

$barrio_path_images: "../images/";

https://www.drupal.org/project/bootstrap_sass/issues/3384850#comment-152...

Other wise you will get 404 errors e.g.

2023-09-01 15:19:51	Error	xx.xx.xx.xx	404	GET /themes/custom/contrib/bootstrap_barrio/images/icons/text-plain.png HTTP/1.0	https://mywebsite/article/getting-started-ddev-and-apache-solr-service-addon	Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36	919	Apache SSL/TLS access
2023-09-01 15:19:51	Error	xx.xx.xx.xx	404	GET /themes/custom/contrib/bootstrap_barrio/images/icons/text-html.png HTTP/1.0	https://mywebsite/article/getting-started-ddev-and-apache-solr-service-addon	Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36	918	Apache SSL/TLS access
2023-09-01 15:19:51	Error	xx.xx.xx.xx	404	GET /themes/custom/contrib/bootstrap_barrio/images/required.svg HTTP/1.0	https://mywebsite/article/getting-started-ddev-and-apache-solr-service-addon	Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36	35.1 K	Apache SSL/TLS access
2023-09-01 15:19:51	Error	xx.xx.xx.xx	404	GET /themes/custom/contrib/bootstrap_barrio/images/icons/text-x-generic.png HTTP/1.0

Is it possible to re-open this issue?

kristen pol’s picture

Getting these errors as well:

/themes/contrib/bootstrap_barrio/required.svg 404 (Not Found)

Looking at the CSS used in the page source, it's using:

background-image:url(/themes/contrib/bootstrap_barrio/required.svg);

But, this issue can't be reopened other than by the maintainers so we need a new issue.

kristen pol’s picture

kristen pol’s picture

Note that the latest dev version is working as expected so you can use that until a new release is available.

gbajo made their first commit to this issue’s fork.