Problem/Motivation
When I add logo img to sites I don't get a ALT && Title field as I would get when adding an image_field to nodes.
Proposed resolution
Thus, it seems there is no simple GUI way to add these; By now I myself added them through the twig, but I humbly suggest adding these fields as ensuring valid usage of Drupal for all users. Also, they're quite important for SEO.
Sending people to add these from at the SQL or by an external module should be avoided, I think.
Remaining tasks
The tests that were added need reviewing by someone experienced with tests.
We still need to decide whether we should reference the newly created variables in the twig templates or just stick with the markup defined in variables content ie:
Option 1 (current patch):
$variables['site_logo_alt'] = $variables['content']['site_logo_alt']['#markup'];
$variables['site_logo_title'] = $variables['content']['site_logo_title']['#markup'];
Versus Option 2 (proposed in #23, saying we should maybe not create new variables, and just reference the markup from the existing $variables['content'])
$variables['content']['site_logo_alt']['#markup'];
$variables['content']['site_logo_title']['#markup'];
In #30 it's suggested that using option 1 is okay. Option 1 makes it so we lose the #access part of the render array. If you look at other variables like 'site_name', and 'site_slogan', they do not have the #access part of the render array. Here's an example of some other variables that don't have #access:
'site_logo' => string(35) "/drupal/core/themes/bartik/logo.svg"
'site_logo_alt' => string(0) ""
'site_logo_title' => string(0) ""
'site_name' => string(6) "Drupal"
'site_slogan' => string(0) ""
Completed Tasks
Configuration for the logo alt attribute and title attribute has been added in two cases:
1) When you use the default logo
2) When you upload your own custom logo
The system branding block has been updated to support the logo alt and logo title attributes in the Bartik, Classy and Stable themes.
Testing for saving the alt attribute and title attribute has been added in a patch in https://www.drupal.org/node/2780293#comment-12061662 (#40). Testing to ensure the alt and title attributes show in the branding block have been added in patch https://www.drupal.org/node/2780293#comment-12073031 (#45)
@rovo: has tested accessibility via Wave in #34
| Comment | File | Size | Author |
|---|---|---|---|
| #168 | 2780293-nr-bot.txt | 147 bytes | needs-review-queue-bot |
| #164 | 2780293-159-1.patch | 17.44 KB | bharti mehta |
| #159 | interdiff-2780293-158-159.txt | 2.62 KB | guptahemant |
| #159 | 2780293-159.patch | 17.44 KB | guptahemant |
| #158 | 2780293-158.patch | 16.9 KB | manuel garcia |
Issue fork drupal-2780293
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
Comment #2
Benia commentedComment #3
dawehnerThat sounds more like a theme system issue
Comment #5
joelpittetThis could go in to 8.x, could you provide a patch @Benia?
Comment #6
Benia commentedSadly I have yet to acquire enough PHP-SQL knowledge regarding how to add this feature (I think I could do it in my own site with JS but it certainty not a global solution).
Comment #7
markconroy commentedAn issue for this has already been discussed and it was decided to provide documentation rather than a patch. See here: https://www.drupal.org/node/717708
Documentation page here: https://www.drupal.org/docs/7/theming/howto/how-to-edit-alt-tag-on-your-... (though it's for Drupal 7 at the moment)
Comment #8
markconroy commentedAdding new tag to this issue. Let's get a fresh opinion on this, since the linked issue is over 4 years old.
Andrew? Mike?
Comment #9
joelpittetDon't need to know SQL, so you are half way. Anyways here's a start, may need some UX review on the labels and we need some tests but it looks to work for me:)
Comment #10
joelpittet@markconroy I think we can get this in core, sorry cross posted with you.
Comment #11
joelpittetComment #12
Benia commentedComment #13
yoroy commentedSome screenshots so we can review the text labels would be good.
Comment #14
steffenrI'll test it and add some screenshots for the issue.
Comment #15
steffenrThe patch worked fine for me and adds the mentioned fields to the logo settings form of all the themes.
Attached the screenshots:
Custom image/ Default Image

Output in theme

