Closed (fixed)
Project:
Drupal core
Version:
9.2.x-dev
Component:
node system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Apr 2019 at 14:51 UTC
Updated:
5 Jul 2021 at 20:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
chi commentedAlso
SyndicateBlock::defaultConfiguration()method seems unused.Comment #3
andypostComment #4
andypostComment #5
anantjain60 commentedComment #6
johnwebdev commentedI was just to upload a test for this, but I missed the Novice tag, so this is a great exercise for someone who wants to learn about writing tests for Drupal!
For those interesting in how we can add a test for this, there is an existing test at core/modules/node/tests/src/Functional/NodeSyndicateBlockTest.php.
Within that test we have a
method.
which already adds the block and asserts that it exists, so the things left do is:
At this point we would have a failing test without the patch from #5 applied. Apply that patch and run the test again. It should pass. Now upload only the test as a patch, and then the test with the patch from #5 so we prove that the test fixes the issue in the first place.
Ping @johndevman on Slack, if you need some assistance :)
Comment #7
johnwebdev commentedNeeds work for test by the way!
Comment #8
jmikii commentedAdded the test for checking Subscribe to link and that the url is correct.
Comment #10
jmikii commentedPatch #5 with test #8
Comment #11
andypostPatches goes to 8.8 first
Comment #13
jmikii commentedI have modified the Url to base:uri instead of internal:uri to include /subdirectory/ in case it exists in the url configuration.
Comment #14
jmikii commentedVersion update
Comment #15
jmikii commentedFound that the /subdirectory/ problem is solved when assertUrl receives Url object.
Comment #17
andypostComment #18
alexpottThis block is really odd. I think we need a follow-up to address the fact that the rss.xml comes from a view so this block only works when views and node is installed and the views.view.frontpage exists. I think the block should be provided by the view and we should deprecate
SyndicateBlock. Or we need to do the work to provide an fallback for rss.xml in the Node module.That said this fix is a valid fix for the problem at hand.
This should be something like
Tests the syndicate block RSS link.I think rather then requesting
''we should be explicit about requesting a page likeuser. Yes it is the same result BUT this bug is about the syndicate block not working on pages other than the frontpage.I think this can be
$this->assertSession()->addressEquals('rss.xml');- I don't think we need to generate a Url object for this and we can use the non legacy methods.Comment #19
chi commentedGiven that the block was broken for many years I think no one uses it.
Comment #20
chi commentedJust out of curiosity, is it proper to use
t()function in tests?Comment #21
alexpott@Chi nope we shouldn't be using t() in tests - nice spot.
Comment #22
rosinegrean commentedComment #23
carletexAttaching a new patch (and an interdiff) with the changes that @alexpott suggested, plus fixing some CS.
I also agree that it makes more sense for this block to by provided by views.view.frontpage.
Comment #24
carletexSorry, wrong paths in the patches. Trying again.
Comment #25
andypostnot sure it will work for CI tests - they running in subdir for that purpose - "checkout/" iirc
Comment #26
carletexIs there a way to check if it works on CI tests?
Comment #27
andypostBut it works)
Comment #30
chi commentedComment #31
chi commentedThe comment 'Place "the Syndicate" block.' seems redundant as the following code is quite readable. Also I would take out a new line at the end of the function.
Comment #32
mrinalini9 commentedRerolled patch #24 for 9.1.x and also addressed comment from #31, please review.
Comment #33
himanshu_sindhwani commentedPoint 2 from #31 was not addressed therefore fixed the same from #32
Comment #34
rachel_norfolkJust come across this due to adding the block as per the new Olivero theme beta, which uses the block.
Probably worth noting that "Given that the block was broken for many years I think no one uses it." in #19 won't be true for long!
Comment #35
rachel_norfolkOkay, I'm testing the patch by actually running it on https://rachelnorfolk.me and it works really well - no matter the current path, now the main site RSS feed in the syndication block remains correct. It works!
The test seem reasonable and they pass.
I see no code issues reported in the code related to this change.
I say RTBC.
Comment #36
quietone commentedReviewing RTBC issues as part of Bug Smash Initiative.
This looks good, just a few things to tidy up.
I read the issue summary and it explains the problem but there is no solution listed. Adding tag for IS update.
On reading the issue there is a request for a followup in #18 that sill needs to be done. The other changes to the patch have all been made. I didn't spot any other unfinished work. Yay!
There is a 'needs reroll' tag on the issue but that seems to have been done. Please remember to update tags as work is completed.
Next I looked at the patch and found a line > 80 chars.
Line > 80 characters.
Comment #37
andypostFix #36 and optimize test suite, updated IS, filed follow-up #3174990: Test that SyndicateBlock works when views disabled
Any reason for separate assertion? it just one more install and slowdown of whole suite
Comment #40
sulfikar_s commentedHello, the previous patch failed to apply to 9.2.x-dev. See below,
I've re-rolled the patch in #37
Please review.
Comment #42
guilhermevp commentedPatch still applies in 9.3.x, and works as intended.
Before patch I was able to reproduce the error:
After patch, the error is gone. Tests are more efficient now and test-only patch fails. So, I'm moving to RTBC.
Comment #43
larowlanUpdating issue credits
Comment #45
larowlanCommitted acb621d and pushed to 9.3.x. Thanks!