Commit credit: Add mdrummond, davidhernandez

Problem/Motivation

Stable exists but is not yet stable (no snapshot of markup, CSS, etc. yet).

Why this should be an RC target

Before RC we added the Stable theme itself "underneath" themes with no base theme set. We need to copy templates, CSS, and related assets, and add library overrides so that people can start extending from Stable templates rather than core templates, and similar for libraries.

Proposed resolution

Copy templates, CSS and relevant image assets and use libraries-override to make it happen. Potentially add test coverage here or in a separate issue for certain scenarios: https://drive.google.com/open?id=1rHV4L67W5AIYvmBmovY4p87D4aPcJqn9MchKpY...

Making Classy inherit from Stable is separate: #2581443: Make Classy extend from the new Stable base theme but there may be some automated test fallout to deal with depending on what goes in first.

Because this is a large patch, here's what's going on (in order of the changes in the patch):

  1. Automated test for library overrides to ensure completeness
  2. Automated test for template overrides to ensure completeness
  3. Copy all the CSS, changing image paths as necessary
  4. Copy all the images, no changes
  5. Add all the libraries-override needed to stable's .info.yml
  6. Copy all the templates, with appropriate doc changes

Remaining tasks

Add tests to ensure we have all the Twig templates overridden.
Review!

User interface changes

Should be none.

API changes

Should be none.

Data model changes

n/a

CommentFileSizeAuthor
#136 interdiff.txt611 bytesstar-szr
#136 copy_templates_css-2575737-97.patch186.68 KBstar-szr
#98 interdiff.txt730 bytesstar-szr
#98 copy_templates_css-2575737-97.patch187.3 KBstar-szr
#97 interdiff.txt1.4 KBstar-szr
#97 copy_templates_css-2575737-96.patch187.3 KBstar-szr
#94 interdiff.txt1.32 KBstar-szr
#94 copy_templates_css-2575737-94.patch185.9 KBstar-szr
#81 copy_templates_css-2575737-81-libraries-css-images.patch73.65 KBstar-szr
#81 copy_templates_css-2575737-81-full.patch185.6 KBstar-szr
#72 copy_templates_css-2575737-72-libraries-css-images.patch73.64 KBstar-szr
#72 copy_templates_css-2575737-72-templates.patch111.94 KBstar-szr
#72 copy_templates_css-2575737-72-full.patch185.58 KBstar-szr
#69 interdiff.txt3.02 KBstar-szr
#69 copy_templates_css-2575737-69.patch185.58 KBstar-szr
#67 interdiff.txt7.9 KBstar-szr
#67 copy_templates_css-2575737-67.patch183.78 KBstar-szr
#62 interdiff.txt716 bytesstar-szr
#62 copy_templates_css-2575737-62.patch183.46 KBstar-szr
#61 interdiff.txt5.25 KBstar-szr
#61 copy_templates_css-2575737-61.patch183.45 KBstar-szr
#61 copy_templates_css-2575737-61-morefails.patch182.61 KBstar-szr
#57 interdiff.txt451 bytesstar-szr
#57 copy_templates_and-2575737-56.patch179.48 KBstar-szr
#55 interdiff.txt38.44 KBstar-szr
#55 copy_templates_and-2575737-55.patch179.29 KBstar-szr
#49 interdiff.txt2.47 KBstar-szr
#49 copy_templates_and-2575737-49.patch218.72 KBstar-szr
#47 interdiff.txt1017 bytesstar-szr
#47 copy_templates_and-2575737-47.patch219.7 KBstar-szr
#45 interdiff-docblocks.txt100.38 KBstar-szr
#45 interdiff-images.txt44.34 KBstar-szr
#45 copy_templates_and-2575737-45.patch219.76 KBstar-szr
#35 interdiff.txt1.05 KBstar-szr
#35 copy_templates_and-2575737-35.patch132.51 KBstar-szr
#30 interdiff-miscfix.txt832 bytesstar-szr
#30 copy_templates_and-2575737-30-miscfix.patch132.43 KBstar-szr
#30 interdiff.txt7.04 KBstar-szr
#30 copy_templates_and-2575737-30.patch132.43 KBstar-szr
#29 interdiff.txt5.72 KBstar-szr
#29 copy_templates_and-2575737-29.patch131.34 KBstar-szr
#27 interdiff.txt637 bytesstar-szr
#27 copy_templates_and-2575737-27.patch125.62 KBstar-szr
#22 interdiff.txt25.58 KBstar-szr
#22 copy_templates_and-2575737-22.patch124.99 KBstar-szr
#21 interdiff.txt906 bytesstar-szr
#21 copy_templates_and-2575737-21.patch149.46 KBstar-szr
#20 interdiffstat-twig.txt1.41 KBstar-szr
#20 interdiffstat-js.txt1016 bytesstar-szr
#20 interdiffstat-css.txt796 bytesstar-szr
#20 interdiff.txt42.67 KBstar-szr
#20 copy_templates_and-2575737-20.patch150.34 KBstar-szr
#18 interdiff.txt17.03 KBstar-szr
#18 copy_templates_and-2575737-18.patch179.25 KBstar-szr
#16 copy_templates_and-2575737-16.patch162.22 KBstar-szr
#2 test_different_bc-2575737-2.patch10.92 KBstar-szr

Comments

Cottser created an issue. See original summary.

star-szr’s picture

Status: Active » Needs review
StatusFileSize
new10.92 KB

Status: Needs review » Needs work

The last submitted patch, 2: test_different_bc-2575737-2.patch, failed testing.

joelpittet’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: test_different_bc-2575737-2.patch, failed testing.