SteffenR
Comment #16
steffenrComment #17
lauriiiCould we use the |default('Home'|t) here so that we don't break this for existing sites? I believe this change could be done also to the Stable and Classy templates since this is a non-breaking change!
Comment #18
yoroy commentedThanks for the screenshots. The labels look good. Maybe have a look at the options for an image field, I suspect there's descriptions there that show what an alt, what a title attribute is for.
Comment #19
joelpittet@lauriii, we can add
|default()twig filter but it shouldn't break existing sites because I added that text in the default configuration settings.And oh yeah it could go into Stable/Classy, good thinking
Comment #20
joelpittetI've addressed #17 with the
#descriptionfrom core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php:227 and the#maxlengthComment #21
lauriii@joelpittet the default configuration gets only imported on install so existing installations are affected if we don't use the default filter. Not sure if there should be update hook instead to set the default values.
Comment #22
joelpittetOh that makes sense, thanks for explaining that @lauriii. I did it to all of them.
Comment #23
lauriiiOn this conversion we lose the #access from the render array. We should instead copy the whole render array. I'm not sure if we need to do this at all and could just access the variable inside content?
There's still some needs tags that needs to be also addressed.
Comment #24
bart88 commentedIs there a reason this isn't a switch statement?
Comment #25
manuel garcia commentedRe #24 My guess is that the last two don't really qualify for a normal switch statement, though I could be wrong. Attached how it'd look as a switch statement.. not too pretty either.
Comment #27
joelpittetReroll, #23 needs to be addressed still.
Comment #28
jcnventuraComment #29
jcnventuraComment #30
jcnventuraI've just looked at #23, and I don't think it's relevant for this issue, as it '#access' is lost to all other site variables as well. Fixing that to pass the whole render array should be a new issue. But indeed, it needs tests.
Comment #31
melinda_ksz commentedI have reviewed and tested the patch for different use cases (adding only alt text, adding only title, adding both, also adding custom logo...), it worked all good.
Comment #32
mradcliffeThe issue summary should be update to include the status of the issue with regard to what has been done so far and what needs to be done.
- To address a11y review tag the a11y gate should be helpful: https://www.drupal.org/core/gates#accessibility
- The Needs tests tag still seems to apply with the latest patch so that should include testing the new markup in a browser test.
@jcnventura, could you go into more depth about why #23 does not apply?
Comment #33
jamesdixon commentedPatch in #27 worked for me. Looking further into #23 and how the issue summary should be updated based on what's been done.
Comment #34
rovoI've applied the patch from #27 and tested with WAVE.
Comment #35
jamesdixon commentedUpdated the issue summary. Looks like for the implementation part we need to decide whether it's okay #access is not part of the render array for $variables['site_logo_alt'] and $variables['site_logo_title'].
@jcnventura argues that other defined variables like $variables['site_name'] don't have #access, and so $variables['site_logo_alt'] and $variables['site_logo_title'] don't need it.
Also a browser test and accessibility review are still needed.
Comment #36
jamesdixon commented@mradcliffe: What do you mean by testing the new markup in a browser test?
Comment #37
jamesdixon commentedHad a chat with @mradcliffe at DrupalCon Baltimore about what he meant when he said we needed a browser test. He means we need a BrowserTestBase web test as described here: https://www.drupal.org/node/2735005. I updated the issue summary to clarify this in the remaining tasks section.
Comment #38
jamesdixon commentedA WebTest exists for the branding block here: https://api.drupal.org/api/drupal/core%21modules%21system%21src%21Tests%...
There's a testThemeSettings() function in there which tests the theme settings which seems like a good place to test the title and alt attributes are actually showing up. Should we add our tests here to testThemeSettings()?
I believe the WebTestBase is now deprecated, and we're supposed to be using BrowserTestBase, although converting the test from WebTestBase to BrowserTestBase may be outside of the scope of this issue.
Comment #39
jamesdixon commentedFrom my discussion with the mentors it sounds like we should be adding our test to the WebTestBase that exists, and leave upgrading the test for another issue. I'm going to take a stab at updating the test to check for the title and alt attribute.
Comment #40
jamesdixon commentedI've taken a crack at testing the alt attribute and title in the logo settings form in testThemeSettingsLogo().
I think we need to add some additional steps inside of testThemeSettings() to test the title and alt attributes actually show up in the markup as has been done for the img src.
Comment #41
jamesdixon commentedComment #42
andrewmacpherson commentedJust catching up with this now. As @markconroy said, this feature request previously came up during the d7 cycle, in #717708: Document how to set logo in theme with proper alt tags. I took a look back over that issue to see why we decided not to implement it. (Thanks for tagging this @mark.)
As I recall, we got stuck on the issue of what should happen if a site builder uploaded a custom logo image, but did not specify a custom text alternative. Or vice-versa, kept the default image but customized the text alternative. The decision to won't-fix happened at the Montreal Drupal a11y sprint in 2012.
With hindsight, I think we were worrying too much about that. Nowadays, I'd rather we simply trust the site builder to use the settings responsibly. It's not as if the concept of a simple image link and text alternative are a Drupal-specific thing.
The previous issue was filed by an a11y maintainer at the time, and I was keen on it too. Now, I'm one of the a11y maintainers and I'd like to see this go ahead. Removing the "needs accessibility review tag".
Good to see that @lauriii thinks this is a non-breaking change for Stable/Classy (comment #17). If it wasn't an acceptable change for stable/classy, that would have made things much more difficult I think (because would have ended up with a feature which wouldn't work out of the box for themes which relied on Stable or Classy as a base). The use of
|default()looks like a good safeguard.I tried the patch from #40 and it seems to work well, but I haven't looked at the tests carefully.
Nice work! Really glad to see this.
Comment #43
andrewmacpherson commentedI don't like this mention of search engines in the help text. While it's certainly true that search engines like Google appear to make use of image text alternatives, they are not the intended audience. It's quite common to find images where an author has used the ALT attribute for SEO keyword stuffing, and it's very unhelpful for any of the intended scenarios. I don't want to encourage that in Drupal's UI.
Comment #44
jamesdixon commentedCool, thanks for the detailed suggestions @andrewmacpherson. I'm updating the description to include what's needed at this point including your suggestion to remove search engines from the help text.
Comment #45
manuel garcia commentedChanging the help text and expanding the tests to check that the alt and title attributes are properly rendered (in bartik).
Comment #46
jamesdixon commentedRight on @Manuel Garcia, thanks for updating the wording and adding that test!
I applied your patch to 8.4.x and the text appears updated as shown in the attached screenshot.
https://www.drupal.org/files/issues/logo-settings-new-text.png
Also for both the default logo and a custom logo, the title and alt attributes are showing up in the markup. See screenshots attached.
https://www.drupal.org/files/issues/bartik-default.png
https://www.drupal.org/files/issues/bartik-custom-logo.png
I believe we're really close, and need a review from someone with more experience with tests. My review is a thumbs up, if the tests look good and there are no other issues found I believe this is good to go!
Updating work needed in description to reflect we need further review of tests.
Comment #47
mahalingam_cs commentedApplied patch from #45 and it worked as expected. Attached the reference screenshot. New title and the title update worked fine.
Comment #48
mahalingam_cs commentedComment #49
andrewmacpherson commentedin #46, jamesdixon says:
We're still waiting on feedback about the tests, so setting this back to needs-review.
Comment #50
john cook commentedI've had a look at the added tests and they all look OK.
As we've added some variables available to themers, a change record should be drafted.
There's also a "Needs issue summary update" tag. I see @jamesdixon updated it last in comment #35. Does the summary need updating further or does the tag need to be removed?.
Once they're done I think it'll be RTBC.
Comment #51
manuel garcia commentedThanks @John Cook!
Added the CR: https://www.drupal.org/node/2878236
Comment #52
andrewmacpherson commentedFurther to what I said in #43 about the search engines. It turns out that image fields in general have the same problem, encouraging SEO abuse. I'll file a separate issue about that.
Comment #53
andrewmacpherson commentedThe labels for the alt and title attributes differ to those on image field widgets.
In patch #45 here they are called "Logo alt attribute" and "Logo title attribute". On imagefield widgets they are called "Alternative text" and "Title".
Can we update these for consistency with imagefield widgets please? I think we can still keep the word "logo" in there.
Comment #54
andrewmacpherson commentedThe patch in #45 changes
ImageWidget.phpin Image module. That's probably out of scope for this issue, which is otherwise just about the theme settings form and branding block template.Can we remove this, and deal with it in a separate issue?
Comment #55
pritishkumar commentedRemoved the Change in ImageWidget.php as in #54
Comment #56
manuel garcia commentedThanks for the review, and good catch @andrewmacpherson.
Interdiff in #55 looks good, thank you @pritish.kumar
Addressing #53 on this one, and updading the CR to reflect the new theme settings field labels:
https://www.drupal.org/node/2878236/revisions/view/10483116/10483415
Comment #57
andrewmacpherson commentedI opened #2878238: Image Field Alternative text description should not encourage SEO abuse to deal with the help text on FieldAPI image fields.
Comment #58
manuel garcia commentedTests have been given the OK, CR has been added, and the minor changes requested on #53 and #54 have been addressed. Back to RTBC.
Comment #59
alexpottShould be type label so they can be translated.
You don't need the ternary here - the config will always default to Home.
Same here we can have less logic. No need for all the default handling.
We need an update path to set this on all existing installations. And also I think we need to care about the theme settings for all installed themes too.
Comment #60
manuel garcia commentedThank you @alexpott for the review, spending sometime on this today.
Comment #61
manuel garcia commentedAddressing #59 and adding upgrade path for the global theme settings as well as all installed themes.
Comment #62
alexpott@Manuel Garcia thanks for the new patch - The update path is going to need a test.
What should we do about requiring these fields - \Drupal\image\Plugin\Field\FieldWidget\ImageWidget::process() has some complex logic for this.
New variables to document.
Comment #63
manuel garcia commentedAs for #62.1, ImageWidget uses
'#alt_field_required'for this, though I'm not sure I follow what you mean here, this is not a field, just plain old form? Should just make the logo alt and title required?Also, I've been scratching my head for a while, but I don't see why we've got failing tests from
UpdatePathTestBase::runUpdates(), it is complaining thatstable.settingsandclassy.settingshave no schema. However the configuration does save properly... can anyone help with this one?Comment #65
john cook commented@Manuel, I found this dealing with schemea problem: https://www.drupal.org/node/2654810. Maybe it will be of help here.
Comment #66
manuel garcia commentedThanks @John Cook, I've spent a good hour trying to figure this out, but no luck.
Here's what I've found, in hope that someone else can continue this:
UpdatePathTestBase::runUpdates()seems to treat that situation as a fail for some reason (Saving them when they didn't exist before).ThemeSettingsFormdoes it, but I see nothing different so far.I'm guessing we should be checking if we've got configuration for each theme, if so then load it, set the new values, and save it. Otherwise, create a new one "properly", set the new values and save it.
\Drupal::configFactory()->getEditable('bartik.settings')->set('logo.alt', 'Home')->save(TRUE);doesn't seem to be the way to go about it, although you can definitely do this in custom code. Any pointers would be very welcome :)Comment #67
alexpottYou only should be writing is the theme settings have been customised.
As base themes classy and stable are not customisable. This means you need to ensure that bartik.settings actually exists in the update path test.
Comment #68
andrewmacpherson commentedRe: #62.1 - the logo image absolutely MUST have alt text, because it is the only content inside a link. Without it, we would have a link without a text value:
That's a WCAG 2 failure at level A , specifically F89: Failure of Success Criteria 2.4.4, 2.4.9 and 4.1.2 due to not providing an accessible name for an image which is the only content in a link.
I thought this was why we had the Twig default values like this:
alt="{{ site_logo_alt|default('Home'|t) }}". They were flagged in #59.3 and removed in patch #61.We could just make the alt field mandatory in the them settings form, but I'm a bit worried that there isn't an easy way for a user to set it back to the default. With the Twig default, leaving it blank would still result in ALT text, and the description could say it defaults to "Home" if left blank. (Caveat: can this default vary per theme?)
The logo title attribute doesn't have to be mandatory.
Comment #69
alexpott@andrewmacpherson it's not the twig template's job to make it easy to revert to default. Making it required in the form is best because then when the user tries to set it to empty they get an error rather than the alt text being unexpectedly set to Home for reasons that are not obvious.
Comment #70
john cook commentedI've changed the update function as suggested by alexpotts in #67. It works when testing locally, we'll se what testbot makes of it.
I've also made the alt text field mandatory from the comments by andrewmacpherson (#68) and alex (#69.
Comment #72
john cook commentedAdded the same code for the update function (from #67) to the test to ensure that only active themes have their settings checked.
Comment #73
john cook commentedComment #74
alexpottRather than a foreach here it would be great to be more explicit as this is a test.
Comment #75
john cook commentedI've changed the test so that in only checks the setting for the seven theme, as suggested by alexpott in #74.
Comment #76
john cook commentedComment #77
dinesh18 commentedI have tested the patch mentioned in comment #75 and it is working as expected.
PFA screengrab before and after patch.
Comment #78
manuel garcia commentedAh beautiful thank you @John Cook for the work, and @alexpott for the explanations, makes perfect sense now.
To answer #68 very valid concern on accessibility, there is no need to handle defaults on the twig files like alex said, drupal already handles this for us. Double checked just in case, on a brand new drupal installation with this patch, markup looks like this:
Changes to the tests look fine, to me, tempted to RTBC, just one thing:
Should we be testing for other core themes as well or does checking seven suffice?
Comment #79
john cook commented@Manuel, I checked when it looped which themes passed and seven was the only one that did.
I think that seven is the active theme when doing the test, with no other themes enabled.
Comment #80
manuel garcia commented@John Cook ah, perfect then, thanks for clarifying.
Comment #81
manuel garcia commentedComment #82
lauriiiThe current upgrade path is missing support for translations. This is a BC break which we don't want to introduce. I suggest that we iterate through all the languages site has enabled, and create configuration translation in each language. We should also extend the test coverage for this use case.
Comment #83
penyaskito@Manuel Garcia asked for help on IRC, so I jumped in and took a look as how this should look like.
We would need there something along:
Here I assumed that we only want to write the configuration translation if it was already translated to that language.
Open questions: how do we get default values?
t('Home', [], ['langcode' => $langcode])is one option, but in most cases there won't be a translation already in the site.Comment #84
manuel garcia commentedThanks @laurii for the review and thanks @penyaskito for kindly explaining this.
Attached the updated upgrade path, which creates a new configuration translation for each language (or updates it if it was there already).
Tested this manually with a fresh install of Drupal in English and Spanish, then ran the update - seems to work as expected... I'd love a quick review before extending the test coverage though :)
Comment #85
manuel garcia commentedComment #86
penyaskitoNot sure if you want to create the override if it didn't existed before.
You also want to edit these config translations in the same way
Comment #87
manuel garcia commentedThanks again @penyaskito for the review & explanations, here some progress hopefully addressing #86 :)
One thing that still worries me about all this is that I don't see these to be translated on
/admin/config/regional/config-translation- is this expected or? How would one go about translating these two then?Comment #88
manuel garcia commentedRerolling, a new update hook was added to system.install.
Comment #89
manuel garcia commentedHere is my attempt at adding test coverage for the multilingual part of the upgrade path, however it is failing for me.
I'm not sure whether the test is wrong or whether the changes made since #75 need to be looked at (or both).
In any case this is as far as I can go - any help would be very welcome =]
Comment #94
andrewmacpherson commentedThe Umami demo profile has a real need for this. (I know, that seems the wrong way around. Umami is supposed to be a demo of Drupal's existing features, rather than driving requests for new features...)
Currently the Umami branding block uses a logo image which shows the site name in a fancy font, AND it adds .visually-hidden to the site name display. The upshot of this is that the Umami branding block shows the site name to sighted users, and has a visually-hidden site name for screen readers.
But there's a huge accessibility problem with this. The visually hidden site name is a link, so there's an operable link in there which cannot be perceived + understood by sighted keyboard users. It's a WCAG failure of "Focus Visible".
A better approach for Umami would be to uncheck the site name display option, and set the logo alt text to "Umami Food Magazine", which is exactly what THIS issue would provide.
I think the situation with the Umami header design reflects a common scenario, so it justifies this feature.
Comment #95
manuel garcia commentedNearly forgot about this one, re-rolling for now...
Comment #96
manuel garcia commentedComment #98
manuel garcia commentedCleaning up the old test to be in line with current times.
Comment #100
manuel garcia commentedSome more cleanup and hopefully fixing one of the failing tests.
Comment #102
manuel garcia commentedA bit more cleanup and getting the new
SiteLogoAltTitleAddedTestto pass up to where we check for the language config override ofseven.settings.Not sure why it fails there, I've debugged the update function and it seems to run correctly.
Perhaps its because of why we're setting up the test here?
Any pointers would be welcome at this stage, not very familiar with this part of core, so I'm blocked for now...
Comment #104
manuel garcia commentedI cant reproduce this failure shown by the bot when I run the test locally:
Schema key block.block.bartik_account_menu:settings.cache failed with: missing schemaComment #105
andrewmacpherson commentedGood to see this moving, thanks @Manuel.
I tried out the UI, and it's looking good. We recently updated the FAPI #descriptions for the alt text in Editor and Image modules, in #2991149: Improve placeholder text for image upload. There, we got rid of bad advice which said the alt text was for search engines, so I wanted to check what the logo alt #description said here. I'm happy with it. Looking back over this issue history, it seems I first had the idea to remove the bad SEO advice in comment #43 here.
I skim-read the update hook here. I haven't tested it, but going by the code comments it looks like it's all in hand, and there's a test for the update.
I'll let someone else review the update path and tests in detail. The GUI and output are ready.
Comment #106
mradcliffeI added the DrupalEurope issue tag and we can work on this. Update tests can be difficult to debug, but this could be a missing module in the test that needs to be included in this test in addition to the base class.
Comment #108
bserem commentedI am also getting different results:
Don't know if this helps anyone.
Comment #109
manuel garcia commentedYeah that is what I see locally too @bserem - though I don't know why it happens, my guess is we're setting up the test incorrectly, but I don't know how to set it up otherwise...
Comment #110
mradcliffe@tashaharrison80, @sysosmaster, and I are working on this together at DrupalEurope.
The update is running fine in the test, but we believe that the themes are not installed correctly (particularly seven).
Comment #111
mradcliffeWe found that the test failure noted by @bserem is correct. We've (@sysosmaster) concluded the test should pass if the translation is working as it is supposed to be.
We (@tasharobinson80) tested manually and found that the alt/title are not translated while using a different language and a non-default theme. However it is being translated when a theme is the global theme.
We confirmed the update is running successfully as well on multiple environments and themes (seven, bartik, stark).
This might be a bug in the language configuration overrides or the theme settings in this patch.
I think the next step is to look at the rest of the patch and see how the configuration is coming in.
Comment #112
mradcliffeActually, @tasharobinson80 pointed out that the last part of the update isn't running at all so the config override doesn't exist for the theme settings and thus isn't getting set.
It's also hard to look at the issue because we're not sure the user interface for language config overrides quite yet. Probably need to look up the documentation around that.
Comment #113
sysosmaster commentedworked on this with @tashaharrison80 and @mradcliffe. @ Drupaleurope
Comment #114
andypostSince 8.6 logo can be svg or image https://www.drupal.org/node/2939152
It means that theme should be smart enough to display "alt" depending on type of logo
-
altfor images-
aria-labelfor svg for accessibilityWhy alt default value is "Home" instead of "Logo" which is should explain what this element is about
Comment #115
andrewmacpherson commented@andypost - no, the suggestions in #144 are going off-track.
That change record is about specifying a default logo path & filename in info files. It didn't change the types of image which could be used as a logo, just removed a hard-coded default filename. We've always been able to use SVG, JPEG, PNG, as a custom logo in D8.
It doesn't matter whether the logo is SVG or a raster format, the file is used as the
<img src>. So there's no need to usearia-label- the first rule of using ARIA is that you don't use ARIA when a HTML mechanism is available. When an<img src>points to an SVG, thealtattribute is the correct way to provide a text alternative.Aside: on the other hand, if the
<svg>document was embedded in the HTML directly, thenaria-labelwould be appropriate. That's not the case with the branding block though.Remember the logo image is also a link, so we must convey the purpose of the link. That's more important than describing the image itself. "Logo" helps nobody because it's too vague - it describes neither the image itself, nor the purpose of the link.
"Home" describes the purpose of the link, and is currently hard-coded in the branding block template. It's a reasonable default, and this patch allows profiles to override it with installation config.
Some examples may explain this better.
alt="home"will suffice. The same applies for the Minimal profile with the Stark theme, and many contrib distros.alt="Umami Food Magazine"(or perhapsalt="Umami Food Magazine - Home"). This is an image used alone as a linked logo. See also example 9 in Understanding WCAG SC 1.1.1 Non-text Content. Since the logo image has the site name, we don't want to display the site name text link at all. Currently it isvisually-hidden, but this causes problems for sighted keyboard users, so we'll be turning it off in the branding block config once this patch is in. This scenario applies to many web sites, and perhaps some distros too.Comment #117
andrewmacpherson commentedAdding sprint credits from #112-113
Comment #118
manuel garcia commentedRerroll of #102, simple conflict on system.install.
Comment #119
manuel garcia commentedJust a small cleanup to use
public static $modules = ['language'];to enable the language module in the test.I think the last failures on the test might've been because of random test bot failures,
Schema key block.block.bartik_account_menu:settings.cache failed with: missing schemadoesnt seem to be related to this patch.Comment #122
manuel garcia commentedThis should get the test to actually run.
I noticed that the previous failure is still happening:
So I added assertions to check that the language config overrides exist, and apparently for seven.settings it doesnt:
I've tried reseting the language manager and rebuilding the container after creating the language, but no luck.
If anyone knows why this is happening I'd be very keen to hear it :)
Comment #124
manuel garcia commentedOK did a bit more digging, it seems that actually these theme settings are not currently translatable as far as I can see...
I tried adding this to the
system.config_translation.ymlfile but getting access denied when accessing/admin/appearance/settings/translate:So still blocked, but the update test seems to have picked up an actual bug in the current patch so that’s good news.
Comment #125
manuel garcia commentedSeems to me like we'd need #2154743: Support route parameters for *.config_translation.yml files' base_route_name properties for this to happen?
I don't think core theme settings are actually translatable at the moment? I believe this is blocked unless someone figures out a way forward.
Comment #126
vijaycs85Its also worth noting that the [theme_name].settings config is not really getting installed as part of theme install. Only config we can see when installed with standard profile is
seven.settingsand looks like it exists only because of the 3rd party settings from shortcut module.Comment #127
tim.plunkettFixing tags
Comment #128
andrewmacpherson commentedThe accessibility tag has been behaving strangely over the last month. I'll ask the drupal.org webmasters for help, but for the meantime leave both tags in place.
Comment #130
mgiffordFixing tagging.
Comment #131
justinbmc commentedI am working on this issue at DrupalCon 2019 Seattle, though a newbie and may not be helping much!No longer looking at this. Sorry!Comment #132
sonu.raj.chauhan commentedComment #133
sonu.raj.chauhan commentedComment #134
sonu.raj.chauhan commentedComment #135
sonu.raj.chauhan commentedComment #136
sonu.raj.chauhan commentedComment #137
sonu.raj.chauhan commentedComment #138
vacho commented@sonu.raj.chauhan Hi, thanks for collaborating. Please always set a comment describing your work over this case and too a interdiff file that describe the changes on git.
BTW patchs 123, 124, 135 and 136 (by @sonu.raj.chauhan) are the same code.
Comment #139
vacho commentedComment #140
vacho commentedComment #141
vacho commentedPatch 122 rerolled and some update to twigs files and system.install
Comment #142
shaalI updated Umami's theme to use the new settings for the logo.
I added a missing empty line at the end of
system.installfile.Comment #144
volkswagenchickTagging for DrupalCamp Colorado 2019 (Sunday August 4)
Comment #145
aleevasHere is my patch
Comment #146
aleevasOops, sorry, was a wrong patch.
This one should be better.
Comment #147
manuel garcia commentedSo glad to see other people pushing this forward, I totally hit a brick wall on this and had lost hope :)
Re #146:
I'm not entirely sure this is what we want to do... shouldn't we be updating only if the language configuration override exists already?
Comment #148
andrewmacpherson commentedThe site logo no longer uses a title attribute since #2920395: SystemBrandingBlock has identical anchor title and link content (image alt).
A GUI to set the logo alternative text is still desirable, but there's no longer a need for a GUI to set the logo title attribute. The parts dealing with the logo title attribute can be removed from this patch. I'll work on that today.
Comment #149
andrewmacpherson commentedComment #150
andypostSetting to NW because template translation should not be used
Also I think it could be slightly simplified by extending the block setting... I see no reason to introduce a theme setting additionally
Both title and alt stored in config and should use config translation instead of template level translation (it's easy to miss quotes in template)
On other hand block config form could be improved to allow configure alt and title per block instance (it will also use config translation for block) - then theme setting could be used as default... but block already has own defaults
Comment #151
andrewmacpherson commentedA regression crept in with patch #145:
This doesn't appear in the interdiff in #145 so I went looking via git blame. It looks like this is an unintentional reversion of #3042999: Remove ucfirst() from missing dependencies on the Extend page.
This patch fixes that.
Comment #152
andrewmacpherson commentedI'm working on #148 just now.
#150:
I think I see what you mean about template translation. I try that after addressing #148.
But the logo image is specified at the theme settings page. The alt text should be set in the same form.
Comment #153
andrewmacpherson commentedThis patch addresses #148, by removing everything to do with the custom title attribute. Now the patch just provides a GUI for the logo's text alternative.
It doesn't address #150 yet.
Also, I noticed that the template files were updating the title attribute on the site-name link too:
That's out of scope for this issue, which is just about the logo image, not the site-name. I've undone this change in each template.
Comment #154
andrewmacpherson commentedAddresses the template translation part of #150.
I don't really grok the config translation issue that Manuel Garcia linked in #125... #2154743: Support route parameters for *.config_translation.yml files' base_route_name properties
Comment #155
andrewmacpherson commentedProbably not a novice issue any more.
Comment #156
manuel garcia commentedThanks a bunch for working on this.
Looks like we dropped the update path test
SiteLogoAltTitleAddedTestfrom the patch since #146, setting to needs work because of that. It'll probably also need updating as well since we are removing everything to do with the custom title attribute.Comment #158
manuel garcia commentedAdding back the update path test, removing the parts that were testing the logo.title configuration since we're no longer adding it.
Comment #159
guptahemant commentedHi everyone
We have been using patch from #122 and than an updated patch from #135 for a long time, now since then this issue has been updated a lot and now the correct update hook is 8703, Now if we apply the latest patch on our sites it will result in data loss, To avoid this i am attaching an updated patch which reads the existing alt text values from db first and than apply the values.
Please review.
Thanks
Comment #160
manuel garcia commentedRe #151:
Thanks for reporting about running the patch for a long time, looks like its working correctly I assume :)
I'm not sure core should account for such situations where the update hook updates the value of your patched config. That said, I dont think it hurts to check it just in case. In my opinion tough if the configuration has an existing value, we should not save it again with the same value.
A quick eyeball review of the interdiff on #151:
These are still saving the new configuration value even if there was an existing one.
Comment #164
bharti mehta commentedComment #168
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #170
mgiffordLooks like WCAG SC 1.1.1 may still be a problem. I have not tested if this is the case with the latest patch.