Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Split off from #3219958: [META] Make Olivero the default theme.
Note that we hope to have this completed in Drupal 9.4. There will be work on this as discover which tests are dependent on Bartik.
Remaining tasks
None at this time.
Comment | File | Size | Author |
---|---|---|---|
#95 | interdiff.txt | 611 bytes | eojthebrave |
#95 | 3219959-95-d10.patch | 30.93 KB | eojthebrave |
#94 | interdiff.txt | 4.43 KB | eojthebrave |
#94 | 3219959-94-d10.patch | 30.96 KB | eojthebrave |
#93 | interdiff.txt | 974 bytes | eojthebrave |
Issue fork drupal-3219959
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
Gábor HojtsyLet's get rolling. Updated the standard profile dependency as well as the block configs. I have no idea if this is the right placement of the right blocks though. I did change
footer_fifth
andsidebar_first
tofooter_bottom
andsidebar
respectively.I did not find any other profile that depends on bartik.
Comment #4
Gábor HojtsyNow this exposes some tests that depend on Bartik :D It has an interesting database fail that is hopefully random, and then a bunch of fails about cache tags (which depend on what data the theme pulls for the page, so sounds related) and the lack of contact link results in multiple fails.
IMHO first the block placements need to be verified before we get into fail fixing and I don't think I am the right person for that.
Comment #5
Gábor HojtsySo Olivero actually has its own blocks fine, we can just remove the Bartik ones and not interfere with what Olivero adds anyway. Whether we should move the Olivero ones to Standard is a discussion to itself.
Comment #7
Gábor HojtsyPretty much the same fails. So. those need to be resolved :) I ran out of time for today for this though. Feel free to pick it up!
Comment #8
webchickI tested #5 manually, and you get this. :)
Comment #9
webchickWe seem to be missing the "default" bit somehow. (Note that both Seven and Olivero have the "Set as default" link active)
Comment #10
Gábor HojtsyOh, duh. Let's make it the default too :D As you can tell I did not actually try these yet.
Comment #11
Gábor HojtsyComment #12
webchickLookin' great now! :D
Comment #14
Gábor HojtsyThe fails look logical. Like
as well as fails around comment posting and editing form elements and breadcrumb formatting, etc. specifically for the default theme. These are different with Olivero, so the tests need to be updated either to their Olivero format or to the Stark output (and use the Stark theme).
Comment #15
Gábor Hojtsy1. Done: Updated entity counts in two migration tests. It makes total sense that they would be different since we are now migrating into Olivero.
2. Done: Updated expected welcome text. Can I say again how much more welcoming it is? :)
3. Todo: Poked around in the breadcrumb test, but it does not seem like its trivial. The links exist as expected in
//nav[@class="breadcrumb"]/ol/li/a
. Added a todo.4. Discuss: Footer menu block is not shown in Olivero currently. That had the contact link that is being tested for. Added a todo.
5. Random: LayoutBuilderDisableInteractionsTest looks like a random frontend fail. See #3208791: [random test failure] Random fail in LayoutBuilderDisableInteractionsTest.
6. Discuss: The comment Save link is "Post comment" in Olivero. This does not map exactly well to editing comments, since you are not posting the comment, just saving it. Updated the test for now.
7. No idea: the page cache tag test looks suspicious. Does Olivero try to access data in a template or preprocess before Drupal is even properly installed?
Also unrelatedly found a test that was verifying Bartik does not show up as a backend theme in Standard. That will of course not happen now :D Made it test Olivero to be more realistic.
Let's see what do we get with this.
Comment #17
mherchelThank you so much for working on this!
I don't believe so. I don't see why we would (and tbh, I didn't know that was even possible)
Comment #18
imalabyaPatch doesn't apply anymore, added a re-roll tag
Comment #19
Meenakshi_j CreditAttribution: Meenakshi_j at Srijan | A Material+ Company for Drupal India Association commentedReroll patch #15
Comment #20
geekygnr CreditAttribution: geekygnr at Lullabot commentedThis patch should clear the PageCacheTagsIntegrationTest::testPageCacheTags error
Comment #21
Berdirdoes Olivero provide its own default blocks? I'd argue that it should not and that we should update/change all (that make sense) block configs here instead of removing them.
It's the same with modules. Opinionated config creation should be part of the install profile, so that other install profiles can easily create their own blocks.
This is the same thing. If you want to use olivero in your install profile you likely don't want to have this text or something else.
I see the file even has a @todo to make it part of the default frontpage view, so we could just move it into the default frontpage view... which is part of node.module. So much for that theory :) But doing that in the existing view at least means that any site that already customizes that view and overrides it keeps their existing override.
IMHO doing that is either in scope of this issue or a blocker?
Comment #24
marcoscanoOpened a MR with patch #20
Comment #25
marcoscanoI agree with #21, it's usually painful to deal with unwanted config that is installed by a module/theme. By moving it into the profile, this is easier to manage.
In the MR above I've moved Olivero blocks into the `optional` config install. I also updated a few tests but ran out of time. It seems there is still quite a lot of work to do in tests here.
Comment #27
m4oliveiThe fail from
Drupal\Tests\views\Kernel\Plugin\DisplayPageTest::testEmptyRow
is interesting. The test looks at views markup for a grid view with 5 columns. It looks for columns using an xpath expression (//div[contains(@class, "views-col")]
) using the.views-col
class. Olivero does not use that class for grid items (see the views-view-grid.html.twig template). Furthuremore, Olivero ignores a handful of the views grid settings:We can fix this test by just adding
views-col
alongsideviews-view-grid__item-inner
. Or we could fix the test by changing the xpath expression used to olivero. I've pushed a commit doing the later. Perhaps if more discussion is needed on this point, it could be moved to a follow up.Comment #28
mherchelThanks for working on this @m4olivei!
We don't have any wrappers around either columns or rows within our views grid (so there are no elements to add those CSS classes on to). We had to remove those wrappers to make the grids responsive.
Comment #29
mherchelOpened up followup #3224750: Figure out how to handle views grid in Olivero
Comment #30
mherchelThere are now several of Olivero's Nightwatch tests which are now broken because blocks are not placed correctly. I inserted a
.pause()
, while troubleshooting and see that the the header, primary navigation, secondary navigation (and likely more) regions are all missing their blocks.Comment #31
BerdirI think the blocks have been moved to standard profile and the tests are probably using minimal, then that's expected and consistent with other core themes. So if you expect them to be there then I think we would need to set them up. Or have a test module that does that for example.
Comment #32
mherchelThis makes senses. The tests that I'm referring to are the tests that come with Olivero (which currently pass in HEAD).
I'm assuming the problem is now that the blocks aren't automatically placed when Olivero is installed, we need to place the blocks in the Olivero Install Script or the Olivero Test module
Comment #33
BerdirExactly. We could copy & paste all those blocks also into the module and then it should work as before if you enable that module on minimal. We might want to put them in install/optional though, because if you for some reason enable that test module on standard, which defines the same blocks, then it would fail if they are mandatory config in config/install as it already exists.
Comment #34
mherchelRemoving embedded image accidentally placed in the issue summary.
I also copied the olivero blocks config from the standard profile into the
olivero_tests/config/optional directory
. The Nightwatch tests now pass on my local. I'm excited to see what remains with Drupal CIComment #35
marcoscanoA couple more green to me.
In
\Drupal\FunctionalTests\Installer\StandardInstallerTest::testInstaller()
, there was this code:which didn't make much sense to me, since
standard_install()
isn't really doing what the comment says it's doing?So regardless of who was placing the "contact" link in Bartik/Standard, IMHO we don't need to test that if Olivero doesn't have the same link on the frontpage. I changed the test code to be:
But I'm leaning towards just ripping these lines off, if this test isn't about testing that. Let me know if I'm missing something here.
Comment #36
marcoscanoSorry, @Gábor Hojtsy had already mentioned it in #15.4:
IMHO, the answer to this question:
/* @todo Footer menu block with contact link is not exposed in Olivero. Should it?
is no. We can assert the footer is there by checking the "Powered by Drupal" string, doesn't it achieve the same goal?
Also, regarding #15.6:
I'm attempting in the last commit an approach where we can minimize the disruption to how
CommentTestBase::postComment()
works, by adding an extra optional parameter to receive the submit button label. My reasoning is that this allows us to touch less code in this patch, which is always good.There seems to be extra mismatches in
CommentPreviewTest::testCommentEditPreviewSave()
, notably around date formats, but I've run out of time for today.Comment #37
marcoscanoJust clarifying my previous comment... I'm not saying we shouldn't be having the discussion "Save" vs "Post comment" in Olivero comment edit forms, but I believe it would be better if we could fix the tests here with what Olivero has now, and then open a follow-up to discuss if those forms should have one or the other label for the submit button.
Comment #38
geekygnr CreditAttribution: geekygnr at Lullabot commentedThe test failure for Cache.Drupal\Tests\page_cache\Functional\PageCacheTagsIntegrationTest is an odd one.
I already cleared up most of it in #20
There is one issue that when I was first testing I thought was an artifact of something on my local. The test creates two nodes. A block is also created that is set to only show up on the second nodes page.
The the cache tags of the first node are inspected. The cache tags seem to indicate that it is looking at the front page (cache tags like url.path.is_front appear). I haven't been able to trace down why this is happening yet.
Comment #39
Berdir> The cache tags seem to indicate that it is looking at the front page (cache tags like url.path.is_front appear)
That's a cache context, not a path. Can't check the test right now, but could be block visibility conditions to show or not show on ?
Comment #40
marcoscano🎉 Green!
We can finally start discussing / reviewing this.
Comment #41
vikashsoni CreditAttribution: vikashsoni as a volunteer and at Zyxware Technologies commentedPatch is not applying showing error for ref sharing screenshot ...
Comment #42
bnjmnmRe #41 @vikashsoni, the issue switched from using patches to a issue fork in #23, so the patch is no longer relevant. (If you are applying patches in an issue, it's only the most recent patch you need to apply - your screenshot shows an attempt to apply patch #19 when theres a newer one in #20, they are not cumulative. Just add the most recent)
But in this case, this issue switched from patch to an issue fork several weeks ago, and the automated tests show it "applies" fine. If you want to apply the merge request as a patch, take the merge request URL and add ".patch". For example, the "patch" for this issue would be https://git.drupalcode.org/project/drupal/-/merge_requests/938.patch
To learn more about issue forks and merge requests see https://www.drupal.org/docs/develop/git/using-git-to-contribute-to-drupa... - it is much easier than patches in my opinion.
Comment #44
marcoscanoThanks everyone for reviewing! I haven't had time to look at the feedback, if others have time feel free to do so.
For the time being, I'm pointing the MR to 10.0.x. A rebase / reroll is probably a good next step, setting it to NW for that and to address the review feedback above.
Comment #45
mherchelI've been trying to rebase this, and have even tried pulling in the patch and applying it to 9.4.x (it doesn't apply). There are a number of conflicts with the various test files, that would probably take me a lot more effort than it would a backend dev.
So, if there are any backend devs willing to get this code running in D10, and get the tests back to passing, I'd really appreciate it!
Comment #46
Gábor HojtsyI spent an hour trying to resolve the conflicts in the rebase then got into some circular conflicts. So I decided to push a new branch here. Will see if I can get back to applying the patch and resolving it that way on top of current 10.x tomorrow. If someone has time in the meantime feel free to take it :)
Comment #48
tstoecklerI went ahead and merged the 10.0.x branch into the feature branch that was more manageable than doing an actual rebase. Hope that's alright in terms of history etc. Of course this can be reverted, if that approach was not correct. But the resulting diff looks fairly good to me, although I haven't been involved in this issue very much.
Comment #49
mherchelWow. Thank you @tstoeckler and @Gábor Hojtsy!
Comment #50
tstoecklerNo worries, @mherchel, glad I could help. Will try to find some time to address some of the open discussions on the merge request - #3257407: Use "content" region in BlockCreationTrait::placeBlock() instead of "sidebar_first" is a first stab at that. Would really love to see this land!
Comment #51
catchThere are a lot of test changes in here which are swapping Bartik for Olivero. I think we should split those out to their own issue since they aren't directly coupled to making Olivero the default theme in Standard. Then it'll be a smaller MR to review here. Makes sense to do #3257407: Use "content" region in BlockCreationTrait::placeBlock() instead of "sidebar_first" in its own issue too, following that one now.
If there are a tests of the standard profile itself, then obviously fine to update those here as necessary.
Comment #52
mherchelOpened up #3260592: Change Bartik-specific tests to Olivero (or appropriate alternative) in preparation for making Olivero the default to do this task.
Comment #53
Gábor HojtsyLanded #3257407: Use "content" region in BlockCreationTrait::placeBlock() instead of "sidebar_first" (thanks @tstoeckler and @catch!) which changes what is exactly required of the tests a bit. But now that should be moved to #3260592: Change Bartik-specific tests to Olivero (or appropriate alternative) in preparation for making Olivero the default either way.
Comment #54
tstoecklerOpened some more issues to further unblock this:
Other than that will see if I can find some time to help out with #3260592: Change Bartik-specific tests to Olivero (or appropriate alternative) in preparation for making Olivero the default, now that I have the other test-related stuff out of the way.
Comment #55
tstoecklerOpened one more issue for a little thing that I found when grepping the codebase that also doesn't block this but also doesn't fit into #3260592: Change Bartik-specific tests to Olivero (or appropriate alternative) in preparation for making Olivero the default: #3262674: Use Claro instead of Bartik as fallback maintenance theme
Comment #56
xjm@vikashsoni, Posting screenshots of your codebase or command-line interface does not advance the issue, since the automated testing infrastructure tells us whether the change set still applies correctly.
So, I've removed the issue credit for that screenshot. In the future, you can get credit for issues by reading the issue to understand its purpose, and posting your review or testing of that purpose. Thank you!
See the issue credit guidelines for more information.
I'm also hiding the patch files from the IS for clarity.
Comment #57
catchWith #3259931: Change default comment save button label to "Post comment" / "Reply to comment" and remove respective Olivero override my preference in terms of getting things done, would be to remove the override (and required test changes) from Olivero/this issue, and handle that issue in its own right, then we don't have complicated dependencies between the two. However this might need yet-another-issue to make that change in Olivero.
I have put a rough patch on #3260592: Change Bartik-specific tests to Olivero (or appropriate alternative) in preparation for making Olivero the default.
Comment #58
catchOpened #3276615: Remove olivero_form_comment_form_alter() comment button label override with a patch.
Comment #59
catchI went through #3260592: Change Bartik-specific tests to Olivero (or appropriate alternative) in preparation for making Olivero the default and basically all the changes that originally should have been there are no-longer relevant except potentially one one-liner, because they already got updated in #3259928: Change various tests that test with "all themes" to also include Olivero. So... I've marked that as duplicate.
Opened #3276618: Olivero sets inconsistent classes for active trail between menu and book for one other hunk that seems wrong rather than an issue with switching from Bartik to Olivero.
I think what we probably need here is a new patch with #3276615: Remove olivero_form_comment_form_alter() comment button label override included and most of the test changes removed to see what's actually necessary now.
Comment #60
catchOpened another issue but one got committed in the meantime, so still PP-2.
Tagging as needs re-roll, would be good to see what the MR looks like now various issues have landed, and the two that are split-off are relatively small ones.
Comment #61
catchHad a look at rebasing this, but there are dozens of conflicts, so at least for now converting back to a patch to get an idea what's here. This was a quick re-roll and doesn't include the two blocking issues, so will definitely fail but question of how much.
Comment #62
catchOK several new migration tests for to-be-removed modules, looking at those first.
Comment #63
SpokjeFixing bartik => olivero related test failures in
\Drupal\Tests\page_cache\Functional\PageCacheTagsIntegrationTest
I'm a bit unsure if this should be done in a sub-issue or in here, but since there's no way of testing this without the base-switch-theme-in-standard-profile patch in here, I'll add it in here for now.
Also opening a few follow-ups for some "interesting" but not directly related stuff I've stumbled over whilst working on that test.
Comment #64
SpokjeOpened #3276839: Remove leftover dumpHeaders property and, much more important IMHO #3276842: Asserting arrays are equal fails for the wrong reason which baffles me.
Comment #65
Gábor Hojtsy#3276620: Change NoJavaScriptAnonymousTest to use stark theme landed. So #3276618: Olivero sets inconsistent classes for active trail between menu and book remains.
Comment #66
catchComment #67
Gábor HojtsyRerolled. It was not applying due to Claro becoming the default admin theme.
Comment #68
ckrinaThe patch applies fine, but when I try to install from scratch I get the following error:
Comment #69
Gábor HojtsyI rerolled the patch wrong... This should be much better.
Comment #70
Gábor Hojtsy#3276618: Olivero sets inconsistent classes for active trail between menu and book landed too. No issues remaining at this time that this would be postponed.
Comment #71
ckrinaThe manual test of the patch worked!
Comment #72
ckrinaComment #74
Gábor HojtsyOf the four fails, this one is easy, because it loads the bartik block. Will wait for @eojthebrave to post his fixes to comments though :D
Comment #75
eojthebraveThis patch should fix the failure @Gábor Hojtsy mentions in #74, and the CommentPreviewTest failures. 🤞
The CommentPreviewTest test failures are caused by the fact that they are checking for specific markup that is changed by the Olivero theme.
Comment #76
Gábor HojtsyComment #77
eojthebraveNotes to future me, or whoever works on this next. There is a
BreadcrumbTest
failure at line 293. The call there to$this->assertBreadcrumb($link_path, $trail, $term->getName(), $tree);
is the only call to the method that uses$tree
param in this test. That triggers a call to\Drupal\Tests\system\Functional\Menu\AssertMenuActiveTrailTrait::assertMenuActiveTrail
- and it seems like the failure is occuring in there. Because the breadcrumb trail doesn't have any classes indicating it's part of the active trail. I think ...Also this line "
':menu' => 'block-bartik-tools',
" just below that test. Line 302. Is likely going to cause issues too.In case this is useful for helping others debug the remaining test failures.
Comment #79
Amber Himes MatzRe #77, as far as I can tell, Olivero only sets
menu__item--active-trail
menu items, not breadcrumb trails. (Compare core/themes/olivero/templates/navigation/menu.html.twig, line 52 with core/themes/olivero/templates/navigation/breadcrumb.html.twig, line 18.)\Drupal\Tests\system\Functional\Menu\AssertMenuActiveTrailTrait::assertMenuActiveTrail
expects this class from Olivero in line 39, if I'm reading that right.Changing line 293 in BreadCrumbTest.php (core/modules/system/tests/src/Functional/Menu/BreadcrumbTest.php) to:
(which removes the optional call to
$tree
)And running the test (
Drupal\Tests\system\Functional\Menu\BreadcrumbTest
again, it still fails with this message:Don't have any more time to look at this this evening, but thought I would share what I discovered. (Basically verifying what @eojthebrave noted in #77.)
Comment #80
larowlanAdded #3277592: Make MenuBreadCrumbTest work without standard profile to clean this test up some more
Comment #81
larowlanThis fixes the breadcrumb test, not sure if the quickedit one is a random 🤞
Comment #83
SpokjeAfter running the test again, and never seen this specific JS test failure before in the (too long) list of semi-random ones, I'm pretty sure it isn't a random fail, but actually related to this change.
Comment #84
larowlanThe test fail normally indicates something is obscuring the element that it needs to click on
Comment #85
SpokjeIt sure is...a little... (Screenshot from a previous run)
Let's see if we can click the link in the Block instead of the whole Block which seems to have a liking of clicking in the 0.10% of the Block that's obstructed from view.
In other words: A more specific place to click would make clicking in the wrong place less unlikely
Comment #86
SpokjeComment #87
SpokjeRight....
I _think_ there's something wrong with the swapping of blocks for bartik/olivero. Because when I look at the screenshots for the failing test above, the page (/node/1) seems _very_ wrong, with no page title and the powered_by block on top instead of below.
Since I'm definitely _not_ the man to do Front End stuff, I'll happily leave that in more capable hands.
Comment #88
lauriiiTests passed for Drupal 9.4.x for #81
Comment #89
lauriiiComment #90
ckrinaManual installation works for me, both for 10.0.x and 9.4.x. So moving to RTBC 🎉
Comment #91
catchThe ckeditor failures appear to be new, but not related to this issue - HEAD is failing, and I reopened #3276974: [drupalMedia] Media View Modes don't work if alignment not enabled.
Comment #92
lauriiiComment #93
eojthebraveHere's an updated version of the patch from #81 for D9. This hardens the SettingsTrayTest that was randomly failing. It seems like without the blocks on the page it's a little faster and the test sometimes fails because the element hasn't been removed yet. So this will wait a little to give it time for the element to be removed.
Comment #94
eojthebraveAnd here's a version of the patch for Drupal 10. This includes the same fix for the settings tray tests from #93. And it moves all the Olivero block configuration from the standard profile into the olivero theme. There are a bunch of Nightwatch tests for Olivero that will only work if these blocks are present when the tests run.
Comment #95
eojthebraveComment #97
lauriiiSaving credits
Comment #99
lauriiiCommitted 0bd4c9f and pushed to 9.4.x. Thanks!
Committed live from the DrupalCon Portland 2022 Trivia Night!
Comment #101
lauriii🥳 🥳 🥳
Comment #102
xjmTagging for the release notes too since this is a change for new site installation.