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.
(First, verify that the preprocess changes have been made. #2322163: [meta] Consensus Banana Phase 1, move CSS classes from preprocess to twig templates.)
- Copy the Twig templates from the core module's templates directory to Classy's templates directory. Include all templates, even ones without classes.
- Remove all classes from the core module's template. Remove all classes added with addClass and ones that are hard-coded in the template.
- If there are classes that are required for basic functionality, discuss whether they should be kept.
- If there is CSS from the module, or anywhere else, referring to the class, discuss removing it or moving it to Bartik&Seven. Do not move the CSS to Classy.
Twig Templates to Copy
core/modules/simpletest/templates/simpletest-result-summary.html.twig
Comment | File | Size | Author |
---|---|---|---|
#15 | copy_simpletest-2349745-15.patch | 325 bytes | bradwade |
#13 | copy_simpletest-2349745-13.patch | 959 bytes | bradwade |
#12 | Screenshot 2014-11-19 17.06.26.png | 81.03 KB | bradwade |
#1 | copy_simpletest-2349745-1.patch | 837 bytes | mortendk |
Comments
Comment #1
mortendk CreditAttribution: mortendk commentedmoved & removed classes
Comment #2
mortendk CreditAttribution: mortendk commentedComment #3
Xen CreditAttribution: Xen commentedComment #4
Xen CreditAttribution: Xen commentedWorks. The classy template file is picked up as it should.
Comment #5
alexpottSo the module provides css for simpletest-fail and simpletest-pass and this has now moved to the classy template. I'm not sure that moving this template makes a whole lot of sense since I really don't believe this is the type of css themers really want to remove or override.
Comment #6
mortendk CreditAttribution: mortendk commented@alex i hear what your saying - But it would be inlogical to have templates thats not in the classy theme
A usecase for theming simpletest is when you build an admin theme, so it should be placed inside of classy
so yup themers want this :)
Comment #7
alexpottI'm not sure I buy the "illogical argument" - why is that so?
Comment #8
alexpottAlso test running is something I do using stark all the time. And leaving the template in simpletest does not stop an admin theme from customising (but I'd bet at least 1 pence that no admin theme has ever wanted to remove the simpletest-pass and simpletest-fail classes.
Comment #9
mortendk CreditAttribution: mortendk commentedsimpletest have class'es - we wanna make drupal core free off all the classes & they should live inside of classy - not in the module.
The reason that everything should be in classy is that we want the themer to get a complete overview of the whole system.
does that make sense ?
Comment #10
alexpottI'm not sure I buy that for simpletest or views ui for that matter.
Comment #11
mortendk CreditAttribution: mortendk commentedwell the question is why do we wanna have classes down in core - when classes should be defined in the classy theme.
but its minor elements that isnt essential for classy's epic succes ;)
Comment #12
bradwade CreditAttribution: bradwade commentedI'm too verbose below :) So here is a summary of my comment.
1. This template, that would be moved to Classy in this patch, only wraps the *summary* of the simpletest results with a class (i.e. simpletest-pass/-fail/-debug). The table below that summary, which lists out each test, still has the same classes on the tr. The table tr class is added by simpletest module in core/modules/simpletest/src/Form/SimpletestResultsForm.php currently around line 178.
So we aren't really gaining much by moving one instance of adding the class to the theme layer and leaving the other in the module.
2. Trying to make everybody happy... we could still strip classes from core AND continue to pass on this relevant data information by putting it into a data-attribute on the element, changing the above to:
And this in the simpletest twig file:
3. However I think the most expedient route and acceptable (to me at least) would be to simply leave the class in core (as per @alexpott's point). AND for thoroughness and consistency of the the Classy project, duplicate the template to Classy.
I'll have a patch to that effect shortly.
Comment #13
bradwade CreditAttribution: bradwade commentedLeft class in core twig file per @alexpott AND copied twig file to Classy theme.
Comment #14
davidhernandezBrad, check your git settings. See the section here on renaming, https://www.drupal.org/documentation/git/configure . If you copy the file, without changes, it should just give you a small diff without the file contents.
Comment #15
bradwade CreditAttribution: bradwade commentedThanks @davidhernandez. Trying again... leaving the class in core template and simply copying template to Classy.
Comment #16
LewisNymanI spoke to David on IRC. It seems like this patch does everything needed for this issue.
Comment #17
alexpottI still think we should grant an exception to the no classes in core aim for simpletest. Why do we want to make running tests in stark painful?
Comment #18
alexpottLol... should have looked at the patch - we're not removing the classes anymore - so I wonder why we're putting this in classy. It does not seem relevant.
Comment #19
webchickIt looks like alexpott and I are raising similar concerns in a couple different issues. Let's postpone this on an updated issue summary + buy-in from core maintainers at #2349759: Copy system templates to Classy.
Comment #20
mortendk CreditAttribution: mortendk commentedSo i might could accept not moving This one template to classy, but thats it.
We cant have a template system that again is inconsistent all over
What were gonna do when all the templates are moved over, is putting them all in folders, so its easy to find, one of these folders would be "backend stuff" (or what we call em)
But i generally dissagrees everything must be moved to classy, lets not shake on the hand, just give us themers all em templates once n for all :)
Comment #21
mgiffordComment #36
quietone CreditAttribution: quietone at PreviousNext commentedSimpletest was moved to contrib in Drupal 9.0, https://www.drupal.org/node/3112907.
I am closing this as outdated.