star-szr’s picture

Title: Test different BC scenarios with the Stable theme/Classy » Copy templates and assets to Stable
Status: Needs work » Postponed

I think we can soon use this issue to do all the template copying and such.

webchick’s picture

#2575421: Add a Stable base theme to core and make it the default if a base theme is not specified is now in.

However, I believe we'll want to postpone this one until just after RC1 to ensure we get the very latest default markup.

star-szr’s picture

Yeah, we got pretty far on this so I'm hesitant to actually postpone but we certainly wouldn't want to commit anything until RC1. We should be able to check to make sure all our assets are up to date by using git log.

webchick’s picture

Status: Postponed » Active

Ok sure, let's start now. :)

star-szr’s picture

Issue summary: View changes

Thanks @webchick just came to do that :)

Updated the IS. Making Classy inherit from Stable is happening separately at #2581443: Make Classy extend from the new Stable base theme so this issue should only be concerned about Stable itself if at all possible.

davidhernandez’s picture

I'm thinking we should do this in two steps if possible, to make things easier to track and review. Do the assets in one patch and copy the templates in a separate issue?

Since there are so many things to move I'm worried about missing something small.

kevin morse’s picture

Hi, I just installed rc1 to play around with it and got kind of confused by Classy and Stable and why one was missing a screenshot. That led me to this issue.

I gather you're aware that Stable is displaying a "no screenshot" screenshot right now? If so, sorry for the extra post. Thanks for all your hard work!

star-szr’s picture

Hi Kevin, thanks for the keen eye. We are aware and the plan is to hide these core base themes from the UI: #2574975: Allow (base-)themes to be excluded from the UI (e.g. blocks, Appearance).

star-szr’s picture

Working on this today.

star-szr’s picture

Status: Active » Needs review
StatusFileSize
new162.22 KB

Here's a new initial patch but this is based on commit 158d434 and many assets have been updated since then. The next patch will bring things at least more in sync and I'm going to try to come up with an automated way of verifying we have a complete set of assets.

Status: Needs review » Needs work

The last submitted patch, 16: copy_templates_and-2575737-16.patch, failed testing.

star-szr’s picture

Status: Needs work » Needs review
StatusFileSize
new179.25 KB
new17.03 KB

Here's the missing libraries-override bits from stable.info.yml.

Status: Needs review » Needs work

The last submitted patch, 18: copy_templates_and-2575737-18.patch, failed testing.

star-szr’s picture

Status: Needs work » Needs review
StatusFileSize
new150.34 KB
new42.67 KB
new796 bytes
new1016 bytes
new1.41 KB

At one point in #2575421: Add a Stable base theme to core and make it the default if a base theme is not specified I rebased/rerolled on top of commit 0e4c0f3 so that is the reference used here. Not much difference in terms of assets from 158d434, just 2 less JS file changes, it was a reroll for #2576037: "Sorry" in user-facing errors violates the User Interface Standards.

I'm attaching additional three "interdiffstat" files if anyone wants to compare the changes I'm making here with what actually happened in core. The only differences should be for test files and the one Twig template difference noted below.

Twig templates updated based on:

