Closed (fixed)
Project:
Drupal core
Version:
8.7.x-dev
Component:
plugin system
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
16 Jul 2018 at 13:32 UTC
Updated:
7 Aug 2018 at 15:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
tim.plunkettThe
$context_definition->addConstraint('Bundle', [$bundle]);call in FieldBlockDeriver was having no effect.Comment #3
tim.plunkettComment #4
mtodor commentedI have applied this patch and the problem still persists for me.
Here are steps how to reproduce:
layout_builderLanding Pagebodyfield from itAllow each content item to have its layout customized.=> SaveLayouttab+ Add BlockComment #5
mtodor commentedI have quickly added tests if that can help.
Comment #7
tim.plunkettThanks @mtodor!
If I clear the caches and then immediately refresh
/layout_builder/choose/block/overrides/node.1/0/content, I see the correct list.On subsequent refreshes, it breaks again.
Which means we're losing the constraints.
Cleaned up the test a bit.
Comment #9
tim.plunkettUgh, that passed for me locally :(
Comment #11
mtodor commented@tim.plunkett Test works for me locally too .. :)
Btw. I have checked code from #7 and it works fine.
Additionally, I have checked fail for #5 and it fails in the wrong place, so TestBot doesn't like us.
Here is first try to get in the better relationship with TestBot.
P.S. I have selected 8.6.x for testing because I developed on it.
Comment #12
mtodor commentedComment #14
tim.plunkettOh! Misunderstood the fail. That makes sense, since the testbot installs in a subdirectory, and the URL will be different.
Comment #15
phenaproximaExtremely minor nits: $validLinks should be $valid_links (same with $invalidLinks), and we can use assertCount() rather than assertEquals() to validate the counts.
Additionally, I think that CSS selectors are easier to read than XPath queries, so I think we could use
a[href*="field_block%3Anode%3A%bundle_with_layout_overrides%3Abody"]instead of the XPath.Otherwise, I think this is good to go.
Comment #16
mtodor commentedHere is the patch that addresses review from #15.
Well, for me XPath is more readable (because I have worked with it a lot in previous jobs) and additionally, our tests are converting CSS to XPath - so I need to take a look at Symfony documentation - https://github.com/symfony/css-selector/blob/v3.4.12/Tests/XPath/TranslatorTest.php :D
I have changed a bit suggested selector from
a[href*="..."]toa[href$="..."], it's a bit more strict.Comment #17
phenaproximaThanks for changing that, @mtodor :) I appreciate it. RTBC once green on all backends.
Comment #19
tim.plunkettComment #20
tim.plunkettThis should go into 8.6.x to avoid a regression.
Comment #21
alexpottCommitted and pushed 52aa9a23d9 to 8.7.x and a8d7a55139 to 8.6.x. Thanks!
Can we get a follow-up to fix this documentation - having an @see that points to the issue that added the code is weird - that's what git blame is for. Also just listed where it is used in @see is bound to get out-of-date as it now is. And these
@see ::don't actually work in PHPStorm and so I guess they don't work on api.drupal.org - so they are pretty pointless.