Problem/motivation
Local tasks and actions are hardwired into templates which gives no control to users to move them around.
Also the current solution makes tabs uncacheable by render cache unless whole page could be cached. Tabs are also being generated even though they wouldn't be printed.
Proposed solution
Introduce local tasks and actions as blocks that can be moved around and be cached with render caching after sufficient cacheable metadata has been bubbled up from the hooks providing local tasks.
Performance gain (see #264) if local tasks would be cached:
(block management page which has action links, primary tabs and secondary tabs. Tested as anonymous user. Warm caches but internal page caching turned off.)
=== 8.0.x..cached-tabs compared (55919cdb0fed9..55919d1190958):
ct : 92,936|88,242|-4,694|-5.1%
wt : 159,482|151,346|-8,136|-5.1%
mu : 18,570,072|17,711,328|-858,744|-4.6%
pmu : 19,736,144|18,835,248|-900,896|-4.6%
http://www.lionsad.de/xhprof-kit/xhprof/xhprof_html/?run1=55919cdb0fed9&...
Tasks remaining
-Review it!
-Commit!
API changes
Remove hook_menu_local_tasks() since it's unused carry-over from 7.x and redundant to hook_menu_local_tasks_alter() (dynamic) and hook_local_tasks_alter() (discovery)
Beta phase evaluation
| Issue category | Task |
|---|---|
| Issue priority | Major because it significantly improves the ability for site builders to manage page elements from the UI. Not critical because nothing is broken. |
| Unfrozen changes | Unfrozen because it mostly affects the page template, and templates are not frozen. |
| Prioritized changes | The main goal of this issue is to improve site building and theming experience. It is also a continuation of work that was done pre-beta to convert all page template variables to blocks. This issue is also performance improvement which is prioritized change. |
| Disruption | There will be possible disruption to sites with customized versions of the templates affected, or depending on the variables that were removed/moved. |
| Comment | File | Size | Author |
|---|---|---|---|
| #468 | drupal_507488_468.patch | 98.04 KB | xano |
| #468 | interdiff.txt | 1.33 KB | xano |
| #440 | interdiff-507488-439-440.txt | 549 bytes | rainbowarray |
| #440 | 507488-440-convert-local-task-actions.patch | 96.94 KB | rainbowarray |
| #407 | 507488-407-convert-page-elements.patch | 95.06 KB | rainbowarray |
Comments
Comment #1
maximiliam commentedHere is an initial patch that implements this blocks. After applying the patch and clearing the cache, go to admin/build/block and put the blocks called "Page title", "Primary tabs", "Secondary tabs" and/or "Messages" in the block region called "Title" or in any region you prefer.
When the "Page title" block is enabled and the "Primary tabs" block is disabled, the primary tabs will be shown on the same line as the page title.
Comment #2
maximiliam commentedComment #4
maximiliam commentedComment #5
sun.core commentedComment #6
stevectorMajor changes along these lines are in progress at http://drupal.org/sandbox/eclipsegc/1441840
Comment #7
David_Rothstein commentedThis is a relatively small, focused issue, so it should remain open.
But see also #1053648: Convert site elements (site name, slogan, site logo) into blocks which is closely related. Although they focus on "blockify-ing" different things, it may make sense to merge them.
That issue also points out the existence of the Blockify module, which is relevant here.
Comment #8
David_Rothstein commentedComment #9
sunComment #10
gábor hojtsyTagging it up.
Comment #11
gábor hojtsyAll right, so given #1535868: Convert all blocks into plugins, it probably does not make much sense at this point to convert these to blocks as blocks exist pre-plugins. However, @EclipseGC actually did lots of the conversion work that is involved with these blocks in interim patches at #1787846: Themes should declare their layouts. It was not actually related to introducing layouts as a concept, and I want to make sure we have the patch around, so here it is. All the code included is from @EclipseGC.
Blocks included:
- local actions
- breadcrumb
- messages
Page title and tabs as in the issue title are not yet included. Following the same pattern, we should be able to easily deduct the rest of the blocks though.
Technically this issue does not make much sense until #1535868: Convert all blocks into plugins however, I think it would make sense to parallelise work.
Comment #12
gábor hojtsyComment #13
sunI think we should use #theme here, no?
The other problem is that
theme_status_messages()needs to be invoked as late as possible in the rendering process, which is currently achieved and guaranteed by invoking it from template_process_page(); i.e., after the entire page has been composed.The same also applies to the breadcrumb... if it's rendered too early, then modules do not have a chance to override it for particular pages.
I wonder whether the blocks/layout system has a concept for these late-rendering cases?
[Also removing duplicate tag.]
Comment #14
eclipsegc commentedSo, I generally agree, we should move these to #theme for the time being. I generally trying to stay as true to whatever the code was already doing when I do these conversion. I don't always do that depending on the circumstances and I honestly can't remember what was happening here, but in any event, moving to #theme should leave these as render arrays for as long as possible and defer sun's questions until we move to blocks returning strings.
To address your question sun, yes in panels today we have a render order of sorts in place. Basically (if I recall) it renders in order, except for a list that may be tagged for "render last" in which case they render after everything else has rendered. This is useful in situations where you have something like solr facets that won't return data until the corresponding query to the solr engine has been run (which the facet itself wouldn't do by say a pager generated from that query would). I don't really like that particular behavior as I'd really like there to be a phase that happens before rendering that executes any sort of stuff that the blocks will need for rendering. It's at this level that I would hope module could interact with blocks. That level has not been specifically built in the blocks patch yet because it has more to do with layouts than it does blocks.
TL:DR; You bring up a good point, I think we can defer to by switching to #theme for the time being, and worrying about it once blocks and layouts/panelsy controller are all in core together.
Eclipse
Comment #15
andypostctools has "render last" for that purpose
+1 to have this special setting for blocks, contrib has a lot of breadcrumb overrides so this really needs to render after other blocks
Suppose "old-page-level" blocks should have "render last" priority by default most of them are config, but content-related blocks should be rendered first
Comment #16
eclipsegc commentedNo, that's not what I'm suggesting. I think there should be an explicit phase where modules can affect this stuff before blocks are rendered. I'm not sure I see the purpose in delaying the rendering when there's an explicit phase to support these sorts of alterations. Likewise I would prefer individual blocks to never need to worry about their rendering order. If there's something a block depends on that another block generates or whatever, then that should actually all take place in the phase I'm discussing. Again I think solr facets are a good example of this.
Also, as an aside, the hook_block_alter that the blocks as plugins patch introduces gives module developers the ability to fully replace the class for any block, so if a module really needed complete control over a breadcrumb, they could take it.
Eclipse
Comment #17
gábor hojtsyI propose we group at #1053648: Convert site elements (site name, slogan, site logo) into blocks first which is much simpler, but still needs to set up the pattern of introducing the blocks, new regions as needed, removal of existing theme variables, blocks added in install profiles, etc. That pattern can be replicated here and in #1869476: Convert global menus (primary links, secondary links) into blocks but both this one and the menu one need more discussion as to what we do with associated specific problems, while the logo/slogan and site name could work flawlessly.
Comment #18
xjmComment #19
larowlansee also #1947536: Convert drupal_get_breadcrumb() and drupal_set_breadcrumb() to a service
Comment #20
sdboyer commentedjust noting that this is a blocker for SCOTCH, and the work i'm currently doing in our princess branch.
it may be that this is easier to finish up in princess directly because we don't have to deal with some of the architectural awkwardness (like special regions). if that's the case, i may just pull the base work in there and go forward with it.
Comment #21
webchickThis is another one of those issues that it'd be great to have as a patch separate from the princess branch, because it has value outside of SCOTCH.
Comment #22
xjmComment #23
benjifisher#11: page-elements-as-blocks-11.patch queued for re-testing.
Comment #24
gábor hojtsyBreadcrumbs were already converted in http://drupalcode.org/project/drupal.git/commitdiff/4d08d57418c663b59953... The rest needs to be converted.
Comment #25
andypostIs this issue still valid for d8?
Comment #26
gábor hojtsyI think this would be an API change for themers, so it is dependent on maintainers agreeing it should be done. I think it would be amazing to still do this.
Comment #27
jibranNW as per #24.
Comment #28
Jeff Burnz commentedYes this is still relevant (I don't see this has having been done anywhere else as yet) and yes we should defintily do this.
Will these now move into system module?
Comment #29
eclipsegc commentedThat sounds like the right place for them.
Eclipse
Comment #29.0
eclipsegc commentedUpdate summary.
Comment #30
klonos...moving related issues to their dedicated metadata section.
Comment #31
joelpittetI made an interim solution a while ago to solve the early rendering issue. RenderWrapper class just takes the function and let's the __toString() call the function with it's arguments as late as possible. You can see that in core (sorry I hate the name I came up with but nothing came to me and still hasn't). Change Notice here https://drupal.org/node/2052023
Maybe this can be re-rolled with that on there.
theme() is being deprecated. #2006152: [meta] Don't call theme() directly anywhere outside drupal_render()
Comment #32
rainbowarrayMade some progress on #1053648: Convert site elements (site name, slogan, site logo) into blocks. Hopefully that pattern can be useful to taking care of this issue too.
Comment #33
rainbowarrayTrying to get this issue restarted after a long hiatus.
This first patch just has the page title conversion.
The good thing is that you can now go to the block layout page and request a page title block. Yay!
The bad news is that it doesn't display anything. Boo.
I think I'm missing a step where the page variables are set for the templates in preprocess. Couldn't figure that out. But posting this as a progress report.
I'll probably get started on adding in the other page elements as block plugins later tonight.
If you spot what's wrong, feel free to let me know!
Comment #34
rainbowarrayThanks to some help from chx and larowlan on IRC, I got this working.
One thing I'm not certain about is if title_prefix and title_suffix will work with this. I'm not explicitly generating those and sending them into the template, so I'm guessing not? I couldn't find where those were generated for the page template. If anybody has an example I can look at, I'll try to work that in.
In the meantime I'll try to work in some of the other page elements.
Comment #35
rainbowarrayHelps if I post the patch.
Comment #36
rainbowarrayThe page actions block is now working. I also retitled the title block from SystemTitleBlock to SystemPageTitleBlock, as I think that's a bit clearer.
Comment #37
joelpittet@mdrummond thanks for picking this up again. Small nitpick, mind using 2 spaces for the indenting in the twig templates?
Comment #38
tim.plunkettI think you could inline this method here, it'd mean injecting the relevant services.
Here and elsewhere, $this->t()
Have a use statement above, please
That looks double indented (same with the other twig files)
Comment #39
rainbowarrayI have drafts of title, actions, messages and tabs in here now. Tabs is the only one that seems to be working though. I'm pretty confused on how to get messages to work properly. Advice welcome.
Comment #41
rainbowarrayCleaning up a few bugs. Messages is still wrong I'm sure. Title and actions don't work. Not sure why. Tabs is good to go.
Comment #42
rainbowarrayComment #44
rainbowarrayRemoved the route object from the block constructors, and now the page title and page actions blocks work. So it's just messages that isn't functional yet.
Comment #45
rainbowarrayForgot to run testbot on 44, but I have a new version here that gets messages to work. Whether or not messages is working correctly, I don't know. Not sure if I need to do something special to have it pre render at the correct time, but it does seem to show messages.
One thing about the messages block: it can be instantiated, so that you could have more than one messages block in a layout. However, the messages will actually only show up in the first block that they appear in, because of how messages work (I think). It's possible that could be confusing, but I'm not sure what to do about that.
Anyhow, all of these blocks work now, which is pretty neat.
Comment #46
rainbowarrayComment #48
rainbowarrayBad patch. Hopefully this works.
Trying to get messages to fire at the right time. This isn't working yet. Just trying to debug.
Comment #49
rainbowarrayI turned off something that was making messages persist from page to page. We were using this while trying to get this to work, but it broke a lot of tests.
Comment #51
chx commentedFirst thing visible, the getMessages method is not #markup but #message_list.
After that it's time to debug! Put a breakpoint in drupal_render
$elements['#children'] .= drupal_render($elements[$key], TRUE);with a condition of$key === 'pagemessages'then step it. After some stepping you will arrive into _theme and more stepping will land you inside a template file that makes no sense. This is core/modules/system/templates/block--system-page-messages-block.html.twig which in #46 was a copy of the status messages twig template. But we need the block template not the status message template! It's not clear to me why the blocks need their own template -- why don't they just fall back to block.html.twig?? I don't get it. So I havecp core/modules/block/templates/block.html.twig core/modules/system/templates/block--system-page-messages-block.html.twig. However, the problem becomes that template_preprocess_status_messages() runs before our #pre_render -- which is good actually because we really wanted to run as late as possible. So the messages block won't operate until the old one is removed. This would require a block placement of the messages block in every core profile and the removal of template_preprocess_status_messages and the relevant array in template_preprocess_page as well. However, this patch intends to not do that for now so I have opted to use a new theme hook called status_messages_block using the same template. Left a @todo for later. Commenting out messages in template_preprocess_page shows this works.Interdiff is against #46.
Comment #52
chx commentedOh it's not falling back to block.html.twig because it is told not to. Removed.
Comment #53
rainbowarrayRolling a new version. This is an attempt to still use the message blocks. The markup varies between Stark and Bartik, which is why we can't just use the standard block template.
Comment #54
rainbowarrayTrying another approach here. This is a variation on 52 that handles an exception with Bartik. Messages had a couple extra wrapper divs in the page template: this sets up a copy of the status-messages template in Bartik that can include those wrapper divs, then removes the wrapper divs from Bartik.
The problem with this approach is that the page messages block itself has the standard block wrapper divs, and those will show up regardless if there are any messages showing up in the block.
To compound that, messages will only show up once on the page. If a block is placed in the markup after the standard location where messages appear, then no messages will appear in that block. If there are multiple blocks, messages will appear in only the first block, if they appear at all.
There's not a great way to handle this. You could set drupal_get_messages(FALSE) throughout core, which prevents removing messages from the queue. But that prevents any removal ever, so messages would just stack up for all time. There's no way to just go ahead and remove the messages once all the blocks have rendered, at least not one that I can think of off hand.
Ideally we'd get a template working for the messages block, as we have done for the other page element blocks, as we could drop the standard block wrapping divs for the messages block. That would at least mean there wouldn't be a weird empty block appearing even if there are no messages.
Comment #55
rainbowarrayUgh. Here's the actual patch.
Comment #56
rainbowarrayThis version saves the messages as a static property on the messages block class. That allows messages to appear in multiple blocks with a couple caveats.
1) Messages will only appear in blocks if at least one block appears before where the standard messages show up in the page template.
2) If messages do appear in blocks, then they won't appear in the page template.
That's pretty confusing. So if we want to use this approach (and I think we probably should), then we'd probably want to remove the messages variable from the page template. That's on the to-do list anyhow, so this just moves that up a step.
I'd also need to take care of adding a messages block into a region with the install profile. That only happens at install, though, so making that change would remove messages from all existing d8 sites unless they do a reinstall or place a messages block.
If that seems problematic, we could split messages off into a separate issue so we could get the rest of these blocks in.
Comment #57
rainbowarrayI should note that the static property idea was all chx's on IRC. He's been a huge huge help on this issue.
Comment #58
rainbowarraySo now I've been able to set up a block template that doesn't have wrapper divs. That prevents empty blocks from showing up when there aren't any messages.
It took some doing to find a way to properly detect if there are any messages or not in order to not show Bartik's specific message-wrapping divs, but I finally got it.
After discussion tonight, the next step will be to strip the messages from the page template by default and set up a region and default block for messages in the install profile.
Comment #59
rainbowarrayDidn't have a newline at the end of Bartik's status messages template. That's the only thing different here.
Comment #60
andypostThe problem here is a useless tremendous big cache settings:

Suppose we should remove this details in favor of this message
There's a lot of code duplication, seems better to make base class for that
Comment #61
rainbowarrayYes, quite possible I have the block caching settings wrong. I used the main content block as an example, and maybe that's the wrong way to go. I asked wimleers to take a look.
Not sure if an extra class is needed for these. There is some variation between them in their properties and constructors, so not sure if it's worth that. Let's figure out the the proper caching for these first.
Thanks for the feedback!
Comment #62
chx commentedEdit: nevermind. I am out of this issue too.
Comment #63
wim leersThe big thing that I'm still missing in this patch, is the removal of the current way of rendering the page title, actions, tasks, etc., in favor of the blocks.
mdrummond pinged me regarding the cacheability of these four new blocks, and I wanted to enable caching for several of them. But… they actually all are uncacheable:
SystemPageMessagesBlock: messages are per-session, and "expire" after a single page loadSystemPageTitleBlock: the page title can depend on arbitrary logic (thanks to$route_title = call_user_func_array($callable, $arguments);inTitleResolver), until that returns cacheability metadata, that will be impossible to cacheSystemPageActionsBlockandSystemPageTabsBlockare uncacheable for the same reason: what's visible depends on access checkers, and hence this is unfortunately uncacheable also, because that too may have arbitrary logic. Once #2287071: Add cacheability metadata to access checks lands though, those two will become cacheable!So, I just updated the cacheability-related docs a bit, and that's all I was able to do, unfortunately.
Thanks for working on this, mdrummond — can't wait to get rid of all the special snowflake stuff :)
Comment #64
rainbowarrayThis patch should break lots of tests.
This removes messages from templates and adds it in as a block to a new messages region.
This does not have:
- Fixes for tests
- Fixes for any potential CSS issues
- Removing of the preprocess stuff that adds status_messages variable to the page template.
Wanted to see what tests break first, then go from there.
We definitely need to remove messages from templates because of the way that the queue gets cleared. For title, tabs and actions, those could probably be in a followup.
Comment #66
rainbowarrayThis should greatly reduce the test errors if not eliminate them.
The messages variable is back in the page templates for system, but still gone for Bartik and Seven.
I kept the messages region in the page templates for system, so that if anybody wants to post a messages block in a theme based on Stark, they have a handy region to place it in. That region would come before the messages variable, which I think would make more sense, as then people can tweak a block in the messages region however they like, and those changes would show up, whereas if the messages region came after the messages variable, it might be more confusing. Just trying to think about what happens if somebody copies the blocks in Bartik or Seven into a new theme based on system/Stark. Having the messages region there by default makes it easier for that to work as might be expected.
We'll see if this patch works better. 1,394 errors was not bad for a night's work.
Comment #67
rainbowarrayJust to further explain, the reason for all the test failures was because those tests relied upon asserting text on the page that was in a status message. Most tests are run on the testing profile, which doesn't even have blocks as a dependency. So... having messages in the standard page template avoids that total test meltdown.
Comment #69
rainbowarray27 failures is much more manageable. Will likely track those down this weekend.
Comment #70
xjmSo @mdrummond and I had a long conversation about this issue in IRC, which I'll try to summarize. @mdrummond is working here from the perspective that something that causes 1394 tests to fail (in this case removing the messages variable from the page template) is not acceptable. The reason for these test failures is that when the messages are only available as a block, and block module is not installed (as is the case in the testing profile), the messages no longer appear anywhere. So @mdrummond inferred from this that we should not remove the message from system's base page template -- only from the specific themes' templates. That way, the system messages show up via the page template in Stark.
The point I tried to make is that simply leaving the variable in the system page template to avoid test failures, and not as a deliberate technical choice, is incorrect. Either:
In case 1, leaving the messages in the base system page template may or may not be the correct solution. I'm not offering an opinion there. But in case 2, what we would need to do is go through those 1394 test assertions and update them. Not by adding block to the testing profile. Instead, we would:
Now, I acknowledge that this is a big undertaking. So even if case 2 is what we agree on, then I could see leaving the messages in the base page template for now, and filing a followup issue to fix all those tests. Or we might decide that it's just too big of a change at this point in the release cycle. The point is, though, that we should make the decision for the right reason, and be explicit that we are making a technical or strategic decision, not just as a quicker way to avoid test failures. :) Thanks @mdrummond for your patience discussing this and your work here.
Comment #71
rainbowarrayThere are a lot of tests in core that check the value of a status message that appears on a page in order to determine if the test as a whole or that part of the test succeeds or fails.
Many of those tests are based on the assumption that there are no modules enabled for core.
So if we were to rely solely upon messages in blocks, we would need to go through all of the tests that assume there are no modules and are still trying to check the value of a status message that appears on the page.
It's possible that some of those tests could be reworked to still test what they're testing without relying upon a message appearing on a page to determine if that test passes or fails.
I'm concerned about that approach, because it could require a huge amount of work across a wide variety of systems throughout Drupal.
Maybe that means it's unrealistic to remove messages from the page template because of the incredible amount of work that would be required.
The reason we were looking at removing messages from the page template was because it caused a confusing problem. When messages are processed for the page template, the queue of messages is cleared.
So that means if somebody tried to place a block further down in the source code from where the messages variable appears, there would be no messages that appear in the block.
We previously solved the similar issue of messages only appearing in one block by having the messages block class store the processed messages in a static property on the messages block class, so that multiple blocks could make use of those messages.
That still leaves a potential issue where an unrelated block in a region further down the page from that initial block could generate a message, but it wouldn't appear until the next page, because messages had already been processed.
When messages are processed in the page template, that's near the top of the render stack, so there's a decent chance that all messages from that page will be processed. Although I think somebody tested and found that something in the page footer could generate a message, and it would only appear on the next page. So maybe it's a difference of degree rather than a difference of kind, between showing messages in blocks or in the page template.
I don't know. This was part of the old blocks everywhere issue. My understanding is that there was interest in having these page elements as blocks to be used in a Panels-type situation, and while Layout won't go into 8.0, there has been work restarted on a lot of different parts of layout work. If there's interest in making messages available in a block despite the complications, there might still be some ways we could do this.
For example, we could look at whether we really want drupal_get_messages to clear the messages queue at the moment it's called. Perhaps it could be set to not clear the messages by default, but then we could attach a post render callback to the html render element that clears the messages at basically the last possible moment. That also would allow any block on the page to display messages, no matter where it did so on the page.
The question is for the goals that are trying to be accomplished with the blocks everywhere initiative, is it important for messages to only appear within blocks? And for messages to not show up in the page template? Keeping in mind that that choice means that if there are no message blocks assigned to a page, it's possible for messages to stack up forever (if they're not cleared) or to just not get seen (if they're cleared on each page but not displayed in a block).
This is a difficult problem to solve. And if messages are removed from the page template, it's a LOT more difficult of a problem to solve.
I wonder if it might be worthwhile to split any potential messages block into a separate issue. That would allow the other items that are less problematic—page title, tabs and local actions—to go in now while messages is dealt with (or not dealt with).
The page title, tabs and local actions can be added as blocks without having to remove them from the page template. If somebody wants to put their page title in multiple places on the page, they could do so.
It's possible we'd find issues when we try to remove those items from the page template, but I think we could deal with that in a future page variable removal issue.
It should be noted that removing messages from the page template doesn't solve any issues with performance caching, as it needs to be called on every page load.
It's kicking the can down the road, but I think that splitting off messages is what I'd suggest.
Comment #72
webchickI personally believe we should just always show messages, just as we should always show content. They can contain crucial debugging information and if you don't get it, you can't recover from an error condition you've inadvertently caused. For example, imagine a scenario where you were trying to add the "messages" block to your theme, but the placement of the block failed, but the reason for the failure couldn't be displayed because you have no messages block. :P~ Very, very annoying.
In other words, instead of only hard-coding $messages in a few themes' templates, we should instead just do it everywhere. Or whatever the special trick is that causes the "System content" block to show up even "minimal" profile.
Comment #73
xjmAn additional suggestion from @tim.plunkett is that
block_preprocess_page()could remove the messages variable. That way, you always have to use blocks if blocks is enabled, and there's always a graceful fallback for when it isn't.My one outstanding question for that solution is whether a preprocess function is too late for us to take full advantage of having messages in a separate thing caching-wise (so that we can cache everything but the messages, or asynchronously load messages into a cached page, or whatever). I left @Wim Leers a tell to help clarify this.
Comment #74
xjmAh. That is also a good point...
Comment #75
rainbowarrayDiscussed this further with xjm and timplunkett on IRC.
Tim suggested that ideally we want to have the messages variable removed from the page template, but that it might be ok for it to be there for system/Stark. He suggested that one possible way to deal with this would be to have block_preprocess_page remove the messages variable. That way if blocks are disabled the messages variable shows up in the page template (at least in system/Stark). But if blocks are enabled then the status messages show up in a block.
That seems like a good way to solve the usability issues, as the page variable would no longer be fighting with the messages block.
xjm wondered if having the messages variable in the page template, but removed with block_preprocess_page, would still allow the page to be cached. The page would be mostly a collection of blocks, which could be cached or not on their own. Does the possibility of messages maybe being in the page template prevent the possibility of everything else from being cached?
We're hoping Wim Leers can answer that question.
Comment #76
rainbowarrayxjm and I keep writing the same things at approximately the same time. :/
Comment #77
rainbowarraywebchick: Yes, I had found how the mechanism that makes it impossible to disable content works. So that's possible to do.
Comment #78
rainbowarraywebchick: Oh, also, fun fact. The main content block does *not* show up on the minimal profile.
Comment #79
chx commentedIt seems to me that this issue is making a slowly brewing process to a point: blocks are required. Perhaps we want to split blocks UI off now that we actually have an API to deal with blocks so the UI is not mandatory. Even though SCOTCH failed, BOURBON is coming (you guys with your code names :D ) and perhaps makes it into core in 8.2 and then truly blocks everywhere. Even without that, surely page manager is the future even if it's in contrib.
Comment #80
andypostThe idea about post-render cache should work for messages.
But let's split the issue with messages out, please!
This block could provide a configuration to display only a limited types of messages,
so user can place error and info message block into different places ;)
Suppose messages are rendered last and this needs tests
use
drupal_render_cache_generate_placeholder()hereComment #81
wim leersI agree that the messages block should be handled in a different issue, because it's much trickier than the other blocks. We can easily get the majority of this patch done, and then focus on the messages block in a separate issue.
I agree that
#post_render_cacheis a near-ideal solution for this problem, because then it will indeed run at the very latest point.I think the
block_preprocess_page()think can work, but I can't know for certain without trying. This is similar to #2273277: Figure out a solution for the problematic interaction between the render system and the theme system when using #pre_render, in that it's extremely confusing to reason in your HEAD about the exact flow in which things are rendered, due to the awkward interactions between the theme and render system. The only way to answer this with confidence (or at least the only way *I* could answer it with confidence), is to step through it with a debugger.Comment #82
chx commentedComment #83
xjmLet's file the separate issue for messages now as a postponed followup to this, so we can move relevant discussion there? Thanks everyone!
Comment #84
wim leersI wrote HEAD where I meant head. Consequences of working on core, I guess :P (Also s/think/thing/.)
Comment #85
rainbowarrayI'll open the new issue tonight or sometime this weekend and work on the next version for messages there, as well as splitting off the rest for here, so we can possibly get those in more quickly.
Comment #86
andypostFiled #2289917: Convert "messages" page element into blocks
Patch needs re-roll without messages hunks
Comment #87
rainbowarrayHere is the patch rerolled to just have the title, tabs and actions blocks.
Comment #88
andrewko commentedPatch applies cleanly to current branch head. Noticed that the contextual links are not working on the page title block. It looks like the contextual links data attribute is being duplicated on the block itself and the H1 title suffix.
Comment #89
rainbowarrayNot sure how to fix the page title quick links issue. Not sure if that would block us getting that in, or if it could be handled as a follow-up. If the former, maybe we should split page title off into a separate issue.
Probably will need to look at tabs and local actions again now that the new menu system is going in, to make sure all still works correctly.
Comment #90
wim leersConfirmed. mdrummond asked me to do some debugging to find the cause.
Root cause: the new
block--system-page-title-block.html.twigblock was using{{ title_prefix }}and{{ title_suffix }}as if those are the page title prefix/suffix, but they're the block title prefix/suffix. Hence the same suffix is added twice. Hence this problem.This will either need to do the work to get the actual page title prefix/suffix and pass those to the template (probably as
{{ page_title_prefix }}instead of{{ title_prefix }}, and analogously for the suffix.Finally, while doing this debugging (and after rerolling for HEAD), I noticed that the page title is wrong sometimes: in HEAD, the page title can be overridden by setting
$page['#title']. E.g. in-place editing actively uses this capability to allow the title to be in-place edited. I'm afraid this will have to find a solution for that problem as well, and I don't know if accessing$pageis at all possible… in theory it should be possible though (seedrupal_prepare_page()anddrupal_set_page_content();drupal_prepare_page()invokeshook_page_build(), which includesblock_page_build(), which builds all blocks).P.S.: can any of you link me to the documentation on where the "Twig blocks" stuff is coming from? I'm not finding any useful docs and I hadn't seen that before:
No idea what that means/does.
Comment #91
rainbowarrayTwig blocks like the one you cited above allow you to create a child template that only replaces what is between the start of a Twig block and the endblock. The child template can then focus on only what's different in that specific area of the master template, and if the wrapping content in the master template, the child template automatically inherits those changes.
We first used this technique in the system branding block. #1053648: Convert site elements (site name, slogan, site logo) into blocks
edit: fixing the link to system branding block
Comment #92
dawehnerCan we make a follow up to move the dynamic parts of menu_local_tasks() into the local action/task manager itself?
I am not convinced that this is the right approach. The title is part of the HtmlPage and is collected there. The title resolver just allows you to get the title from the current route, which might be a different one.
Comment #93
rainbowarrayTime to revive this. Now that post render callbacks should be working correctly, we should be able to get this working.
Comment #94
eiriksmThis is just a reroll with some minor changes of #90. Not sure an interdiff would be pretty looking, since the hook_theme part of it had to be applied manually. So just a small list:
- use Drupal\Core\Block\BlockBase; instead of Drupal\block\BlockBase;
- return FALSE on block build in cases where we have no content (so we don't output an empty block).
Setting to needs review anyway :)
Comment #95
eiriksmYeah, and then really setting it to needs review.
Comment #96
joelpittetOne thing that stands out here is that those templates are quite small and single purpose. They feel a bit too granular to be their own templates.
To me these feel more like good cases for a token style replacement in a custom block. Unfortunately I don't have an example to point to for this:(
I do know these blocks can be useful, I use similar pieces with panels everywhere in drupal 7.
The granularity here worries me for performance issues and maintaining micro-templates.
Maintaining these little templates as a themer can be a bit dissociated with the page they are being put onto. Though as a site builder, dragging these around into different regions can be helpful.
Drupal 7 allows this some what with panels or/and tokens, I wonder if something could be accomplished here without the need for the small templates?
Comment #97
rainbowarrayIronically the templates are small because we're using twig blocks so that the templates are more DRY. ;)
If there's not an example of the sort of token-style approach you'd like to see, not sure we want to hold this up on that. Would you be okay if we looked at other options in a follow-up?
This is part of a larger issue of converting all page template variables to blocks, so getting all of these conversions will make it much easier to explain that everything at the page level is a block rather than a variable.
I'm guessing we still need to look at the issues in #90 and #92?
Comment #98
eiriksmYeah. I tried to find some info on how to get the title from HtmlPage, but the patch is more or less a reroll of #90. If anyone can point me in the right direction I'll try to get that in. If that is the right direction?
Comment #99
joelpittet@mdrummond nm, just scared of change and kind of hypocritical of me because I do similar things with panels everywhere... carry on...
I do hope some of those blocks just become specialized menu blocks though for the tasks/tabs etc...
The title one worried me the most because we aren't blockifying the block titles, why blockify the page titles... but I'm sure there is a good use cases, just worry we don't abstract things so far that themers can't find where to change what.
Comment #100
wim leersFrom #1947536-137: Convert drupal_get_breadcrumb() and drupal_set_breadcrumb() to a service by Tim Plunkett in May 2013:
If that's true, we should do it here, otherwise we'll have to open a follow-up.
Comment #101
wim leersComment #102
Jeff Burnz commented@101 - there is a follow up to other blocky issues #2005546: Use branding block in place of page template branding variables (site name, slogan, site logo), we could add it there (a Bartik issue), from what I can tell at a quick glance at the current bartik page template it would need at least one more region (for this patch, it also needs another for messages block when that lands), as for Seven I don't know how everyone wants to handle it, because it's the admin theme maybe it needs to build its own variables in preprocess and use those rather than blocks (it does this with primary_local_tasks and secondary_local_tasks).
Comment #103
wim leersComment #104
eclipsegc commented#102 sounds an awful lot like asking for layouts in core.
Comment #105
rainbowarrayThis isn't full-on layouts in core, just the blocks everywhere part.
Comment #106
wim leersExactly!
Comment #109
Jeff Burnz commentedAs we know breaedcrumb is a block already so just updating title.
Do we need the justification for beta inclusion for this task? I assume not since this has always been part of the overall plan of having everything as blocks.
Comment #110
wim leers#109: but it's not actually used yet… That's why I added it. See our discussion in #100/#102. If you want to do it elsewhere, that's fine, but currently it's being forgotten.
Comment #111
Jeff Burnz commentedSorry Wim, I missed that, the issue afaict is being addressed here: #2306407: Remove breadcrumb from page template
Its all getting a bit messy really, I putting together an overview for myself of all these issues to get some perspective on exactly what needs to be done with all these conversion issues.
Comment #112
wim leersJeff Burnz++
Comment #113
Jeff Burnz commentedHas landed, what do we need to do here?
I can get a strait re-roll mostly working except for the Actions block, assumed something changed here but I have no real clue what.
The page title block appears to have some issues (#92?), e.g. does not appear on admin/content or node edit pages, different on pages such as node/1/outline.
Comment #114
wim leersNow that access results include cacheability metadata, it's now possible for that todo to be replaced with logic that indicates whether the tab on the current page are cacheable or not. It needs to be cached per URL (since the tabs on each URL may be different), so
cache_context.urlshould be used as a cache context, and then the cacheability metadata for the access checks associated with the routes associated with the tabs need to be used.Comment #115
rainbowarraySo just to recap, we need a reroll, plus addressing concerns in #90 and #92, and we may need to include breadcrumbs as well?
Comment #116
rainbowarrayNever mind the last part, now I see that is being taken care of in #2306407: Remove breadcrumb from page template.
Comment #117
Jeff Burnz commentedAnd titles, e.g. in View pages the current method does not work, I'm not entirely sure how we are meant to retrieve a title for views, I looked in the Views module and tested with the following, however I'm not sure if there is an overall better way of doing the titles:
Comment #118
manuel garcia commentedStraight reroll of #94.
Comment #120
manuel garcia commentedOops... here we go again.
BTW, for Banana phase 2, this patch currently adds these new twig files to system:
Comment #122
mortendk commentedComment #123
manuel garcia commentedOf course if you fix the error, but don't save the file.... sigh
Comment #124
tim.plunkettMight as well use [] these days (here and throughout the patch)
Please wrap this function in a protected method
Instead, use the route_match service
#2287071: Add cacheability metadata to access checks went in last September.
Also wrap this function in a method, and don't call it twice
Comment #125
manuel garcia commentedAttached patch fixes point 1 from #124.
I cant see the blocks showing up on
/admin/structure/blockpage though :/At the moment the patch only introduces the new blocks, so there's plenty to be done here still besides what's mentioned on #124.
Comment #126
manuel garcia commentedSome notes on this patch:
title_prefixandtitle_suffixpage variables, since the page title is a block with this patch.Done:
title,action_linksandtabsvariables fromtemplate_preprocess_page.Test bot should start spitting out failing tests now.
Comment #128
Jeff Burnz commentedCan't say for Seven, but I don't think we need new regions for these blocks, these I think can all go in main content region, except as mentioned for Seven which Lewis will have to chime in on. I'd really hate to see us put in regions specifically for a block like this.
Comment #129
manuel garcia commented@Jeff Burnz I tend to agree with you.. I have done it like this just to follow what's been done for breadcrumbs etc. so far.
We could discuss whether to do as you suggest, or to do so in a follow up, cleaning up unnecessary regions - which would take longer I suppose...
Comment #130
mortendk commented@jeff +1 on that, maybe thats a followup issue, with breadcrumb we kinda pulled the tricker to get it cleaned out - i guess it would make sense to go back & do some housecleaninng on all regions on the page, maybe a follow up :)
Comment #131
manuel garcia commentedSome progress on this:
Comment #133
manuel garcia commentedSome more cleanup:
primary_local_tasksandsecondary_local_taskssince we no longer have a tabs variable.title_prefixandtitle_suffixsince we no longer have a title var, so they will always be empty in twig. If we still want these we should probably implement them as part of the title block.Comment #135
manuel garcia commentedPoint 2 on #92 is something I need help with... I am seeing different titles on some routes (like when you delete a block from the manage blocks page). Fixing this will fix some of the failing tests as well.
Comment #136
manuel garcia commentedForgot to mention before that the blocks now show up on the admin interface properly, and that they are assigned, and working upon install on both seven and bartik. The title block still needs to be looked at as per my previous comment.
Comment #137
wim leers#135/ #92.2: the problem is that it's in rare cases in fact necessary to let the content associated with a route generate the title.
From
HtmlRenderer::prepare():The only way to solve this is by doing something like we did in #2363025: Push usage of drupal_set_page_content() higher: out of blocks and page display variants to support a block containing the main content: we added
MainContentBlockPluginInterface, now we also needTitleBlockPluginInterface.Adding that.
Keep up the good work :)
Comment #138
wim leersComment #140
fabianx commentedTo fix tests properly we need to do the same I think for local tasks and actions as for title and messages to have fallback states ...
Do we really want 5 interfaces for that?
It seems the cleanest however ...
Comment #141
wim leersLet's first get #2289917: Convert "messages" page element into blocks in, since that one is very close to RTBC and will conflict with this. Postponing this one.
Comment #142
wim leers@manuee pointed me to #2005546: Use branding block in place of page template branding variables (site name, slogan, site logo), which hasn't gotten a comment in >4 months. We should finish that one too.
Comment #143
wim leers#2289917: Convert "messages" page element into blocks landed, this is now unblocked!
I think it may be wiser to first tackle the page title, and then tackle actions & tabs. The page title is more complex, because it's very dynamic: it comes from the route by default, but may be overridden by the main content. Thoughts?
Comment #144
fabianx commentedYes, lets split off page title off this, so it can be independently reviewed.
Comment #145
manuel garcia commentedTrue the page title is its own little beast. +1 on working separately on it.
Comment #146
manuel garcia commentedComment #147
manuel garcia commentedHere is the last patch #137 rerolled, but without the title stuff, so only tabs and actions.
Let's see what the bot has to say, hopefully I did not forget anything.
Next steps:
Comment #148
manuel garcia commentedOK I've split the title part into its own patch, have a look here #2476947: Convert "title" page element into a block
Let's continue to push this forward! -=]
Comment #149
manuel garcia commentedoops
Comment #151
joelpittet@Manuel Garcia great idea, thank you for splitting and re-rolling.
Couple of items I spotted on a drive by review to help find that PHP error:
This looks like the culprit!
Nit: short array syntax.
Nit: Space after the 'if'.
Comment #152
manuel garcia commentedThanks a lot for the quick review joelpittet!!
About your point 2, I did not use short array syntax on system_theme because the rest of the implementations there are not using it... perhaps worthy of a cleanup issue, I just didn't want to create syntax noise there for now.
Fixed the fatal error (1) and your point 3.
I have noticed that with this patch, after running a clean install, the tabs don't show up until you've
drush cr... very strange, but something we should look into. Setting this to needs review for the bot to chew on.Comment #153
wim leersThank you so much to get this going again! :)
Is it "Page actions" or "Page local actions"? Or just "Actions" or "Local actions"?
s/Stores the/The/
The local action manager.
Should typehint to the interface.
Should match the above.
So this is the body of
menu_get_local_actions().That means we should also remove that function from
menu.inc.$action_linksis not markup, but a render array. Hence this assignment doesn't make sense. It should be:::isCacheable()doesn't exist anymore. What you want, is::getCacheMaxAge().But… actually, this is now cacheable, because #2287071: Add cacheability metadata to access checks already landed.
\Drupal\Core\Menu\LocalActionManager::getActionsForRoute()contains this:Instead, you want to change that to:
That will make sure the necessary cacheability metadata is present.
1) you call the same function twice.
2) the assignment to
#markupis wrong again.Similar to remarks above.
Ah, so this is why it worked at all: this was assigning the value of
#markup. Just omit these now :)Duplication. Should get the
<nav>twice.Duplication again.
And again.
Again.
Comment #155
joelpittet@Manuel Garcia re #152 It's a tricky problem, we want short array syntax but creating issues for that causes other issues to unnecessarily re-roll. So the compromise to clean that up and move forward is to update diff hunks that have changed or added to the new short array syntax. That way it will move towards to goal without unnecessarily disrupting other patches needlessly.
Comment #156
manuel garcia commented@Wim Leers Awesome thanks for the review! Here's some progress on your input:
1. Yep, that was confusing, I've updated the comment line to be coherent with the translation string.
Provides a block to display the page local actions. > Provides a block to display the page actions.2. I'm not sure I get what you mean here, i did this...
Stores the configuration factory. > The configuration factory.3. OK done
4. This is what you mean right? I am actually starting to understand OOP I think.
5. OK done, did it as well for the local action manager.
6. OK nuked.
7. Right, done.
8. This is a tricky one. I've done the following, hope it makes sense (this is all new to me):
9. Yup, done.
10. OK I did this, trying to follow what I did for point 8, hope it makes some sense:
11. Right! Done.
12, 13, 14, 15. Good catch, fixed.
@joelpittet ok fair enough, changed those to short array syntax.
Comment #158
joelpittetIsn't the region's named tabs and actions? This may be the failure?... just a guess
These should check
isset()if they aren't always expected to exist because that will throw notices the way it's written OR if they are always expected, just set the action_links/tabs in one line because''/NULL/array()will all print the same nothing in the template.Comment #159
manuel garcia commentedAwesome @joelpittet thanks!
1. That was it. After fixing that the tabs appear on fresh installation just fine.
2. Makes sense, changed them to one liners.
Comment #161
xjmThanks @Manuel Garcia and @joelpittet for keeping this issue going!
We should probably do a detailed beta evaluation on this.
Comment #162
manuel garcia commentedFurther info, the tabs appear on the user/ID page, but not on the node/ID pages... cant figure out why.
Comment #165
borisson_Rerolled the patch, there were conflicts in the following files:
- error: patch failed: core/themes/bartik/bartik.info.yml:24
- error: core/themes/bartik/bartik.info.yml: patch does not apply
- error: patch failed: core/themes/seven/templates/page.html.twig:64
- error: core/themes/seven/templates/page.html.twig: patch does not apply
Comment #166
borisson_Comment #167
bill richardson commentedApplying patch to latest head - after enabling actions or tabs makes site unusable -- If patch applied before new installation , fails after last installation step.
Comment #171
lauriiiI'm working on this.
Comment #172
lauriiiNo, this doesn't need review :P
Comment #173
lauriiiLet's see how many test fails we get with this
Comment #175
lauriiiThis should fix at least one kind of fatals. Lets see if there is more to fix
Comment #177
lauriiiMore fixes for fatal errors
Comment #178
wim leersThank you so much for taking this one on, @lauriii!
Comment #180
lauriiiComment #182
lauriiiThe local tasks seem to be quite broken right now. There is $level parameter on the menu_local_tasks() and inside the function the $level variable is being set inside foreach to something else before data is being read from the cache (WTF!). Might be even worth fixing in another issue.
Anyway most of the test failures are because of missing tabs / actions.
Comment #183
pwolanin commentedThis looks like a new feature - please do the beta evaluation.
Comment #184
dawehnerIn general this looks great.
This issue has been part of an approved larger meta since always, let's not demotivate people
If we talk about the cacheablity, this could be also seen as bug.
I'm confused, how does that even work? I thought we no longer add them?
In none of those two examples I understand why we need the config factory
The proper way to do it is now to use the route match, which has a getRouteName() method. This probably was a result of earlier versions of the patch
3> 3> 3> !Twig love! <3 <3 <3 <3
unnecessary :)
Comment #186
lauriii#184.1: It works because page.tabs is the region ;)
Comment #187
davidhernandezThis should have a change record for the conversion of any elements into blocks, and cover any significant changes to the page template.
Comment #188
pwolanin commentedCan we have details about the cachability bug in the issue summary?
Also - taking a quick look at the patch, it would seem you should include the language as a cache context for the block if that has the rendered tab that may be localized?
Comment #189
lauriiiSo there was a probelm with Seven because it requires separated blocks for primary and secondary tabs. I made the block configurable so that the user can select which tabs it wants to print. I think I also addressed #184.2,3,5
Comment #190
lauriiiSetting tags back
Comment #192
lauriiiThanks @Xano for helping me on sorting this out. There is follow-up created for the lacking documentation: #2510912: Document how to expose block plugin schemas on BlockPluginInterface
Comment #193
wim leersNot necessary, see #2453059: Set default render cache contexts: 'theme' + 'languages:' . LanguageInterface::TYPE_INTERFACE.
Comment #194
lauriiiComment #195
lauriiiAdded beta evaluation that I accidentally removed
Comment #197
tuutti commentedFixed some failing tests
Comment #199
lauriiiThis should go down to only few failing tests now
Comment #201
lauriiiComment #203
fabianx commentedAlso helps with performance as we can potentially make those blocks cacheable.
Comment #204
lauriiiWe should be gree-ee-ee-n!
Comment #205
wim leersOhhhhh! Almost there :)
EDIT: cross-posted with #204: OMGGGGGG!
Comment #207
lauriii$times_lauriii_has_had_green_patch_when_he_has_said_so = NULL;Comment #208
wim leersYAY!
This does not actually work until #2487600: #access should support AccessResultInterface objects or better has to always use it lands.
For now, you'd have to do a bit more work: first assign it to a variable, then set
#accessbased on that, and finally, merge the access result object's cacheability metadata with that of the render array.Basically:
Wouldn't "Local actions" or even just "Actions" make more sense? It's not called "Page actions" anywhere, except here.
These parts are actually wrong now.
We still want max-age = 0, but for a different reason: the dynamic local actions/tasks hooks unfortunately do not specify cacheability metadata. That's the current reason.
That can be fixed in a follow-up (we should open that issue and link to it), but is out of scope to fix here.
Finally, this missed the
route.namecache context.Nit: Too many newlines :)
Similar remark as above.
Similar remarks as above.
That "1" looks like a typo :)
Comment #209
lauriiiAdded novice task for the change record.
#208.2, 4-8 done
#208.3 I changed them to be called "Local actions" and "Tabs". "Local tabs" doesn't make sense and "Local tasks" is not good for the end users. I also want to keep sanity between the machine name and name used on UI.
Comment #211
lauriiiJust a simple reroll because I had a little old repo
Comment #213
lokapujyaMinor: The comment is now wrong; It's not the first edit link.
The order changed because the tab block is placed before local actions. It might be better if the test didn't rely on the order and if we could more directly click the edit tab.
Comment #214
lauriiiComment #216
lauriiiTrying to get used to phpstorm without separated visual and insert mode seems to be hard for me :D
Comment #218
lauriiiWe should be green again
Comment #219
lauriiiComment #220
lauriiiCreated change record
Comment #221
lauriiiCreated follow-up: #2511516: Make local tasks and actions hooks provide cacheability metadata, to make the blocks showing them cacheable
Comment #222
lauriiiComment #223
lauriiiFixed some nits on the documentation
Comment #224
fabianx commentedOverall looks great! :)
Some notes (might be x-post):
Docs are wrong ...
page.tabs
and
page.actions
It feels a little inconsistent to once have this in the block and once not.
The reason is classy I assume?
Comment #225
lauriiiThanks for the review Fabian!
#224.1 Patch on #223 addresses that :)
#224.2 Its region and blocks but we need to add two of them because Seven wants to show primary and secondary tabs in different locations. Maybe #189 interdiff explains this.
Comment #226
fabianx commented#225: That is right, but why not add the same block template and extend the existing single-block-case one via twig extends?
Comment #227
fabianx commentedBesides that question that can be follow-up as markup is not frozen => RTBC
Comment #228
davidhernandezShouldn't Classy version of all these templates be added, especially since a CSS class is being added in the core version which should be in the Classy version instead.
Comment #229
xanoThis really quick and short review is powered by Dutch public transport.
The service bit is misleading. Dependencies can, but are not always also registered as services.
Same here.
Must we say this is a block, or can that be derived from the context?
Whether primary tabs are shown.
Whether secondary tabs are shown.
Call them local actions here as well?
Same here.
because hooks (no of)
don't (no doesn't)
This seems somewhat technical to mention in the UI. Would it suffice to just say the block isn't cacheable?
Add this to-do to the disabled caching form element as well.
local tasks
Local tasks here as well? Maybe we call them tabs in the UI these days (although that casts judgment on how these tasks look)
Local tasks or Tabs (depending on which one we go with).
Also add this to-do to the disabled caching form element.
It's not just any object used for testing, it's the class under test. I have started naming properties that contain classes under test
sut. Maybe that would improve the readability here as well?are not
Comment #230
lauriiiFixed #224.2 & #228 & #229
#229.3: its there for sanity. All the other block configs are doing it too so it doesn't make sense to break that rule.
#229.13: they've been called as tabs which is confusing everywhere on the theme layer so it makes sense to not change that on this issue
I also tested the patch visually and it seems to not have visual regressions on either Bartik or Seven.
Comment #232
lauriiiOops, forgot to remove hook_theme hack from the system module
Comment #233
bill richardson commentedLooks okay in Seven but seems to have lost styling for tabs in bartik.
See attached images.
Comment #234
bill richardson commentedMore investigation with twig debug activated --- we are not using the correct template in seven or bartik -- using the default block.html.twig instead of specific template for theme.
Comment #235
lauriiiThis should fix the visual regressions
Comment #236
wim leersThis is looking great! Only small things :)
Still the old names.
Let's add a @todo here, pointing out that this crazy dance and dependency on Renderer can be removed once https://www.drupal.org/node/2487600 lands.
1) similar @todo as above
2) the value for #access is not a boolean.
Old name.
Let's link to an issue.
Copy/paste error :)
Old name.
Let's link to a follow-up issue.
"Tabs" vs. "Local tasks"
s/print/show/
s/second/second level/
Old names ("page")
s/Tabs/tabs/
Comment #237
lauriiiThanks a lot for the review! Fixed #236
Comment #238
wim leersManually tested. Works perfectly. Did another round of review, from a theming POV.
Points 1 through 3 are for a follow-up. Could you create a follow-up for that? They will greatly improve the site building experience. Only point 4 still needs to be addressed here.
Note that this means we can combine these four different regions at last! It means no more insanely many regions, instead… just a few regions, and the order of the blocks mattering :)
Same here!
And here!
This is wrong.
Comment #239
wim leersShould be 2511516.
Comment #240
lauriiiFixed point #238.4 and #239, good catch!
Created follow-up: #2512326: Clean up regions in Classy & Bartik
Comment #241
wim leersThanks for creating #2512326: Clean up regions in Classy & Bartik!
No more remarks. Great job :) Back to RTBC. (First RTBC at #227.)
Comment #242
davidhernandezThe Classy templates shouldn't have these comments. They should say "Theme override for..."
@ingroup should not be there either.
It looks like the templates were moved to Classy, not copied. Are core versions of block--system-local-actions-block.html.twig, block--system-tabs-block.html.twig, etc not needed now?
Comment #243
lauriiiFixed :)
Comment #244
fabianx commentedBack to RTBC
Comment #245
davidhernandezNitpicking now, but...
The system module templates would keep the "Default theme implementation" since they are being registered in system_theme(). Only the Classy ones are changed to say "Theme override" since they are overriding the system module templates.
The * ended up at the end of the line above.
Comment #247
lauriiiFixed the failing tests and nits from #245
Comment #248
fabianx commentedAnd back to RTBC! Only 51 comments left till #300 ...
Comment #249
davidhernandezCan we feed
action_linksandtabsintocontent, instead of creating new variables, since the only thing happening in the templates is replacing content with those variables? Then we wouldn't need to templates, right?Comment #250
lauriiiComment #251
fabianx commentedStill RTBC, nice work!
Comment #252
davidhernandezLooking this over again. Overall, everything looks great, but I have a couple nitpicks and one concern.
These comments about variables in local actions and system tabs templates are now wrong. The variables do not exist. You have access to the parent template variables, but I don't think we need to copy them all from the block template. That seems like overkill. I would just delete the whole variables section.
The regions listed in the top comment of all the page templates are no longer in order. They should all be in the order they are printed in the template. I think even some that were already there might have been out of order. Lets fix that.
Lastly, I have a concern about the action links being exposed to users in the Block UI. This is what people will see:
Breadcrumbs. Ok. Tabs. Ok. Content. Ok. Actions? Local actions? What is that? Given all the UX testing that happened in Twin Cities, I could definitely see this being a "huh?" for people. Should we rename this or at least make it a little more obvious what someone is affecting if they move/disable this block?
I didn't see if this was discussed already, so if it was, please correct me. I'm tagging for product manager review just to get a sanity check on that.
Comment #253
lauriiiBlock UI doesn't support creating additional description texts for blocks which makes it hard to provide any extra info. I'm not sure if tabs should be tabs on the UI but did that because it was called to be tabs previously in the templates. If we rename local actions to something else, how people knowing what local actions are is supposed to be able to find them from the UI if we change it for something else?
It would be nice If anyone else has any suggestions what else local actions because I don't have any. Also tagging the nits to be worked by a new contributor.
Comment #254
wim leers#252: IMO that goes back to the long-standing problem that our Block placement/layout UI sucks. What we really need here, is live previews (or at least approximate previews). That's the only way this can be solved with elegance, without burdening the user with piles of text. :(
Comment #255
dsnopek@Wim Leers: This doesn't help core, but as part of SCOTCH and porting Panopoly to D8, we're planning to implement block previews (like panopoly_magic does in D7) in CTools for D8.
Comment #256
Bojhan commented@laurri That is on purpose, if you need descriptions for this - we are in more trouble. You shouldn't need it.
This will definitely cause usability regressions. What I don't understand is that things that are in the content body (breadcrumbs, local actions, tabs) need to be in separate regions on the blocks page.
Comment #257
lauriii@Bojhan: Thats what we're doing right now but we have a follow-up to fix that. It's not in the scope of this issue!
Comment #258
wim leers@Bojhan: see #238 + #241 about that.
Comment #259
davidhernandez@Wim, my concern is not about placing the local actions block. I'm concerned with presenting people with something they may not understand. All of the other blocks they can intuit to some degree or another, and look at their site to understand what they are affecting. Tabs, breadcrumbs, menus, etc. But, how does a site builder figure out what the local actions are, especially since they haven't been presented with this before in Drupal? I'm not even sure if there are any you can see in Bartik out of the box.
Comment #260
Bojhan commentedI am quite concerned that we are making this problem, even larger. I know its simply exposing the problem.
However we want to avoid creating this lump of "artificial - not critical, but must fix before RC, issues". That will not get us closer to release. I think we should at the very least have a solid followup plan, if we decide to push this in. Personally I prefer to commit this, without introducing a usability regression - we shouldn't be doing that this late in the release anymore.
Comment #261
Bojhan commentedComment #262
lauriii@davidhernandez: I know it makes it hard to understand in some cases why they are there. But the situation is the same if they look the template. There's lots of thing being printed directly and people might not know where its coming from. Also removing local actions or local tasks from a custom theme might not have big impact if admin theme is being used. I don't also think that there's many people changing blocks being shown on the admin theme.
Comment #263
lauriiiFixes #252
Comment #264
lauriiiProfiled this when tabs and actions are being cached:
http://www.lionsad.de/xhprof-kit/xhprof/xhprof_html/?run1=55919cdb0fed9&...
http://www.lionsad.de/xhprof-kit/xhprof/xhprof_html/?run1=55919cdb0fed9&...
Comment #265
effulgentsia commentedRe #256/#258: is #2512326: Clean up regions in Classy & Bartik only about removing the regions being added by this issue? In which case, why split it like that instead of making this issue work with the existing regions? Or, is #2512326: Clean up regions in Classy & Bartik about cleaning up regions that are already in HEAD, in which case, why is that a pre-requisite to not adding more temporary regions here?
Comment #266
lauriiiIts about cleaning up the regions already in HEAD. Problem is if we would do this now, it would be inconsistent between themes and core. But if we want, we could fix this in system module but not in themes.
Comment #267
bill richardson commentedI think the question is why create the new regions for seven in this patch --- tabs and actions can just be placed in the already existing content region in seven ---- you just have to make sure that the blocks are placed in the correct order.
Comment #268
lauriiiIn the seven there is no suitable region for primary tabs or secondary tabs. Secondary tabs could be placed on breadcrumb region but does it make any sense? Local actions could be placed on content region.
Comment #269
wim leersI put the numbers of #264 in the IS.
@lauriii: which page is that (I suspect front page), and which user (I suspect the root user).
Comment #270
lauriii@Wim Leers its block management page which has action links, primary tabs and secondary tabs. Tested on anonymous user. Warm caches but internal page caching turned off.
Comment #271
wim leersGreat! IS updated.
Note that is an expensive page, and even then, you see a 5% improvement. So it's likely even more (i.e. higher percentage) on cheaper pages.
Comment #272
lauriiiLocal actions -> action links. I also added local actions into content region in seven and bartik and removed tabs and local actions regions from system module and classy and attached blocks to content region.
Comment #274
lauriiiJust fixed the tests
Comment #275
bill richardson commentedA great job but just a few points i noticed during review -
You have still left an actions region in both Bartik and Seven although not used.
You could do without creating a tabs region in Bartik -- could be placed in content region ?
I would prefer a more neutral named region in Seven to hold both primary /secondary tabs, rather than precise named regions to reflect what blocks are placed there ( this was a concern raised by the usability study ) eg
header or page-top,etc.
Comment #276
lauriiiTabs cannot be placed to content because help region is between tabs and actions.
In seven we should convert the regions to be better in the follow-up because it could be done by merging breadcrumb and secondary tabs together.
Comment #277
bill richardson commentedhappy to leave region renaming to a follow up issue - this should now be okay to implement.
Comment #278
fabianx commentedRTBC + 1
Comment #279
Bojhan commented#260 is not adressed.
Comment #280
fabianx commented#279: Well, I don't think new regions are introduced anymore except for when needed, so I don't think this is a huge UX regression anymore?
Do you feel different about that?
Comment #281
fabianx commentedNeeds reroll if simplytest.me is right
Comment #282
lauriiiJust a small reroll.
#279: Can you point out the specific UX regressions that are being made here that haven't been addressed? Or is it just the idea of moving things into being blocks?
Comment #283
davidhernandezLooking this over again. So I suggested the change to "Action links" hoping that would be a little more sensical. It's not brilliant, but I think it works a little better. I'm glad we don't have additional regions now for default core and Classy. Tabs and actions are in 'content'. Actions are also now in 'content' in Stark and Bartik, without any apparent visual regression.
So where we stand is the addition of a 'tabs' region in Seven and Bartik. I think we should get sign-off from Seven and Bartik maintainers before committing this. Otherwise, because there is only one region being added now, I'm less concerned about having to clean up regions in a follow up.
Comment #284
fabianx commentedAssigning to webchick for 'product manager review'.
Can someone ping Emma and Lewis?
Comment #285
Bojhan commented@laurri Can you chat me up on IRC? Lets review it quickly.
Comment #286
lewisnymanHey, great work going on here :) Thank for pinging me. I'm glad I had a chance this because we are making a similar mistake that we made on #1869476: Convert global menus (primary links, secondary links) into blocks where we are name the region after the content we expect to be placed in it. This is not a best practice because you can put any content in a region. It was also found to be confusing for users during out formal usability study. We opened an issue to change this here: #2513526: Rename the menu regions.
I don't mind if it's pre_content or something, as long as it's not a describing the content within it.
Comment #287
davidhernandez@lewis, it looks like that issues is moving towards header_first _second naming to replace the menu regions. Is that your preference?
Comment #288
wim leersStraight reroll. Conflicted with #2512866: CacheContextsManager::optimizeTokens() optimizes ['user', 'user.permissions'] to ['user'] without adding cache tags to invalidate that when the user's roles are modified. Resolved a conflict; the code in that conflict became simpler thanks to #2512866 (the node grants cache context is no longer optimized away as of that issue).
(lauriii is on vacation ATM AFAIK, so let's keep this going.)
Comment #289
wim leers#2487600: #access should support AccessResultInterface objects or better has to always use it has also landed in the mean time, so the patch can be simplified further.
That helps shave off some 6 KB from the patch too :)
Comment #290
wim leers#286:
That then means we must merge these 3 regions together:
tabs,helpandcontentneed to be merged together to justcontent.lauriii was trying not to do that here because it is technically out of scope.
Do you want us to do that here?
Comment #293
wim leersFixed the failures.
Comment #295
wim leersOops. #293 was diffed against
HEAD^, notHEAD.The #293 interdiff was correct though.
Comment #296
lewisnymanYeah, I think that follows the pattern with the other regions.
@Wim If we can merge the regions without causing any visual regressions, then I think this is a good proposal. I don't know if it logically fits within the scope of the issue, I'll leave that call up to you.
Thanks for the hard work!
Comment #297
davidhernandezEmphasis added. What exactly prompted this comment? I'm not entirely following along with the code changes you made, Wim. Is there a technical reason now why they have to be merged?
To agree with Lewis, we do not particularly like these regions, but the visual regressions in Bartik is the real issue. We can try to fix that here, but it may delay the issue considerably. I think Lauri said the tabs were the biggest problem, if I remember right, but I haven't tried it.
Comment #298
wim leersIt was a pure response to Lewis' comment in #286, where he said:
So, I was merely applying that reasoning to the current patch. The part I quoted in #290 was and still is in the current patch; that's the part of the patch that would have to change if we were to do what Lewis is asking. The patch adds the
tabsregion, and Lewis would like to not add that new region. So, consequently, that means not adding a specific region: it means either renaminghelpstopre_content(like Lewis suggested), or merginghelpandcontenttogether intocontent(like I suggested). Note that we can do that only now, because only nowhelpbecomes adjacent tocontent!The changes in the patch are completely independent from Lewis' review! I haven't addressed Lewis' review yet — all changes I made are just to get the patch green & clean again :)
No, not a technical reason, but merging them follows from what Lewis is asking for AFAICT.
Comment #299
davidhernandez@Wim, oh ok. I missed your link to #286. I thought you were saying that because of the changes in the issues you linked to that there was some cache-based reason why we need to merge the regions. I thought that seemed funny.
Comment #300
wim leers#299: oh, heh, sorry for the confusion.
But, now that we're talking anyway: what are your thoughts on my response to #286, i.e. my proposal in #290 & #299?
Comment #301
davidhernandezSo may original hangup was with some of the regions being added and the block names. Where we stand now, no new regions are being added to core, which is great, and we have blocks called "Tabs" and "Action Links". I'm ok with "Action Links" until someone can come up with a better name.
That leaves the addition of primary_tabs and secondary_tabs regions in Seven and a tabs region in Bartik. I'm not sure where Lewis stands on those regions for Seven. I think the header_first _second comments were about Bartik.
The changes in this patch are only adding one region, so if we merge tabs and help into content we are getting rid of a region that already exists. I'm just mentioning that for clarify. Looking at Bartik, there is only one bit of CSS for help, but a fair bit for tabs. That will likely take some work to refactor.
If we merge the regions in Bartik, then we don't have to worry about what regions are called what. We just have to deal with Seven.
Merge or no merge, we're left with two questions. Are those regions ok in Seven, and is it ok to add blocks called "Tabs" and "Action Links". I think the second is a webchick or webchick/Bojhan question.
We might want to screenshot what merging those regions in Bartik looks like to see how difficult a change it will be. And when I say difficult I'm thinking less about the physical work and more about how long it could delay this issue.
Comment #302
davidhernandezHmm so I just played with this a bit and moved the "Tabs' block into the content region. I did not notice any visual regression. And looking at the CSS, it looks completely agnostic to its location. Is the only issue that "Help" is normally below tabs so we'd have to move both? What is an easy way to make help text appear in Bartik?
Comment #303
wim leersUpdate a node.
Comment #304
davidhernandezIsn't that a status message, not help text?
Comment #305
wim leersEh, yes. I don't know what I was thinking. I looked at every single
hook_help()implementation… and I don't see any help for a non-admin route.So, the only way that I know of, to see a Help block in Bartik is to actually make Bartik your admin theme.
Comment #306
berdirYou can configure if node add/edit should use the admin theme and you can take the permission away from a user to see the admin theme.
Comment #307
davidhernandezThis is what I'm seeing before and after the patch and moving Tabs and Help into the Content region.
I'm not seeing any troubling visual regression. The border and padding is lost because the help CSS is specific to the region, not the block. That is an easy fix.
So, yeah, lets merge it. The result should be more shippable, without needing a followup.
Edit: I had the images reversed.
Comment #308
webchickI'm honestly not sure why this is assigned to me. It seems there's plenty of other feedback that still needs addressing. Happy to look once Bojhan, Lewis, et al feel good about this patch, though, or if you think I have something specific to offer, feel free to let me know.
A general note that found the issue summary confusing because it mentions "All the page elements (title, tabs, actions, breadcrumb, messages) are hardwired to core and contrib themes alike" but the patch itself seems to only deal with action links and local tasks? That seems like an odd place to draw the line; the site building benefits would obviously be much greater with something like site name / logo. So maybe adding some more rationale as to why that's being prioritized here.
I will also say that I am generally very nervous about how late in the cycle this big of a change is being proposed, especially given that it's only a small part of the fix to the overall issue of hard-coded theme variables. It leaves me with a lot of questions:
- Do #2476947: Convert "title" page element into a block and #2005546: Use branding block in place of page template branding variables (site name, slogan, site logo) get us the rest of way there... or are there other required follow-ups?
- What is the likelihood those two get done quickly (in the next couple of weeks) if this one gets in?
- Where will that leave Drupal 8 if they don't get done?
- Can we do those changes in minor releases? (If so, presumably we could do this one as well, so why push this in now?)
- A 5% performance boost is nice, but the block admin page is one that typically only user 1 has access to. Can we show a similarly strong improvement on e.g. a full node page, which would affect a lot more people? That would make it easier to justify the "impact vs. disruption" here.
Also, in scanning through the patch briefly, I didn't see any update hooks, which surprised me. We should check to ensure that existing sites won't lose their local tasks / action links once they do a beta-to-beta upgrade.
Comment #309
dawehnerTo be clear, that was not about the block admin page but rather about the actual site.
Comment #310
gábor hojtsy@webchick: the related issues list is chock full of other issues where the other things are converted, the issue summaries were written at the same time. Eg. site logo, slogan and name was added as a block in #1053648: Convert site elements (site name, slogan, site logo) into blocks. Unfortunately the main site logo/slogan/name display was not replaced with a block, it was just another block added. The replacement was deferred to #2005546: Use branding block in place of page template branding variables (site name, slogan, site logo).
Comment #311
davidhernandez@webchick
- I believe those two issues are the last of it. And I think the change in this issue now no longer needs any follow up. We'll make sure the others get done without needing follow ups as well.
- No idea. I've stopped pretending to predict core development progress. But, if I remember correctly the "use branding block" one is almost done. We need to fix some Bartik CSS. The page title one is further from complete, but more attention has been on this one and the "branding" one, so it will get attention when this one is done. (Plus, it's converting only one element instead of a group.)
- I don't think any of the changes leaves us in a broken state. They're all individual changes, so any that don't get done just leaves us without those particular improvements. If we get this one in, but don't get "title" in, we're just left without title converted. It's not all or nothing.
- These changes can't be pushed to a minor release because they require changes to the page template. It is my understanding that all templates are frozen in a release, because changing them would be equivalent to breaking an api.
- See #309
I added the product manager review tag because I wanted to make sure that the blocks and regions we are adding are ok. But, things have actually consolidated quite a bit and avoided adding new default regions. My one open question is about the local actions. That is converted to a block, but I think presenting it to a site builder with that name is a bit problematic. I suggested changing it to "Action Links" as a slight improvement, but I don't know how much clearer it is what that is. What is your opinion on its name?
Comment #312
webchickThanks for the responses.
Oops, right. I forgot we already added the site name / logo / etc. (I searched in the filter for "logo" but that obviously didn't bring up "branding" :)). So it's really only title that would he the outlier then, that's nice.
Regarding minor releases, I think if there was a way to keep the region name the same or something that didn't necessitate changes to page.twig.html, we could do it. However, I see that this is getting legitimate pushback in this issue on this specific case, so attempting to do it pre-release makes sense.
I'm still confused about the performance numbers, and #309 doesn't really clear it up. The issue summary explicitly says "(block management page which has action links, primary tabs and secondary tabs. Tested as anonymous user. Warm caches but internal page caching turned off.)" If that's incorrect, or if there are other numbers somewhere else more public-facing that aren't in the issue summary, could we get that clarified?
I agree "Local actions" seems like a totally confusing Drupalism, so posed a question on Twitter to see what non-Drupal people would call this part of the page: https://twitter.com/webchick/status/621734527493234688
Comment #313
webchick...which promptly attracts responses from Drupal people. :P LOL
Comment #314
wim leersBecause this patch far, far predates the "update path required" policy that went into effect ~2 weeks ago.
Also, because this touches block config entities, just like the critical #2528178: Provide an upgrade path for blocks context IDs #2354889 (context manager), which is supposed to provide a clear example. So, this issue's upgrade path is effectively blocked on that issue.
Let's do another bit of profiling to clear that up. I know @lauriii intended to profile it on e.g. the frontpage. Are you still up for that, @lauriii?
So, having checked in with @davidhernandez on IRC, this issue needs four things:
tabsregion, and remove thehelpregion, all those blocks can now simply go in thecontentregion. Less regions, less confusing. (Done in this reroll.)P.S.: yay, comment
π × 100! Let's not do that again though.Comment #315
wim leersPinged David in IRC, pinged @lauriii via Twitter, and updated #2528178 to notify the people there that that issue now blocks this one: #2528178-41: Provide an upgrade path for blocks context IDs #2354889 (context manager).
Comment #316
rainbowarrayIf we're changing the name for the block, I think Action Links makes a lot of sense. More clear than Local Actions. The feedback on the Twitter survey seems to line up with using that as a name.
Would be great to see this get in. I dropped the ball on this and the other block conversions. Very glad to see so many working to make this happen. Would be nice to have Blocks Everywhere for D8. Performance boost and site building sanity, having all the pieces on a page movable as blocks.
Comment #317
webchickFiltering out the responses from Drupal people at https://twitter.com/webchick/status/621734527493234688:
- https://twitter.com/SerenitaZhu/status/621806947688316928: Action Link or Main Action I think
- https://twitter.com/bbonfils/status/621773132811079680: Quick actions
- https://twitter.com/helloimbenny/status/621769997354823680: Menu Action
- https://twitter.com/xalking/status/621759048917086209: task/action/content creation, or perhaps even primary action? It seems to be presented that way here...
- https://twitter.com/asberenyi/status/621754583912706048: thinking main action; next step; key step; main thing. Common thread is the main thing most people will need to do next
- https://twitter.com/Shovelita/status/621752375318024192: add element button perhaps
- https://twitter.com/AndrewDuck_/status/621750446055665665: actions I guess from a Rails MVC kinda viewpoint
- https://twitter.com/iamrvazquez/status/621738174130323456: The nav screenshot I call an action. The other screenshot I call a Call To Action. The context is what marks the difference.
- Counter-point: https://twitter.com/PortmanDoe/status/621742889173848064: do you mean non-Drupal AND non-webby? Because as "general public," I'm like "Wtf is call to action?"
So no clear winner. But the word "action" shows up in most of the responses.
Given the guidelines at https://www.drupal.org/node/1089894 recommend only having one of these, maybe call the block "Primary admin action." It's not perfect, since nothing stops them from showing up on a non-admin page, and once in awhile there can be multiple of these (though it's discouraged), but that's generally speaking what they're for.
But as long as the machine name of the block is action_links or whatever, we can debate the user-facing label in another issue without breaking BC, afaik.
Comment #318
davidhernandezProbably should be plural. Should we avoid shortening to admin? "Primary administrative actions"? Or Just "Primary actions"? I say if nothing better comes up in the next 3 comments we're going with webchick's suggestion.
Comment #319
lauriiiI'm okay with 'primary admin actions' but just wanted to make clear that local actions might not always be used in administrative purposes.
I did some profiling for this in some other use cases. Again; this issue doesn't create the performance improvement but makes it possible to be done in future. We need hooks providing local tasks/actions to provide cacheable metadata and after its done we can turn on the caching.
The profiling case in this one is user/1 page for anonymous user which has permissions to edit that user. Internal page caching has been turned off, render caching is on.
http://www.lionsad.de/xhprof-kit/xhprof/xhprof_html/?run1=55a8732244c39&...
Run 55a8732244c39 uploaded successfully for drupal-perf-lauriii.
Run 55a8735248325 uploaded successfully for drupal-perf-lauriii.
http://www.lionsad.de/xhprof-kit/xhprof/xhprof_html/?run1=55a8732244c39&...
Comment #320
lauriiiRemoving the subsystem maintainer tag since there is already product manager review tag and the comment where this was added says this should be reviewed by the product manger.
Comment #321
wim leersThanks @lauriii!
For that, we have #2511516: Make local tasks and actions hooks provide cacheability metadata, to make the blocks showing them cacheable.
@lauriii: the numbers you posted do show a very nice improvement, so I'm assuming that's with #2511516 already applied then?
Making one of the cheaper pages 10% faster… that is quite impressive at this stage. So this really saves about 4000 function calls. That's quite a lot!
Comment #322
lewisnymanIt looks like Seven's design requires two regions for this content. We can't name them after the tabs though.
The primary tabs appear in the 'content-header' component. So maybe we can call this region 'content-header' or just 'header' to match other themes?
The secondary tabs region appears above the content region, so something like 'pre-content' could make sense.
Comment #323
fabianx commentedI have reviewed the profiling of #321 and it is legit, so this issue would be critical on catch' computer :-D. More seriously: menu_local_actions are very heavy on the system and therefore this is borderline critical.
I see that calls to menu_local_actions completely vanish, so I think the blocks are cached already here.
I think we will need to add max-age=0 to the blocks cacheable metadata in this patch here, to avoid that for now though.
As I fear else we would cache 'too much'.
Comment #324
wim leersBut:
I'm pretty sure @lauriii did the profiling with
max-age = 0uncommented, i.e. I think he pretended that #2511516: Make local tasks and actions hooks provide cacheability metadata, to make the blocks showing them cacheable was already fixed. (I asked him in #321.)Comment #325
lauriiiSorry for not saying this explicit enough :) I turned on the block caching to get the comparison. Thats what Im trying to say on this:
Comment #326
wim leersThanks for confirming, @lauriii!
Comment #327
fabianx commented#325: Okay that makes a lot of sense.
Comment #328
dawehnerAs said on the d8 critical call we should try to figure out why its actually so slow. I have the feeling/hope that there could be things improved as well.
Comment #329
wim leersSo, from #314:
Points 1 and 3 are done. That leaves points 2 and 4.
Comment #330
davidhernandezI'll work on 2 and the region and block names if that wasn't done already.
Comment #331
davidhernandezOk, made the naming changes. Lauri, I apologize for ever asking you rename things! I moved Bartik's help CSS, and renamed the tabs region in Seven, per Lewis' suggestion.
One thing bothering me is the region inconsistencies I'm seeing. They seem to be all out of order comparing the order they are declared in the info versus printed in page template versus the comment orders. It would be good to fix that. I think it wasn't noticed in Seven because people don't really look at the block placement in Seven.
Also, what are these regions doing in Seven?
Comment #333
davidhernandezNeeded to reroll a change to ConfigTranslationOverviewTest.php
Comment #334
davidhernandezAnother thing I noticed is that the "actions" use a CSS class name "action-links". I debated about changing that, but it is that way in HEAD. Any thoughts on changing it since neither the block machine name nor the block label now have that wording?
Comment #335
joelpittet@davidhernandez
+1 to "Action Links" to match the CSS and less name difference baggage/translation.Edit: that for renaming the block label to that, but I've not thought that through enough but still +1 to that, just don't think it's helpful to this so reverting;)
@Xano made note of this above in #229.15, just highlighting it:
Can we spell this out with a more explicit name. Unless there is a convention I don't know about for whatever a "sut" is?
Comment #336
lauriiiI guess $sut is not being used in Drupal Core elsewhere yet but its quite commonly used else where and stands for "system under testing" I think. Maybe @Xano can provide more insights if needed.
@davidhernandez: Maybe it could be changed to match the machine name. Not necessary though.
Comment #337
lauriiiFixing the last "Needs tag"!
Comment #338
lauriiiComment #339
lauriiiComment #340
davidhernandezThe point remaining from Wim's list is the upgrade function. We can discuss naming convention as we go, but the patch will still need reviewing.
Comment #341
jibranI'm confused, what kind of upgrade path are we talking about here? And how is this blocked on context issue? Can someone please elaborate the steps?
Comment #342
jibranComment #343
lauriiiI guess it should be showing example how to write upgrade paths for block config entities
Comment #344
lauriiiI was working on the upgrade path. We still need test coverage for it.
Comment #345
lauriiiJust a plain reroll
Comment #347
davidhernandez@lauriii that last patch looks a lot bigger than the previous. Did some extra stuff get included accidentally?
Comment #348
star-szrOops :)
Comment #349
lauriiiLatest patch was tired and quick reroll so that I could provide interdiff for my upcoming patch. I am still working on this and have made some progress to create the tests / fix the reroll.
Comment #350
wim leers@davidhernandez: Thanks for all the renaming!
@lauriii: Thanks for writing the upgrade path!
Once @lauriii posts a new patch that includes test coverage for the upgrade path (as he said in #349), I'll ask @amateescu/@dawehner to review the upgrade path here.
Comment #351
davidhernandezLooks part of it was #2228217: Further optimize RouteProvider and add web test for large number of path parts getting reverted.
Comment #352
lauriiiTests for the upgrade path. Sorry it took so long!
Comment #353
jibranHere is the review of upgrade path.
Let' convert this into a switch case for better understanding.
This code is not DRY(don't repeat yourself). Let's move all these to helper function and call it for each theme because more or less we are doing the same things in each condition.
hmmm why?
s/We/we
Comment #354
wim leersLooking good :)
Copy/paste remnant.
This is not the node creation page.
s/Create/Place/
s/we can/to/
This, and all other occurrences of this pattern, have an indentation problem.
Can be simplified to just
because we don't use
$block.Why?
Broken sentence.
Comment #355
lauriiiReroll & fixed #353 & #354
#354.7 Just to not set the message. It could be also additional if inside the else
Comment #356
lauriiigonna fix the patch. There's a lot of unnecessary stuff
Comment #357
lauriiiComment #359
davidhernandezIs the patch in #357 wrong or just the interdiff?
Comment #360
lauriii#377 should be fine.
Comment #361
bill richardson commentedTested patch 357 -- local actions / tabs are being correctly displayed as blocks -- great work lauriii.
Comment #362
jibranFixed some nits.
Comment #364
jibranWith correct patch now.
Comment #365
jibranI don't think we can use block entity in system module let's use storage controller instead.
Comment #367
lauriiiComment #368
jibranLet's save block storage in local variable. Use statement can be removed form the file now.
Comment #369
lauriiiComment #370
lewisnymanI discussed with Lauriii in-person. I am happy with the region additions. I would like it if we could remove the breadcrumb region in Seven so it's replaced with pre_content.
We also discussed the side effect of this patch, that contextual links now show up over tabs in the admin interface. I think that we can commit this here and work on fixing this problem in #2487025: Remove contextual links in Seven
Comment #371
lauriiiNot sure if its a good idea to remove the breadcrumb block in this issue because we would need to create upgrade path it too. Any ideas?
Comment #372
lauriiiJust removed few extra spaces
Comment #373
longwaveDon't think this should be here.
Comment #374
dawehnerIMHO quite an out of scope change, isn't it?
$access is not used anymore ...
Let the machine name be as similar to the internal construct as possible, so let's rename system_tabs_block to system_local_tasks_block
sut? What does that even mean :) Do you mind trying to find a better variable name?
Nice test!
If you need a test theme it should be installed already as part of the database dump, everything else is damn fragile
Let's not use entity_load_multiple_by_properties() I think this is effectively deprecated, even if it is not marked as such
A) the entity API is not save to use, see #2528178: Provide an upgrade path for blocks context IDs #2354889 (context manager)
+1 for this message
Comment #375
lauriii#374.1: We need to fix that to get the correct level of local tasks for the blocks
#374.4: sut stands for "system under testing" and is being used in other projects using PHPUnit.
Comment #377
lauriiiComment #379
dawehnerCool, I learned something new!
Thank you a lot for renaming all the things :(
Comment #380
lauriiiShould be green
Comment #381
longwave#373 still needs fixing, this happens to me sometimes when I do something too fast for PHPStorm to keep up :)
Comment #382
lauriiiI started using PHPStorm just a month ago from Vim and haven't got used to this side.. In Vim its nearly impossible to add extra characters unintentionally but in PHPStorm it is more than easy :P
Comment #383
wim leersI think this patch looks great. It's been so thoroughly reviewed, that I think this is definitely RTBC worthy.
AFAICT only one thing remains: regression testing this in Bartik, and hence getting @emma.maria's approval. She told me in IRC @lauriii just landed in Zürich to visit her and others and they're planning to look at this issue.
So, hopefully this one will be RTBC before we reach comment #400 :)
Comment #384
dawehnerJust some more general points.
What about moving this update function then into the block module? Especially because block is not a required module, having that as part of system, feels just wrong
you could typehint the interface
Do we need that inline doc here? listInfo() already has documentation that it returns an array of Extension
I am quite convinced that we should not use entity API in an update function, see the other upgrade path issue and hook_update_N, see #2538228: Document that Config save/delete/rename events may be dispatched during hook_update_N(), what that means for subscribers, and fix core subscribers accordingly
Comment #385
lauriiiDiscussed #384.1 with dawehner on IRC and we decided to leave it on the system module so that warning could be given to users not having block module enabled. Also made the documentation a little more explicit.
I also talked quickly with Lewis and he agreed with that removing Breadcrumbs region would be nice in this issue, but doesn't match the scope so it will be still left there. It can be removed in other issue.
Comment #386
dawehnerYou could inline the weight++ tag :P
Comment #387
emma.mariaI'm keeping my eyes on this issue. Please all ping me when it's ready for final visual tests on Bartik :)
Comment #388
lauriiiGetting closer to 400 :P
Comment #389
lauriiiThis should fix all the things for Emma & Bartik!
Comment #390
emma.maria@lauriii showed me what would be affected before and after the patch in #389 was applied. I saw no visual differences and I would RTBC this issue based on a visual review. So I will set this to RTBC, feel free to bump it back down if more work is needed.
Comment #391
emma.maria@lauriii showed me what would be affected before and after the patch in #389 was applied. I saw no visual differences and I would RTBC this issue based on a visual review. So I will set this to RTBC, feel free to bump it back down if more work is needed.
Comment #392
emma.maria@lauriii showed me what would be affected before and after the patch in #389 was applied. I saw no visual differences and I would RTBC this issue based on a visual review. So I will set this to RTBC, feel free to bump it back down if more work is needed.
Comment #394
lauriiiRerolled
Comment #395
dawehnerWe still have 2 extra RTBCs left from emma
Let's use one
Comment #396
pwolanin commentedI think there could be performance concerns with the changes to always construct the render array in LocalTaskManager::getTasksBuild(), but hopefully those would be mitigated by #2511516: Make local tasks and actions hooks provide cacheability metadata, to make the blocks showing them cacheable. At least this needs a @todo
SystemLocalActionsBlock should not call out to menu_local_tasks(). If we are re-working the logic, we should probably move the contents of menu_local_tasks() into a method on LocalTaskManager since I think it already has all the related services injected. This would also get us closer to the goal of emptying menu.inc
Comment #397
pwolanin commentedDiscussed with @lauriii in IRC and I think we are on the same page. This patch moves the actual implementation into the local task manager, fixes docs, and removes a redundant and unused hook invocation.
Comment #398
lauriiiFixed few übernitpicks
Comment #399
lauriiiPutting this back as RTBC with Emma's last remaining RTBC. Its also the last comment before 400 so better be ready now.
Comment #400
manuel garcia commentedAwesome work guys, this patch keeps getting better and better!
I'm guessing the CR will have to be revisited to include the changes introduced on #397.
Comment #401
lauriiiI created another CR for that
Comment #402
manuel garcia commentedThanks @laurii!
+1 on RTBC
Comment #406
rainbowarrayComment #407
rainbowarrayThis rebase should apply.
Comment #408
wim leersDiffing the patches in #398 & #407 tells me this is safe to re-RTBC
Comment #409
alexpottDoesn't this change really make block a required module? Or maybe if block or page manager or something that renders blocks is not enabled then something else should. Hmmm I guess this is not really making things worse than minimal without block installed currently as you lose all the menus. I'm not sure Drupal makes much sense without something that renders and places blocks.
I thought we agreed that config entity storage in hook_update_N()?
Comment #410
lauriiiYou can still replace your block system with something else so I don't really think we have to make it required module here.
Comment #411
gábor hojtsyYeah the menus are blocks too (even breadcrumb). Drupal needs some kind of system to render "blocks" of some kind yup. The very minimal distro would render the pages but you'd still need to manually jump around to URLs. Its minimal :D
Comment #412
andypostProbably that's a reason why "status messages" are converted to render element.
Comment #413
rainbowarrayJust to keep us focused, my understanding from alexpott's comment is that we are okay right now with how things are working with the block module on the minimal profile.
What needs to get changed now is potentially using config entity storage for hook_update_N.
I'm not sure how to do that, but hopefully that is a straightforward fix if someone knows how?
Comment #414
pwolanin commentedSee comment from dawehner above "I am quite convinced that we should not use entity API in an update function, see the other upgrade path issue and hook_update_N,"
From lauriii in IRC, I got the same - that the config should be saved directly instead of using the entity system.
However, the existing updates seem to be modifying existing config objects as opposed to creating them new with uuid, langcode, etc.
Here's an attempt to do it directly in config.
Comment #416
pwolanin commentedTest setup fix. Looks like this is a new test class since the prior test fixes.
Comment #417
wim leersAFAICT this addressed the remaining concerns. Thanks, @pwolanin!
Comment #419
lewisnymanA simple reroll in the end.
Comment #420
wim leersComment #421
dawehnerIMHO we should key this by route name so we ensure that we don't accidentally introduce some state into the service which is not automatically resolved. It is also sad that we don't have added unit test coverage for that particular change
this !empty is pointless IMHO, according to RouteMatchInterface the result is NULL. This is a tiny little bit we can improve for readability
We are adding code to system module, this is bad. IMHO it should be possible to implement this block in core/lib itself. Its fine if you hate me for that but I think that sanity > consistency and not the other way round
This is the only usage of array( isn this file. Let's be consistent.
Ideally we would load after the updates in order to ensure that we run with the new data
Let's add a todo pointing to #2435135: Maintenance Mode after Database Update
Setting to needs work because of the state in the service.
Comment #422
rainbowarray#421:
For point 3, all of the other page variable to block conversions have had the block plugins added to the system module. I'm not sure where in core/lib you're proposing this code should go. If this is a general beef with the system blocks, then that sounds like a follow-up issue to take care of all the system blocks not just this one.
I can take care of some of the easier points in this review, but could use help particularly with points 1 and 5.
Comment #423
wim leers#422:
Point 1 is just saying:
Point 5 is I think saying
Comment #424
rainbowarrayFirst up, a reroll since another issue used the 8002 update slot for system module.
Comment #425
rainbowarrayThis should fix the concerns raised in #421, except for the unit tests for point 1 and point 3, as noted in #422.
Comment #427
dawehnerJust move it to core/ilb/Drupal/Plugin/Block ... The argument strategy you choose here is the following: Let's keep things consistent instead of sane. I think this is wrong.
Well, what I say is that ideally we should have no state.
Just as written.
Comment #428
rainbowarraydawehner, it's clearly obvious to you that it would be more sane to have these in core/ilb/Drupal/Plugin/Block. That's not at all obvious to me, and it might not be to others as well. Since that would require a massive change moving a lot of this work to a different part of core, and that may or may not end up working without a great deal of difficulty, I'd really appreciate if you could explain your reasoning.
Comment #429
rainbowarrayReverting the changes I made for point 1. Looks like that change was responsible for a lot of the errors. I still don't understand what needs to be changed to address that feedback. Sorry, I know saying that there should be no state may make perfect sense, but I don't know how to translate that into what code needs to change. My apologies.
Comment #430
rainbowarrayHere's a corrected interdiff.
Comment #432
rainbowarrayAnother system install reroll.
Comment #433
wim leersActually, I think just this tiny little oversight was all that was wrong with #425. :)
Also rebased (this conflicted with #2228217: Further optimize RouteProvider and add web test for large number of path parts).
Comment #435
wim leersFixed one last detail that was forgotten in #425.
And moved the local tasks & actions blocks from
core/modules/system/src/Plugin/Block/tocore/lib/Drupal/Core/Menu/Plugin/Block/.Note that that is
core/lib/Drupal/Core/Menu, and NOTcore/lib/Drupal/Coreas @dawehner requested, because the latter is unsupported. (I checked with EclipseGc.) That actually makes more sense too, since local tasks & actions' underlying logic in fact also lives incore/lib/Drupal/Core/Menu!Comment #437
rainbowarraySmall fix for the markup for local actions in the Seven theme.
Comment #438
rainbowarraySlight tweak so that the styles still apply for any local actions block placed in Seven.
While I'm at it, making sure that Bartik's markup remains the same.
Comment #439
rainbowarrayThe markup for action links in core was looking pretty goofy with a ul with a class of "-" so this adds in a template to fix that. Uses the nav class, which is helpful for screenreaders.
Comment #440
rainbowarrayDiscussed this with Lewis Nyman, and I think we can remove the local actions block template from Bartik. The only change from Classy to Bartik was switching nav to ul (which is what was in the Bartik page template). However, using nav won't change the appearance, and it's a benefit for screen readers to use nav. I'd like emma.maria to confirm that, however. Then... maybe back to RTBC?
Comment #441
dawehnerThis looks really great. Does someone mind adding a follow up (or do it now) to unit test the new method on LocalTaskManager? I'm happy to work on it,
it gives me this warm feeling ...)
Thank you a lot for that!
We should be able to use config schema in core/config/schema directly, don't we?
Comment #442
wim leers#441.0 got me thinking … (my stupid computer crashed and I lost my entire comment — GAAHHHHHH, so what follows is a much more rambling version). So, because of #441.0, I looked at
getLocalTasks($level = 0)again. And realized that what @dawehner was probably getting at in his previous comments implicitly, is that the other methods onLocalTaskManager, i.e. bothgetLocalTasksForRoute()andgetTasksBuild()receive a route name, rather than tracking "the current" route. We should updategetLocalTasks()to have a$current_route_nameparameter also.But, what's perhaps even worse, is that the distinction between
getLocalTasksForRoute()andgetLocalTasks()is … unjustifiable/inexplicable, if we're being honest. What's worse, is thatgetLocalTasks()actually relies ongetTasksBuild(). So the call chain is effectively:getLocalTasks()->getTasksBuild()->getLocalTasksForRoute(). So, at least, we should give it a better name.But that's the thing,
getLocalTasks()is identical tomenu_local_tasks(). That's also where it gets its name from.However, with the changes in this patch,
menu_local_tasks(),menu_primary_local_tasks(),menu_secondary_local_tasks()andmenu_local_tabs()all become effectively dead code. Which means we might as well havegetLocalTasks()living in the block directly.All of this boils down to one thing: the only reason we have
menu_local_tasks()/getLocalTasks(), ishook_menu_local_tasks_alter(). That expects data in a very strange (D7, never updated properly) form, with even duplicated data… And this is why that alter invocation cannot live ingetLocalTasksForRoute(), at least not without significant refactoring.There are so many conflicting angles about this, that the only reasonable way that I see to resolve them, is to just have the block keep calling
menu_*()functions inmenu.inc, and defer the other clean-up to another issue. But I suspect those changes were necessary. Hoping @lauriii can explain this.In other words: the incomplete menu system conversion once again haunts us.
#441.2: done. Hope it passes, IDK which tests to run locally. Unit tests pass in any case.
Comment #443
andypostI'm still sure that better to encapsulate this logic into render element
So blocks would live in system module and render element will call
localTaskManager->getLocalTasks()to return a BC build :Patch fixes:
- no reason to store route name in array (there's one as key) and alter hooks get route as argument
- no reason try call alter hook if no tabs on except pages (comment added)
- brings a bit of clean-up for blocks
EDIT: that brings state to manager without reset function
Comment #444
wim leers#443: Changes look good.
And you are referring to your earlier comment #412, so let me answer that:
Actually, the reason status messages are a render element, is because we already had
#theme => messagesbefore (also in D7 I think), and quite a few things use that to put the status messages in very specific places. Specifically, many AJAX responses/commands use this to render status messages as part of AJAXy stuff within the context of the AJAXy stuff.But, I think you're right that having
#type => local_taskswould help simplify things. Would you like to give that a try? :)Comment #445
dawehnerThat is the thing, people argued for ages that we aren't allowed to change things anymore, which then lead to all this horrible design all over the place. Deciding that
was IMHO a horrible decision, given how much time you had in the meantime.
Can we mark the API as @internal for now, so we can change it later?
Can't agree more. We should split up the state of the system (the route match) from the logic around constructing the tasks. I would actually vote for using
$route_nameto be clear.
IMHO it is right to not have business logic in the block, much like you should not have business logic in controllers.
This is a bit add, do we need the key here? Isn't this a render array so we don't need to care about the root level at all?
Comment #446
wim leers+1
+1
I think you meant "odd" :) And yes, you're right, we don't need those keys at all.
Comment #447
dawehnerHere are my changes, I think further improvements can be done later.
Comment #449
rainbowarrayAt least some of these errors stemmed from the preprocess block referencing the removed keys. I don't think that is necessary anymore.
Comment #450
bill richardson commentedb/core/profiles/standard/config/install/block.block.seven_seconadry_local_tasks.yml
file incorrectly named.
Comment #451
manuel garcia commentedComment #452
rainbowarrayRerolled with some updates to cache contexts in TrackerTest.
Comment #453
rainbowarrayAnd here's the filename fix. Thanks for spotting that Bill.
I really think this is probably ready for RTBC. Any takers?
Comment #454
bill richardson commentedApplied patch and all new blocks function as expected.
Comment #455
bill richardson commentedApplied patch and all new blocks function as expected.
Comment #457
lauriiiJust a simple reroll
Comment #459
rainbowarrayNot sure what was wrong with Laurii's patch, but doing the reroll over again.
Making the system install helper for installing blocks generic since the branding block update will need that too.
Comment #460
wim leersComment #462
rainbowarrayThe reroll that's needed involves cache contexts with TestTracker. My memory is that was part of the critical work being down on SmartCache, so it would be great for Wim to take a look at this to make sure we get this right. It would be good to have Wim take a look through all the cache context stuff in this patch, just to make sure there are no problems that slipped in do to rerolls.
Once that's done, it would be really really nice if we could get a core committer to take a look at this. We keep getting knocked back due to rerolls and then end up back at the bottom of the RTBC queue, which is pretty large right now. I know their eyes are critically needed on, well, criticals. But I'd really like to avoid us hitting comment 500 on this issue.
Comment #463
wim leersWill do so tomorrow. Very late now here. (And too much wine.)
Comment #464
lauriiiRerolled the latest patch
Comment #466
wim leersThe changes to
TrackerTestare correct. I just restructured them in a very minor way to improve maintainability.The reason this patch is failing is now #2555183: Fix the filled update tests, they are broken, which changed the update path test base class that this patch uses. The upgrade path is failing locally though, and I don't have experience debugging that, so I'll leave that to someone else.
Comment #468
xanoWhat happens is that general extension info is stored in the
core.extensionconfig, but that the theme handler stores an additional copy of available themes in state in the form ofExtensionobjects. That state item was not updated in previous patches, which caused the tests to fail. This patch rebuilds it and adds an additional assert.Comment #469
rainbowarrayLooks like this fixes the latest issues. Moving back to RTBC. Hopefully we can get a committer review before this needs another reroll. Definitely understand that committer time is limited as we get close to RC1.
Comment #470
wim leersDear committer/person interested in cacheability in general or SmartCache in specific,
Note that this turns the local tasks and actions into uncacheable blocks. Those blocks will be made cacheable in #2511516: Make local tasks and actions hooks provide cacheability metadata, to make the blocks showing them cacheable: the cacheability metadata is currently incomplete, which makes it impossible to cache local tasks/actions right now.
However, if that issue (#2511516) does not happen before 8.0, that'd be less than ideal but would not make SmartCache (#2429617: Make D8 2x as fast: Dynamic Page Cache: context-dependent page caching (for *all* users!)) ineffective, thanks to auto-placeholdering (#2499157: [meta] Auto-placeholdering).
The local tasks & actions blocks specify max-age=0. Because #2543332: Auto-placeholdering for #lazy_builder without bubbling and #2543340: Convert BlockViewBuilder to use #lazy_builder (but don't yet let context-aware blocks be placeholdered) have already landed, blocks with max-age=0 are automatically turned into placeholders, and hence the overall HTML response still remains cacheable.
@Xano: wow, nice detective work!
Comment #471
xano@Wim: thanks for that excellent explanation! It helps to understand how all these things (have) come together.
Comment #472
alexpottA 5% performance boost is nice. A more is possible if we make them cacheable. Great work everyone. Committed 2b1f8e6 and pushed to 8.0.x. Thanks!
I have a couple of questions that I think can be addresses in followups in people feel it necessary:
Comment #474
davidhernandezI believed that had been discussed at one point, if not here than in another issue, but decided to wait until the dust settled on all the region shuffling.
Also, yay!!
Comment #475
rainbowarrayFirst of all: thanks to everyone who worked to make this happen!
#472: Classy doesn't have any blocks placed with install, so we're doing the same here. If we do want blocks placed in Classy with install, that should be a separate issue, and we can revisit the upgrade path for blocks then.
Comment #476
davidhernandezCorrect, and it's fine. It's not intended to be used on its own so it doesn't need blocks placed for it.
Comment #477
dsnopekHuzzah! Congrats, everyone, on this EPIC issue! :-)
Comment #478
fabianx commentedCongratulations!
Comment #479
emma.maria#473 @alexpott & #474 @davidhernandez Did you mean to mention Seven here and not Bartik?
The new blocks from this issue need to stay in the Content region within Bartik, which also does not have a Pre-content region.
Comment #480
lewisnymanYep it looks like we need to remove the breadcrumb region in Seven. I've created a follow up #2561671: Remove the breadcrumb region
Comment #481
mile23Just a heads-up that this broke my contrib tests, because SimpleTest defaults to Classy, which doesn't place any blocks: http://cgit.drupalcode.org/examples/commit/?h=8.x-1.x&id=49275396df0d9cc...
I kind of like that we have to be explicit about placing blocks in tests, but it could also be a hassle.
Comment #482
longwaveThis also broke various tests in Ubercart which assumed the tabs and actions would be displayed by default; I guess this will be the same for many other contrib modules that assert or click their tabs and actions links.
As I can't really see a case for not displaying them, I also wonder if Classy should just place them by default for use by tests?
Comment #483
rainbowarrayI think opening a follow-up to discuss whether Classy should place blocks by default would be worthwhile.
Comment #484
lauriii@longwave: that would require to set Block module as a required module. I think if test needs to test local tasks, it should place it itself.
Comment #485
mile23If the blocks are to be placed, it should be the installation profile, which is 'testing.'
But this still leaves us with the problem of needing block module for testing, even for tests which test block module. :-)
Comment #486
rainbowarrayAgain, that may well be true, but that should be tackled in another issue. This one is already 486 comments long, and the concern about having blocks in the testing profile is larger than this one particular issue.
Comment #487
dave reidJust hit a bunch of regresssions in contrib tests due to the missing blocks too. Do we have a follow-up filed yet?
Comment #488
rainbowarrayFiled a follow-up issue to discuss this further: #2562987: Enable blocks in testing profile and/or Classy
Comment #489
googletorp commentedAfter updating from beta14 to beta15 on a real site (soon to be live), the secondary tabs block in seven was not created. I can see the code should create, so not sure why it didn't, but got the same result on local dev env + 2 hosted envs. I did use drush to run the update, but that shouldn't cause a single block to not be created I would think. All of the other blocks got created just fine.
Any one else had problems with update hooks for this?
(I managed to create the block manually, so that fixed the issue for me)
Comment #490
yoroy commentedI have the same issue as #489: no secondary tabs in Seven. This was a local copy chasing d8-dev with git pulling every now and then though.
edit: running update.php to update the database did not bring back the secondary tabs in Seven.
Comment #491
duaelfrI have the same problem.
Let's talk about that in #2569529: system_update_8005 does not create secondary tasks block in Seven.
Comment #492
wim leers#2511516: Make local tasks and actions hooks provide cacheability metadata, to make the blocks showing them cacheable also landed a few days ago, thus realizing the performance gain described in the IS! :)
Comment #494
manuel garcia commented#2476947: Convert "title" page element into a block got in today as well *party*