git diff --stat 0e4c0f3 core/modules/*.html.twig
 core/modules/ckeditor/templates/ckeditor-settings-toolbar.html.twig                        |  2 +-
 core/modules/config_translation/templates/config_translation_manage_form_element.html.twig |  4 ++--
 core/modules/statistics/tests/themes/statistics_test_attached/node.html.twig               | 24 ++++++++++++++++++++++++
 core/modules/system/templates/admin-page.html.twig                                         |  3 ++-
 core/modules/system/templates/field-multiple-value-form.html.twig                          |  8 +++++---
 core/modules/system/templates/indentation.html.twig                                        |  6 ------
 core/modules/system/templates/item-list.html.twig                                          |  5 +++--
 core/modules/system/templates/mark.html.twig                                               |  4 ++--
 core/modules/system/templates/page.html.twig                                               |  2 +-
 core/modules/system/templates/pager.html.twig                                              | 12 ++++++------
 core/modules/system/templates/system-modules-details.html.twig                             | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 core/modules/system/templates/system-modules-uninstall.html.twig                           | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 core/modules/update/templates/update-version.html.twig                                     |  6 +++---
 core/modules/views/templates/views-view-field.html.twig                                    |  6 +-----
 14 files changed, 201 insertions(+), 32 deletions(-)

Interdiffstat note: The whitespace operator had already been updated in views-view-field.html.twig, that explains the slight discrepancy there.

CSS updated based on:

git diff --stat 0e4c0f3 core/{misc,modules}/*.css
 core/modules/editor/css/editor.css                           | 16 ----------------
 core/modules/simpletest/css/simpletest.module.css            |  4 ++++
 core/modules/system/css/components/ajax-progress.module.css  |  6 +++++-
 core/modules/system/css/components/item-list.module.css      | 19 +++++++++++++++++++
 core/modules/system/css/components/tabledrag.module.css      |  5 ++++-
 core/modules/system/css/system.admin.css                     | 17 ++++++++++++-----
 core/modules/system/css/system.diff.css                      |  6 +++++-
 core/modules/system/css/system.maintenance.css               |  6 +++++-
 core/modules/system/tests/themes/test_theme/css/collapse.css |  4 ++++
 core/modules/views_ui/css/views_ui.admin.theme.css           |  8 ++++----
 10 files changed, 62 insertions(+), 29 deletions(-)

JS updated based on:

git diff --stat 0e4c0f3 core/{misc,modules}/*.js
 core/misc/drupal.js                                           | 17 -----------------
 core/misc/vertical-tabs.js                                    |  4 +++-
 core/modules/ckeditor/js/ckeditor.js                          |  7 ++++---
 core/modules/ckeditor/js/plugins/drupalimage/plugin.js        | 39 ++++++++++++++++++++++++++++++++-------
 core/modules/ckeditor/js/plugins/drupalimagecaption/plugin.js | 28 ++++++++++++++++++++++++----
 core/modules/ckeditor/js/plugins/drupallink/plugin.js         | 30 ++++++++++++++++++++++++++----
 core/modules/editor/js/editor.formattedTextEditor.js          |  2 +-
 core/modules/quickedit/js/editors/plainTextEditor.js          |  2 +-
 core/modules/quickedit/js/quickedit.js                        |  7 ++++---
 core/modules/system/tests/themes/test_theme/js/collapse.js    |  4 ++++
 core/modules/views_ui/js/views-admin.js                       | 76 +++++++++++++++++++++++++++++++++++-----------------------------------------
 11 files changed, 134 insertions(+), 82 deletions(-)

Libraries and library overrides updated based on:

git diff --stat 0e4c0f3 core/core.libraries.yml core/modules/*.libraries.yml
 core/core.libraries.yml                                                                                |  5 +++--
 core/modules/ckeditor/ckeditor.libraries.yml                                                           |  2 ++
 core/modules/system/system.libraries.yml                                                               |  1 +
 core/modules/system/tests/themes/test_basetheme/test_basetheme.libraries.yml                           |  1 +
 core/modules/system/tests/themes/test_subtheme/test_subtheme.libraries.yml                             |  1 +
 core/modules/system/tests/themes/test_theme/test_theme.libraries.yml                                   |  8 ++++++++
 core/modules/system/tests/themes/test_theme_libraries_extend/test_theme_libraries_extend.libraries.yml | 11 +++++++++++
 core/modules/views_ui/views_ui.libraries.yml                                                           |  1 +
 8 files changed, 28 insertions(+), 2 deletions(-)

Only system.libraries.yml needed to be updated for the addition of item-list.module.css.

Also, I removed the file.theme.css library and override because the CSS file isn't there. A separate issue was created earlier to deal with it: https://www.drupal.org/node/2580049


Next up, some forms of automatic verification, and probably looking into the testbot fails.

star-szr’s picture

StatusFileSize
new149.46 KB
new906 bytes

Reverting some changes for #2581443: Make Classy extend from the new Stable base theme to deal with.

star-szr’s picture

StatusFileSize
new124.99 KB
new25.58 KB

And I think stable.libraries.yml is not needed at all with the approach we are taking but instead I need to pay more attention to the overrides!

star-szr’s picture

Wondering out loud whether we should consider copying assets referenced from CSS into Stable, like icons. These mostly just live in core/misc right now.

The last submitted patch, 20: copy_templates_and-2575737-20.patch, failed testing.

The last submitted patch, 21: copy_templates_and-2575737-21.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 22: copy_templates_and-2575737-22.patch, failed testing.

star-szr’s picture

Status: Needs work » Needs review
StatusFileSize
new125.62 KB
new637 bytes

This should fix the fail.

star-szr’s picture

Just to give an update I've been working on an automated test to verify the library overrides, and I think we can do something similar for the template overrides and such.

star-szr’s picture

StatusFileSize
new131.34 KB
new5.72 KB

Here's a work in progress, this makes sure core module JS assets are all overridden by Stable. This was tricky to get working as a kernel test, the key was to install Stable first before installing all the modules. I spent quite a chunk of time trying to get things to work the other way around.

Edit: I know some services are unused etc. :)

star-szr’s picture

Issue summary: View changes
Issue tags: +Needs tests
StatusFileSize
new132.43 KB
new7.04 KB
new132.43 KB
new832 bytes

A couple new patches here, the first to demonstrate that the tests will catch problems. The second will not be green either but will have less fails. We can either special case #2580049: Removed CSS files not removed from library definitions and editor.css which needs an issue created (I'll do so shortly) or be blocked on those getting in.

If someone wants to review the tests now that would be great. Tagging for more tests and updating the IS because we could use some test coverage for making sure we have all the Twig templates.

The last submitted patch, 30: copy_templates_and-2575737-30.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 30: copy_templates_and-2575737-30-miscfix.patch, failed testing.

star-szr’s picture

Okay we combined those two issues into one, thanks for the idea @nod_!

star-szr’s picture

Status: Needs work » Needs review
StatusFileSize
new132.51 KB
new1.05 KB

Making things more expandable.

star-szr’s picture

Priority: Normal » Major
davidhernandez’s picture

+++ b/core/themes/stable/css/color/color.admin.css
@@ -39,12 +39,12 @@
+  background: url(../../../../modules/color/images/hook-rtl.png) no-repeat 0 0;

Why wouldn't we copy these to Stable?

Just a sanity check. Did we discuss the fact that module CSS, like from a contrib module, will now always load above core CSS? Since it is now coming from a theme it will always be group with the other theme CSS, but the modules won't.

star-szr’s picture

@davidhernandez thanks, I brought that up in #23, I'm leaning towards copying them although there are still likely cases where paths would need to be adjusted.

Are you sure about the CSS loading thing? The way we are using libraries-override shouldn't the positions of the assets be preserved and therefore it wouldn't matter that the assets are actually in a theme? Maybe that needs an automated test.

Status: Needs review » Needs work

The last submitted patch, 35: copy_templates_and-2575737-35.patch, failed testing.

davidhernandez’s picture

Ah, you are right. I did check that back on the other issue and it was working. I forgot.

rainbowarray’s picture

If we haven't checked already, we should make sure that the last theme function conversions that got in have their templates in Stable. I think at least a couple went in after I had done the initial copying.

We should also make sure that the last two theme function conversions, if they get in, put a copy of their templates in Stable.

davidhernandez’s picture

+++ b/core/themes/stable/templates/block/block--local-actions-block.html.twig
@@ -1,4 +1,4 @@
-{% extends "@block/block.html.twig" %}
+{% extends "@stable/block/block.html.twig" %}

Thank you for catching that. I just realized this needed to be done. We should also change the extends in the other themes. Seven and Bartik can be done later, but we should change any in Classy since those will get copied by people.

star-szr’s picture

@mdrummond yup I checked pretty thoroughly in #20 when I updated all the changed/added/removed assets and we'll work on adding tests to verify that as well.

And yes, any new things that are added, bugs fixed etc. will need to happen in Stable. One thing we haven't done yet is in Stable's templates is change the top line to start with "Theme override…" and remove the @ingroup themeable.

I'm going to:

star-szr’s picture

star-szr’s picture

Status: Needs work » Needs review
StatusFileSize
new219.76 KB
new44.34 KB
new100.38 KB

There are two interdiffs here, one to show the image/CSS changes, the other to show the Twig template docblock changes. The tricky part is that in the diff now some templates will actually be copied from Classy because they are actually more similar now that the docblocks have been updated. So some parts of the diff look a bit weird (removing classes etc.) because of this. Unfortunately the patch is also quite a bit larger now.

I'm still open to the idea of splitting this because the CSS/JS/images/libraries + tests part needs review but the template part still needs tests, for example. But the committers might not want that split.


Notes:

I used this regex to search/replace the @file stuff:

(Default theme implementation|Default template|Default theme override|Default view template)

I opened #2588373: Remove unused image files from core.

Status: Needs review » Needs work

The last submitted patch, 45: copy_templates_and-2575737-45.patch, failed testing.

star-szr’s picture

Status: Needs work » Needs review
StatusFileSize
new219.7 KB
new1017 bytes

Just some cleanup for the library tests.

Status: Needs review » Needs work

The last submitted patch, 47: copy_templates_and-2575737-47.patch, failed testing.

star-szr’s picture

Status: Needs work » Needs review
StatusFileSize
new218.72 KB
new2.47 KB

More test futzing/fixing.

Status: Needs review » Needs work

The last submitted patch, 49: copy_templates_and-2575737-49.patch, failed testing.

star-szr’s picture

Issue tags: +JavaScript

This should definitely be reviewed by a JS maintainer. Unfortunately it copies a lot of JS and the idea is that bugfixes would need to be copied to Stable. Luckily as far as I know no changes would need to be made to those files.

Maybe we don't need to copy JS, or we can be more selective? I don't know.

wim leers’s picture

Tagging JavaScript to get nod_ to review this.

Duplicating all of core's JS seems an enormous maintenance burden, because it'll require fixing everything twice. Initially in the same way, but over time potentially even in two different ways.

That frightens me.

catch’s picture

I really do not think we should be copying js here.

JS is logic, not presentation. And the specific logic of a js file does not imply a backwards compatibility break at all - it has a public API the same as PHP does.

If we have js changes we want to do that imply a backwards compatibility break, then we might need to figure out a way to handle bc there, but I don't think that would be via Stable theme - modules could equally be relying on core's js and a theme can't help them.

star-szr’s picture

I'm fine with that, the JS part really hadn't been discussed that much.

star-szr’s picture

Status: Needs work » Needs review
StatusFileSize
new179.29 KB
new38.44 KB

Here's what that would look like. This also removes the is_file() check because that will be run by the test added to #2580049: Removed CSS files not removed from library definitions anyway.

wim leers’s picture

Issue tags: -JavaScript

Thanks, that makes it much more maintainable — now I defer to strong CSS/markup people for reviewing this.

star-szr’s picture

Title: Copy templates and assets to Stable » Copy templates, CSS, and related assets to Stable and override core libraries' CSS
Issue summary: View changes
StatusFileSize
new179.48 KB
new451 bytes

We can also update the .info.yml of Stable to take out "JavaScript"…

The last submitted patch, 55: copy_templates_and-2575737-55.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 57: copy_templates_and-2575737-56.patch, failed testing.

star-szr’s picture

Going to take a look at some tests for the template overrides.

star-szr’s picture

Status: Needs work » Needs review
StatusFileSize
new182.61 KB
new183.45 KB
new5.25 KB

Here are the template tests, they caught one missing template (status-report.html.twig). The first patch should show more fails.

I tried to get away with only enabling, not installing modules, but Views/Views UI does quite a lot in its hook_theme() implementations. So the test is a bit slow, but I don't know how else to do it. One other thing I tried was enabling all modules except Views ones and then only installing Views and Views UI but that didn't work out.

Despite the fact that this patch will still be red, it should turn green once #2580049: Removed CSS files not removed from library definitions is committed so reviews, please!

star-szr’s picture

StatusFileSize
new183.46 KB
new716 bytes

Better assertion message.

The last submitted patch, 61: copy_templates_css-2575737-61-morefails.patch, failed testing.

The last submitted patch, 61: copy_templates_css-2575737-61.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 62: copy_templates_css-2575737-62.patch, failed testing.

The last submitted patch, 62: copy_templates_css-2575737-62.patch, failed testing.

star-szr’s picture

Status: Needs work » Needs review
StatusFileSize
new183.78 KB
new7.9 KB

Catching up with other changes.

Status: Needs review » Needs work

The last submitted patch, 67: copy_templates_css-2575737-67.patch, failed testing.

star-szr’s picture

Status: Needs work » Needs review
StatusFileSize
new185.58 KB
new3.02 KB

Now that we have 0 theme functions 2 more templates needed to be copied to Stable.

star-szr’s picture

Issue summary: View changes
Issue tags: -Needs tests

Reviews please! I think we have quite a reasonable amount of test coverage but of course those need review as well.

davidhernandez’s picture

Going back to an earlier suggestion, maybe we should split this up? I wanted to try to review it some over the weekend, but after looking over the patch I realized I didn't have a big enough block of time. To thorough go over everything I'm thinking a 4-6 hour block of time is needed, which I can't do in one night.

star-szr’s picture

Worth considering, thanks @davidhernandez. For now here is the patch split by library/CSS/image changes and template changes (and their accompanying tests). If we get the go-ahead from a core committer then we can split this issue into two.

For now we can review the patches separately, they don't conflict at all so it's not a big deal to maintain it like this, whether on this issue temporarily or on separate issues to be committed separately.

No changes, just splitting.

star-szr’s picture

Issue summary: View changes

Breaking down the patch in the issue summary.

davidhernandez’s picture

Started looking over the templates patch.

Confirmed that I find 146 templates in core and the same number moved in the patch.
Confirmed that all templates are moved to Stable and appear to be in the correct folders based on the Classy organization of subfolders.

Note that these patches do not set Stable as a base for Classy. "base theme: false" needs to be removed in Classy's info file. There is another issue to work on this part.

But I also noticed that Stable is not installed as part of the default install profile. Will that be changed? Without it installed if someone tries to create a theme but does not set the base theme to false they will get a white screen with a theme initialization error. Thats bad TX/DX.

Starting to look at the individual templates now and verify that template inheritance and everything else is working. I'll likely continue this tomorrow.

p.s. What is views-view-mapping-test ?

davidhernandez’s picture

Looking good so far, will try to continue tomorrow.

aggregator: good
block: good
block content: good
book: good
ckeditor: good
color: good
comment: good
config translation: good
field ui: good
file: good
filter: good
forum: good
image: good
language: good
link: good
locale: good
node: good
rdf: good
responsive image: good
search: good
simple test: good

star-szr’s picture

Thanks! Steps to reproduce the theme initialization error would be helpful, because when installing the sub theme we *should* be installing any dependencies as well. If that doesn't work that problem is bigger than Stable I think.

I don't remember what views mapping test is.

davidhernandez’s picture

Fresh install, Stable is not installed.
Install custom theme with no base theme setting defined.
Works, Stable gets installed.

Fresh install, Stable not installed.
Remove base theme setting from Classy, or set it to false.
Refresh homepage and get theme initialization error.

So that is less problematic than I thought. It looks like that works correctly when installing the theme. We may just need some documentation around that, since I imagine people will play around while making a theme and not realize they may have to reinstall when changing that setting. But, I assume Stable will be installed by default anyway since we'll have Classy depend on it.

Playing around some more I see the dependency checking is working correctly. I get an uninstall option based on whether any of the other themes are depending on it or now.

davidhernandez’s picture

system: good
taxonomy: good
toolbar: good
update: good
user: good
views: good
views_ui: good

As far as copying the all the templates, everything looks good. I want to check all the include/extend/etcs in any files and do some testing with the inheritance and BC, but so far so good.

star-szr’s picture

Thank you @davidhernandez!

Checking to see if anything needs updating since 15d0695. Commit hash based on #67. I also dug through the logs in a similar manner and didn't find any surprises. The patches don't need to be updated based on core changes.

git diff --stat 15d0695 core/modules/*.html.twig

 core/modules/block/templates/block.html.twig                     | 3 +--
 core/modules/system/templates/block--system-menu-block.html.twig | 3 +--
 core/modules/system/templates/status-report.html.twig            | 1 +
 3 files changed, 3 insertions(+), 4 deletions(-)

No changes needed here, the latest patch(es) copy these files correctly, all is well.

git diff --stat 15d0695 core/{misc,modules}/*.css

<no output>

Nothing to do.

git diff --stat 15d0695 core/core.libraries.yml core/modules/*.libraries.yml

 core/core.libraries.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
 
The CKEditor library version was updated, no change needed.

Edit: Oops did a Markdown thing. Fixed.

star-szr’s picture

Issue summary: View changes
Issue tags: +rc target triage
star-szr’s picture

So this does need a slight reroll after #2574975: Allow (base-)themes to be excluded from the UI (e.g. blocks, Appearance). got committed. The template patch doesn't need to change so please see #72 for that.

davidhernandez’s picture

I checked all the include/extends/import/macro etc I could find. All seem fine.

The only thing that stands our to me is the extend in block--local-actions-block.html.twig

{% extends "@stable/block/block.html.twig" %}

We should be able to just extend block.html.twig directly, no? Or does that mean that if someone were to override block.html.twig but not to local actions block that it would use their theme's modified block template. That might be a problem, and the solution would be to specify Stable's template as it is doing. But, if that is the case, we may want to do that with the other extended templates as well. The other ones are not specifying Stable.

I'll try to test that. Otherwise, I'd call the template patch RTBCable.

davidhernandez’s picture

Tested that. So, yeah, it properly uses the suggestions so if we leave it as:

{% extends "block.html.twig" %}

it will use the block template that is in your custom theme instead of the Stable template. We should make sure that makes sense, because if you override the block template, but not the system branding template, you can break the system branding one.

star-szr’s picture

Yeah I'm not sure on that, we could check back to when that was added. Maybe that could be followup. Thanks!

davidhernandez’s picture

Looking through the libraries now. Checking before and after of asset ordering. For the most part, the replacement of core/modules files with Stable versions is working perfectly.

Here is one thing I noticed did change while viewing a page logged in. I'm using a custom theme.

Before:

@import url("http://d8.localhost/core/modules/contextual/css/contextual.toolbar.css?nxid13");
@import url("http://d8.localhost/core/modules/toolbar/css/toolbar.menu.css?nxid13");
@import url("http://d8.localhost/core/modules/contextual/css/contextual.theme.css?nxid13");
@import url("http://d8.localhost/core/modules/contextual/css/contextual.icons.theme.css?nxid13");
@import url("http://d8.localhost/core/modules/quickedit/css/quickedit.theme.css?nxid13");
@import url("http://d8.localhost/core/modules/quickedit/css/quickedit.icons.theme.css?nxid13");
@import url("http://d8.localhost/core/themes/seven/css/components/quickedit.css?nxid13");
@import url("http://d8.localhost/core/modules/toolbar/css/toolbar.theme.css?nxid13");
@import url("http://d8.localhost/core/modules/toolbar/css/toolbar.icons.theme.css?nxid13");
@import url("http://d8.localhost/core/modules/user/css/user.icons.admin.css?nxid13");
@import url("http://d8.localhost/core/modules/shortcut/css/shortcut.theme.css?nxid13");
@import url("http://d8.localhost/core/modules/shortcut/css/shortcut.icons.theme.css?nxid13");

After:

@import url("http://d8.localhost/core/themes/stable/css/contextual/contextual.toolbar.css?nxid7m");
@import url("http://d8.localhost/core/themes/stable/css/toolbar/toolbar.menu.css?nxid7m");
@import url("http://d8.localhost/core/themes/stable/css/contextual/contextual.theme.css?nxid7m");
@import url("http://d8.localhost/core/themes/stable/css/contextual/contextual.icons.theme.css?nxid7m");
@import url("http://d8.localhost/core/themes/seven/css/components/quickedit.css?nxid7m");
@import url("http://d8.localhost/core/themes/stable/css/quickedit/quickedit.theme.css?nxid7m");
@import url("http://d8.localhost/core/themes/stable/css/quickedit/quickedit.icons.theme.css?nxid7m");
@import url("http://d8.localhost/core/themes/stable/css/toolbar/toolbar.theme.css?nxid7m");
@import url("http://d8.localhost/core/themes/stable/css/toolbar/toolbar.icons.theme.css?nxid7m");
@import url("http://d8.localhost/core/themes/stable/css/user/user.icons.admin.css?nxid7m");
@import url("http://d8.localhost/core/themes/stable/css/shortcut/shortcut.theme.css?nxid7m");
@import url("http://d8.localhost/core/themes/stable/css/shortcut/shortcut.icons.theme.css?nxid7m");

Seven's quickedit.css moved position.

Seven has this in the info file

quickedit_stylesheets:
  - css/components/quickedit.css

I think this is one of those special snowflake settings like adding ckeditor stylesheets in the info file, so I'm not sure how this gets handled when all the libraries are processed.

davidhernandez’s picture

I'm noticing that this does not override libraries that are JS only. Is that intentional? Things are like drupal.js, drupa.ajax library, etc are missing.

star-szr’s picture

For #85 we may need to think about using dependencies more with CSS libraries, right now a lot of these dependencies are not declared - if Seven's quickedit CSS does not rely on being loaded after the core stuff then it's fine, but if it does arguably it should be explicit about that.

As for JS yes that is intentional, see the discussion from around #51 to #56.

davidhernandez’s picture

It was decided not to include JS. Got it, thanks.

Regarding the quickedit stylesheet, I don't think you can explicitly declare a dependency since this is being added in info.yml not in a library. It may be that the code in the quickedit module needs to be modified to make sure CSS coming from info.yml come later. The same for CKEditor.

star-szr’s picture

Ah yes very good point :)

davidhernandez’s picture

I'be been checking Bartik and as far as I can tell all the CSS links are coming out the same (The Seven quickedit still being the one exception.)

davidhernandez’s picture

Looking at libraries. I'm checking each libraris.yml file and excluding ones that are JS only.

block
-drupal.block.admin: good
ckeditor
-drupal.ckeditor: good
-drupal.ckeditor.plugins.drupalimagecaption: good
-drupal.ckeditor.admin: good
color
-admin: good
config_translation
-drupal.config_translation.admin: good
content_translation
-drupal.content_translation.admin: good
contextual
-drupal.contextual-links: good
-drupal.contextual-toolbar: good
drupal core
-drupal.dropbutton: good
-drupal.vertical-tabs: good

One thing I noticed is that we could do the folder organization a little different when it comes to some of these subitems. For example, dropbotton is going into core/dropbutton but vertical tabs directly in core/. Also, drupalimgecaption going into that deep subdirectory. I know that is replicating the original structure, but other things have been changed so we don't have direct one-to-one everywhere.

Just an observation. For simplicity sake we may not make any changes, but I thought worth pointing out.

davidhernandez’s picture

Status: Needs review » Needs work

dblog
-drupal.dblog: good
field_ui
-drupal.field_ui: good
file
-drupal.file:
filter
-drupal.filter.admin: good
-drupal.filter: good
-caption: duplicate

+++ b/core/themes/stable/stable.info.yml
@@ -1,8 +1,239 @@
+  filter/caption:
+    css:
+      component:
+        css/filter.caption.css: css/filter/filter.caption.css
+  filter/drupal.filter.admin:
+    css:
+      theme:
+        css/filter.admin.css: css/filter/filter.admin.css
+  filter/drupal.filter:
+    css:
+      theme:
+        css/filter.admin.css: css/filter/filter.admin.css
+  filter/caption:
+    css:
+      component:
+        css/filter.caption.css: css/filter/filter.caption.css

There is a duplicate here. filter/caption is listed twice.

davidhernandez’s picture

image
-admin: good
language
-drupal.language.admin: good
locale
-drupal.locale.admin: good
menu_ui
-drupal.menu_ui.adminforms:
node
-drupal.node: good
-drupal.node.preview: good
-form: good
-drupal.node.admin: good
quickedit
-quickedit: good
shortcut
-drupal.shortcut: good
simpletest
-drupal.simpletest: good
system
-base: good
-admin: good
-maintenance: good
-diff: good
taxonomy
-drupal.taxonomy: good
toolbar
-toolbr: good
-toolbar.menu: good
tour
-tour-styling: good
update
-drupal.update.admin: good
user
-drupal.user: good
-drupal.user.admin: good
-drupal.user.icons: good
views
-views.module: good
views_ui
-admin.styling: good

That is all the libraries. The images/icons are the last thing on my list to verify.

star-szr’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new185.9 KB
new1.32 KB

Regarding #91 part of the reason the directory structure was kept uniform was so that we could have automated tests. If we start moving things around then we need to special case the tests for asset overrides. Otherwise I'd agree that things could be improved.

Attached should fix #82/#83 and #92, no other changes. Thank you very much @davidhernandez.

Status: Needs review » Needs work

The last submitted patch, 94: copy_templates_css-2575737-94.patch, failed testing.

davidhernandez’s picture

One nitpick. I think it is better to delete the first instance of the caption library, not the second, to keep them in the same order as they are in the original filter library file.

star-szr’s picture

Status: Needs work » Needs review
StatusFileSize
new187.3 KB
new1.4 KB

#2581443: Make Classy extend from the new Stable base theme is in now, so bringing over some changes from there to make this greener.

star-szr’s picture

StatusFileSize
new187.3 KB
new730 bytes

Agreed on #96, I meant to check that. Fixed here.

davidhernandez’s picture

Images

color
-hook: good
-hook-trl: good
-lock: good
contextual
-gear-select: This file is unused and needs to be deleted from core. There is an issue for it. https://www.drupal.org/node/2588373
quickedit
-icon-throbber: good
shortcut
-favstar: good
-favstar-rtl: good
user
-icon-user: same as gear select.
-icon-user-active: same as gear select.
views_ui
-arrow-active: same as gear select.
-close: same as gear select.
-expanded-options: same as gear select.
-loading: same as gear select.
-overriding: same as gear select.
-sprites: good
-status-active: same as gear select.

I think we also discovered Color module functionality for lock may be broken.

By my count there are 76 icons copied over, but only 54 references to them in Stable CSS. I'm assuming Cottser just copied over everything from the misc folder for completion sake maybe. I can't say anything is wrong with that, I just wanted to note it.

If the tests are green, and the couple things I mentioned are fixed which they look like they are in the latest, I think we're good. In an ideal world I'd like to do some more real world testing on this, but we are really limited on time. I also have yet to encounter any part of it that made me thing there was something that really needed more thorough examination. All in all, great work by Scott!

davidhernandez’s picture

Status: Needs review » Reviewed & tested by the community

I approve of 97 and 98.

The last submitted patch, 16: copy_templates_and-2575737-16.patch, failed testing.

The last submitted patch, 18: copy_templates_and-2575737-18.patch, failed testing.

The last submitted patch, 20: copy_templates_and-2575737-20.patch, failed testing.

The last submitted patch, 21: copy_templates_and-2575737-21.patch, failed testing.

The last submitted patch, 22: copy_templates_and-2575737-22.patch, failed testing.

The last submitted patch, 27: copy_templates_and-2575737-27.patch, failed testing.

The last submitted patch, 29: copy_templates_and-2575737-29.patch, failed testing.

The last submitted patch, 30: copy_templates_and-2575737-30.patch, failed testing.

The last submitted patch, 30: copy_templates_and-2575737-30-miscfix.patch, failed testing.

The last submitted patch, 35: copy_templates_and-2575737-35.patch, failed testing.

The last submitted patch, 45: copy_templates_and-2575737-45.patch, failed testing.

The last submitted patch, 47: copy_templates_and-2575737-47.patch, failed testing.

The last submitted patch, 49: copy_templates_and-2575737-49.patch, failed testing.

The last submitted patch, 55: copy_templates_and-2575737-55.patch, failed testing.

The last submitted patch, 57: copy_templates_and-2575737-56.patch, failed testing.

The last submitted patch, 61: copy_templates_css-2575737-61-morefails.patch, failed testing.

The last submitted patch, 61: copy_templates_css-2575737-61.patch, failed testing.

The last submitted patch, 62: copy_templates_css-2575737-62.patch, failed testing.

The last submitted patch, 67: copy_templates_css-2575737-67.patch, failed testing.

The last submitted patch, 69: copy_templates_css-2575737-69.patch, failed testing.

The last submitted patch, 72: copy_templates_css-2575737-72-full.patch, failed testing.

The last submitted patch, 72: copy_templates_css-2575737-72-libraries-css-images.patch, failed testing.

star-szr’s picture

Calm down bots :)

I filed an issue for the color module weirdness.

Thank you very much for reviewing this @davidhernandez!

xjm’s picture

Issue tags: -rc target triage +rc target

Discussed with @effulgentsia. I think this issue needs to be an RC target if it is a required part of #2588303: Stable base theme in core.

However, neither @effulgentsia nor I were entirely clear on why this is necessary or desirable, so it'd be good to get a clarification on that from either the subsystem maintainers or another committer who understands this plan better.

The last submitted patch, 81: copy_templates_css-2575737-81-full.patch, failed testing.

The last submitted patch, 81: copy_templates_css-2575737-81-libraries-css-images.patch, failed testing.

star-szr’s picture

This issue is to create a snapshot of our templates and other frontend assets for backwards compatibility. If we don't copy the templates, CSS, and such, there's not much point to having Stable in core IMO. Around the time of Barcelona we had discussed some potential ways of handling backwards compatibility without copying everything and explored some solutions there. However, because of the way that Twig templates can reference each other by namespace (a similar thing applies to libraries), only copying templates and assets to Stable when we change them in core is not viable, so we need to shift things over to Stable to actually make Stable stable and work as a BC layer.

For example, if someone does this in a Twig template in a theme extending only from Stable and we didn't have a block template in Stable:

{% extends "block.html.twig" %}

They would be extending the core block module's block template. Then if/when we later make a change to that template, we can potentially break their site unless we first copy the template into Stable. That might sound like what we should do to handle BC, however templates can also be referenced by namespace:

{% extends "@block/block.html.twig" %}
{% extends "@stable/block/block.html.twig" %}

…and referencing templates via namespaces is needed in some cases to prevent infinite loops when extending. So without being able to reference @stable, people would in some cases be forced to couple themselves with core's wild west markup, knowing (or not knowing) that it's going to change from under them and break their site at some point in the future.

So with Stable being fully populated, people can reference the templates and assets from Stable rather than core and we are free to later update the block module's block template. People using Stable or Classy as a base theme won't see any of those changes unless they specifically reference the core template or copy the modified template into their theme.

Hope that makes sense :)

For some other takes on this see:

Edit: Fixed a technical inaccuracy, it would be @stable/block/block.html.twig, not just @stable/block.html.twig. The path is relative from the /templates directory and stable has a similar folder structure to Classy.

The last submitted patch, 94: copy_templates_css-2575737-94.patch, failed testing.

wim leers’s picture

Does this mean that sites using {% extends "@stable/block/block.html.twig" %} will always be using the templates as they were in 8.0.0? Including sites developed against Drupal 8.4.0, for example? That would mean they wouldn't get the improvements two years into the release cycle, even if that's the version they're building against, which would be a big loss.

catch’s picture

@Wim that's the whole point of this issue. Either they extend the core templates and are prepared to stay up to date, or they extend Stable templates and never get up to date - but this issue gives them the choice.

Otherwise in core we have to make the choice between not making changes at all, vs. potentially breaking custom themes each minor release because they're relying on the 8.0.0 markup which would be changing under their feet.

wim leers’s picture

Alright, fair. Thanks for confirming. I think it's important to document that super explicitly.

davidhernandez’s picture

Holy testbot, Batman! What caused that?

Should we create a follow up issue and add a read me file to Stable explicitly explaining its purpose as a BC layer? I'm in favor.

catch’s picture

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 98: copy_templates_css-2575737-97.patch, failed testing.

star-szr’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new186.68 KB
new611 bytes

Tiny conflict with #2025707: Remove unused #theme "file_widget", straightforward reroll. Interdiff shows we no longer copy that file because it's gone.

Edit: Note that in my excitement I forgot to change the patch filename.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Good to get this in before RC4 in case there's anything we missed.

Committed/pushed to 8.0.x, thanks!

  • catch committed e51d9de on 8.0.x
    Issue #2575737 by Cottser, davidhernandez: Copy templates, CSS, and...
star-szr’s picture

Thanks @catch! I think this could probably benefit from a change record telling people how to update their Twig/library extends etc.

If nobody beats me to it I can probably work on that about ~4h from now and put a draft up.

davidhernandez’s picture

There is already a change record from when Stable was aded. https://www.drupal.org/node/2580687

Do we need a separate one here?

star-szr’s picture

As discussed (on IRC) I think we can just edit that to add more info and maybe have an admin bump/republish it.

greg.1.anderson’s picture

This issue causes the installer to not initialize the cache correctly when installing a site where (a) the database record and configuration settings are already defined in settings.php, and (b) the database is empty. The symptom is that progress bars are drawn in black rather than stylized (looks just like the minimal theme), breadcrumbs are unstyled lists, etc.; the reason for this is that theme files in the selected theme (seven) that override theme files inherited from a base theme (e.g. classy) are ignored in favor of the inherited file. All symptoms disappear after a cache-rebuild, so this problem is limited to cache initialization, and seems to go no deeper than that. I don't know the root cause, but suspect it always existed, and was merely exposed by the reorganization done here.

It is possible that the scenario that causes this problem is unsupported; the re-install instructions tell the user to empty the database, and copy default.setting.php over settings.php. The installer does seem to attempt to support this setup, though, and hosting environments such as Pantheon take advantage of this in order to provide database settings for the user.

joelpittet’s picture

@greg.1.anderson it's not this issues fault it just revealed the problem. The fix is here #2614014: Progress bar, fieldsets, messages broken in the installer due to theme ordering bug

greg.1.anderson’s picture

Yes, thanks. This was actually happening on clean installs as well, and is now fixed in HEAD of 8.0.x by above-mentioned issue.

star-szr’s picture

  • catch committed e51d9de on 8.1.x
    Issue #2575737 by Cottser, davidhernandez: Copy templates, CSS, and...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.