Problem/Motivation
The node module provides a "syndicate" block, which contains a link to rss.xml.
The link text is an unfinished sentence: "Subscribe to".
The link is generated in SyndicateBlock.php using '#theme' => 'feed_icon'.
The corresponding feed-icon.html.twig template expects a top-level variable called title like so:
{{ 'Subscribe to @title'|t({'@title': title}) }}.
However no title variable has been passed in to the theme template by SyndicateBlock.php, so the link is an unfinished sentence. It's not clear what was originally intended for this to say. We could look back to how things worked in D7, but at this stage that might not be relevant any more.
Proposed resolution
Pass in a title in to the feed_icon template, so the link text makes sense.
I suggest we use the site name for this.
Remaining tasks
- Update
SyndicateBlock.php - Check tests
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #28 | 3156244-28.patch | 3.07 KB | meenakshi_j |
| #27 | Screenshot from 2021-07-13 11-35-05.png | 222.41 KB | dhirendra.mishra |
| #23 | interdiff-3156244-33.txt | 2.96 KB | vakulrai |
| #23 | syndicate_block_title-3156244-23.patch | 2.96 KB | vakulrai |
| #18 | 3156244-16.patch | 3.04 KB | deepak goyal |
Comments
Comment #2
andrewmacpherson commentedComment #3
andrewmacpherson commentedI noticed this problem after reviewing #3153860: Theme and Configure the RSS Feed Views Block in Olivero.
Comment #4
darchuletajr commentedCan I take a stab at this issue?
Comment #5
andrewmacpherson commentedOf course, go ahead!
Comment #6
darchuletajr commentedNot sure if this is overkill but I used dependency injection to get the site name from the config factory service. I could have also just used the Drupal object like so
\Drupal::config('system.site')->get('name').Comment #7
andrewmacpherson commentedThis approach looks OK to me. It will need test coverage too.
UserLoginBlockuses\Drupal::config(), but theSystemBrandingBlockuses an config factory injected via thecreate()method. Using an injected service is preferred I think.The fully-qualified interface name should be used for the
@vardeclaration. See the API documentation standards for Indicating data types in documentation.Comment #8
ravi.shankar commentedWorking on this.
Comment #9
ravi.shankar commentedHere I have added reroll of patch #6.
Comment #10
ravi.shankar commentedHere I have addressed comment #7.
Still needs work for tests.
Comment #11
Kumar Kundan commentedComment #12
Kumar Kundan commentedAddressed test case.
Comment #13
Kumar Kundan commentedComment #14
darchuletajr commentedReviewed and looks good to me.
Comment #15
mayurjadhav commentedPatch looks good for me, I think we can have a patch for 8.9.x as well.
Comment #16
deepak goyal commentedPatch #12 cleanly apply on drupal version 8.8.
Comment #17
andrewmacpherson commented@Deepak Goyal - remember to explain what your patch does. How does it differ from patch #12?
Comment #18
deepak goyal commented@andrewmacpherson There is no difference with patch #12, But I applied same patch on version 8.8 and its working.
Comment #19
andrewmacpherson commentedAha, thanks. A good way to check if a patch works for multiple branches is to use the "add/retest" links next to the patch ( I've just done next to #18, so we'll see result for 8.8 and 9.1). There's no need to repost the same patch.
Comment #21
penyaskitoThanks for the patch!
This should be
$site_name = $this->config('system.site')->get('name');We might be OK hardcoding this tho, and just doing
$this->assertSession()->pageTextContains('Subscribe to Drupal');Comment #23
vakulrai commentedRerolled patch for 9.3.x and updated tests as per #21.
Thanks.
Comment #24
marcoscanoReviewed the code and it looks 👍 from my point of view. There is a nitpicky missing dot at the end of the inline comment in the test, but I'll hope committers will be willing to fix that on commit :)
Comment #25
marcoscanoOps, I take it back.
Missing dot at the end of line.
Now that we are hardcoding the expected string, this line is no longer needed.
Comment #26
dhirendra.mishra commentedLet me work on this.
Comment #27
dhirendra.mishra commentedPatch from #23 does not apply for me on 9.3.x
Comment #28
meenakshi_j commentedRerolled patch #23 and updated tests as per #25.
Comment #29
marcoscano👍 Looks good!
Comment #31
catchCommitted/pushed to 9.3.x, thanks!
Since this includes a constructor change, while it's allowable in 9.2.x, think we can probably wait for 9.3 with this one.