Closed (fixed)
Project:
Drupal core
Version:
10.1.x-dev
Component:
Claro theme
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
31 Mar 2020 at 02:10 UTC
Updated:
17 Mar 2023 at 08:54 UTC
Jump to comment: Most recent, Most recent file


Comments
Comment #2
dpiComment #3
dpiComment #4
acbramley commentedNice work, code looks good to me! I think we could add a test for this by adding a preprocess hook to a test module?
Comment #6
hardik_patel_12 commentedRe-rolling patch against 9.1.x-dev. Kindly review a patch.
Comment #7
akshay kashyap commentedI have tested #6 patch it's working fine for me I have attached the screenshot for reference
Comment #9
djsagar commentedThis issue no longer reproducible in 9.2.x-dev.
Attaching the before patch screenshot for reference.
Comment #11
kim.pepperComment #12
vikashsoni commentedApplied patch #6 applied successfully
for ref sharing screenshot.....
Comment #13
vikashsoni commentedComment #15
kristen polThanks @vikashsoni but I don't understand what you tested because your before and after screenshots have the same classes. You have to add code to be able to test this properly. See #4 for guidance.
Please add testing steps when testing and ideally embed the screenshots within the comment so it's easier to see the screenshots. If you install the dreditor browser extension, then you'll see an "Embed" button next to each file.
Note that the testing in #7 and #9 also were not done correctly.
I checked and the patch applies cleanly on 9.3, 9.4, and 10 and should be tested on all 3, so tagging. The formatting of the issue summary isn't using the template so could be cleaned up as well.
Comment #16
kristen polAlso compared the changes with the other core themes and it's the same approach though Claro is the only one adding additional classes. One other difference is that
claro/templates/views/views-mini-pager.html.twigisn't patched and handles the classes differently.Comment #17
kristen polFixing title.
PSA: You have to add code to be able to test this properly. See #4 for guidance.
Comment #18
joshua1234511Tested the Patch provided in #6


Works Correctly on v9.3.0 v9.4.0
Steps Followed
- Install fresh Drupal setup
- Enable Carlo theme
- Create a view with pager enabled
- Added a template_preprocess_pager hook and added a test class
- Inspect the html code the preprocessed class won't be added.
- Applied the patch
- Cleared cache
- The class is added to the links.
Before Patch
After Patch
Updated the issue summary with steps to reproduce
Comment #19
kristen polThanks @joshua1234511. This looks good! The issue summary could use a bit more of an update but otherwise this looks RTBC.
Comment #20
kristen polUpdated the issue summary and moving to RTBC based on the above.
Comment #21
quietone commentedThis is testing against 9.1.x and failing. Let's get this on 10.0.x.
The patch still applies so I am re-uploading and testing it.
Comment #22
duaelfrPatch in #6 and #21 are not complete.
Classes are added to all pager links except next page and last page ones.
Here is a fixed patch.
Comment #23
joshua1234511Tested the patch from #22
Against v9.4.0 and v10.0.x
- Enable Carlo theme
- Created a view with pager enabled
- Added a template_preprocess_pager hook and added a test class
- Inspect the html code the preprocessed class won't be added.
- Applied the patch
- Cleared cache
- The class is added to the links.
Based of above manual testing marking this asRTBC
Comment #24
larowlanI agree with @acbramley in #4, I think we can add an automated test here.
We already have
pager_test_preprocess_pager, and that is adding custom attributes as well as a route for testing a pager.So it should be a matter of adding 'pager_test' module to ClaroTest and adding a new test method that hits that route and asserts the attribute is output.
See
\Drupal\Tests\system\Functional\Pager\PagerTestfor reference code that is testing the stark theme.Comment #25
smustgrave commentedTook a crack at the test cases
Comment #26
smustgrave commentedEmpty space
Comment #27
smustgrave commentedComment #28
larowlanpager_test module provides a route with a pager, so you shouldn't need dblog or to insert error messages to test it
We're not testing for what was causing the issue here, that attributes wasn't being used.
The pager test module adds an attribute to the pager via preprocess, that's all we need to test is output with claro
Comment #29
larowlan@smustgrave pointed out on slack that I'm wrong about the above, the test controller etc and pager test all rely on dblog and seeding log entries.
So ignore item 1 above
Comment #30
smustgrave commentedComment #31
larowlanThanks, can we get a test-only version of the patch too (to show that the new test coverage catches the bug)
Comment #32
smustgrave commentedAlso going to rerun the tests on #30 for 10.0.x and 9.5.x
Comment #33
smustgrave commentedLooking more closely at it I think the patch in #22 is all we need https://www.drupal.org/files/issues/2022-06-09/3123666-22.patch. Classes were printed out but the templates weren't done in best practices so not sure a test is needed.
Comment #34
larowlanThis should be red/green
The significant element here is a custom class I think
Comment #36
smustgrave commentedReviewed and looks good
Comment #37
larowlanLet's see if we can get an independent RTBC here given we've worked on a lot of the new changes, I'll ask in #bugsmash
Comment #38
acbramley commentedNit: Is it better to use
hasClass()here?Otherwise looks great.
Comment #39
larowlanI didn't know that existed, so yes definitely better.
Comment #40
larowlanFor #38
Comment #41
arunkumarkAs per comment #38, the patch has been re-rolled
Comment #43
arunkumarkThe patch has been re-rolled.
Comment #44
smustgrave commentedGoing to mark reviewed since it was a small patch. @arunkumark next time can you please upload an interdiff so we can see the changes. Without it someone has to compare line by line.
Comment #45
quietone commented@arunkumark, yes, always add a diff or interdiff. Otherwise you are leaving it up to reviewers or a committer to do that work.
@smustgrave, did you review the patch in #43? I suspect you did but you have only commented on the size of the patch.
Comment #46
smustgrave commentedI did. Appears to be similar to #34 but with hasClass added per #38
Comment #48
smustgrave commentedseems to be a random unrelated failure
Comment #50
acbramley commentedRerolled against 10.1.x
Comment #51
smustgrave commentedMoving back to RTBC
Comment #53
acbramley commentedUnrelated random failure.
Comment #55
lauriiiCommitted 108a6ef and pushed to 10.1.x. Thanks!