Problem/Motivation
Follow-up to #3048848-18: Syndicate block outputs wrong feed URL
frontpage view could change URL for RSS feed but \Drupal\node\Plugin\Block\SyndicateBlock expects that URL always rss.xml
Steps to reproduce
See build() method https://git.drupalcode.org/project/drupal/-/blob/9.0.x/core/modules/node...
Proposed resolution
1) add check the view exists and retrieve feed URL from the view
2) not rendering the block when view missing
3) discuss to add setting for URL
Remaining tasks
agree on implementation
patch/commit
User interface changes
TBD
API changes
no
Data model changes
no
Release notes snippet
no
Issue fork drupal-3174990
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:
- 3174990-test-that-syndicateblock
changes, plain diff MR !11547
Comments
Comment #5
joachim commented> 2) not rendering the block when view missing
I think the admin user should be warned that they have a block that does nothing!
Possibly:
- Don't show the block as available to add if the 'internal:/rss.xml' path does not exist
- When adding the block, make the block config dependent on whichever view currently supplies the internal:/rss.xml path
Comment #11
acbramley commentedSo we can do something like this (in MR) to use the views URL directly so changing the path won't break the block, but this block has several other issues which I'm not even sure if it's worth fixing (does anyone use this block??)
1. Has a block_count config which does nothing. This will need an update path to remove the config, etc.
2. Config dependencies - the block should depend on the view
3. Access controls - The block shouldn't render if the view or display doesn't exist - what happens if someone renames the display from feed_1? Should we just hide the block in those cases?
4. Cacheability - the block render cache needs to depend on the views config.
Comment #12
acbramley commentedLet's deprecate the whole thing #3518990: Deprecate SyndicateBlock