- Issue created by @pivica
- Status changed to Needs review
over 1 year ago 12:42pm 22 September 2023 - 🇷🇸Serbia pivica
Here is a patch. Note that for this patch to work you first need a patch from 🐛 Logo accessibility problems Needs review , I guess it is a time for a new release ;)
This also needs a patch from ✨ Add service for extraction dimensions from SVG image Active .
- Status changed to Needs work
about 1 year ago 1:35pm 28 September 2023 - 🇨🇭Switzerland berdir Switzerland
-
+++ b/themes/bs_bootstrap/bs_bootstrap.theme @@ -382,9 +381,25 @@ function bs_bootstrap_preprocess_block(&$variables) { + if (file_exists(DRUPAL_ROOT . $variables['site_logo'])) { + $svg_content = file_get_contents(DRUPAL_ROOT . $variables['site_logo']);
this assumes that the logo is svg, should we check the file extension?
-
+++ b/themes/bs_bootstrap/bs_bootstrap.theme @@ -382,9 +381,25 @@ function bs_bootstrap_preprocess_block(&$variables) { + /** @var \Drupal\bs_lib\SvgTools $svg_tools */ + $svg_tools = \Drupal::service('bs_lib.svg_tools');
I think it maks sense to do a getContainer()->hasService(), because if someone for some reason didn't update the module, it's going to be very hard to recover from this.
-
+++ b/themes/bs_bootstrap/bs_bootstrap.theme @@ -382,9 +381,25 @@ function bs_bootstrap_preprocess_block(&$variables) { + if (isset($dimensions['width'])) {
I assume we don't want to set only width or height, so we should make sure we either return both or nothing and then you can just do if ($dimensions).
-
- Status changed to Needs review
about 1 year ago 12:35pm 2 October 2023 - 🇷🇸Serbia pivica
> 1. this assumes that the logo is svg, should we check the file extension?
381: if ($logo_path_info['extension'] === 'svg') {
This we are already doing here, right?
2. and 3. should be done, needed to do a new patch for related service in bs_lib https://www.drupal.org/project/bs_lib/issues/3389133#comment-15253540 ✨ Add service for extraction dimensions from SVG image Active .
- Status changed to Fixed
9 months ago 2:03pm 12 April 2024 Automatically closed - issue fixed for 2 weeks with no activity.