Closed (fixed)
Project:
Page Manager
Version:
8.x-4.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Oct 2015 at 04:18 UTC
Updated:
11 Jun 2019 at 18:49 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
benjy commentedI had a temporary workaround that works for block_content blocks, not sure exactly how the right way to go about generating the correct contextual links for all entities just yet. I was trying with:
But for some reason, the act of loading the entity made the page a 404, will need to look into that further.
Also, any errors in PageBlockDisplayVariant give you a white screen because of the suppressed errors VariantCollection::sort().
Comment #3
taherpro commentedThis Patch works for block_content blocks. Thanks benjy!
But the contextual links for views listed on the pages using page manager are breaking.
Comment #4
mmenavas commentedIs anyone else still experiencing this issue?
Contextual links show up for me when I add a View Block to a Block Page variant. However they don't show up on Content Blocks. I'm using the dev version.
Comment #5
claudiu.cristea@mmenavas, try to apply the patch from #2. For me #2 is fixing:
If a views block has the Other > Contextual Links enabled, it shows the contextual links (both: the block & the view) but they are not woking. It looks like a z-index issue.
However, I think that \Drupal\Core\Block\BlockPluginInterface should define a new method getContextualLinks() and add the links in BlockBase. In that way, the implementations will only have to return the links in the new method. That would made our case simple, without the need of building the original block.
'#contextual_links' => $block->getContextualLinks()Comment #6
mmenavas commented@claudiu.cristea the patch from #2 does provide contextual links for Content Blocks in a Variant, but as a side effect it duplicates the contextual links for Views Blocks.
I'm using Drupal 8.0.1, Bartik theme, Page Manager alpha20, CTools alpha20, and PHP 5.6.14.
Comment #7
imre.horjanIt works for me using content blocks.
Comment #8
kenorb commentedComment #9
kenorb commentedComment #11
thebruce commentedNot sure if this is related but - I am able to get a contextual link block to appear on pages that have panels page variants but only for the very first variant. All other variants are unable to get contextual links. If you change the variant in the first position to another - then that variant can get the contextual link block but not the former.
I tried this patch just for kicks, knowing that it applied to block panels. As expected it did not affect this issue. Happy to create a separate issue but it seems related.
Sorry - found the correct issue: https://www.drupal.org/node/2649702
Comment #12
huzookaI have a similar hack to get the contextual links back, but I suggest to work around this in buildBlock(). We can avoid that the same block is builded twice and we also need the
contextual-regionCSS class on the block (which is the only (default) piece in the renderable we get).Comment #13
huzookaPatch attached, but it fixes only block_content entities, (so e.g. menu blocks will still miss contextual links).
Comment #14
huzookaComment #15
kyuubi commentedHi,
Is there any update on a fix for this that can work across all entities?
Comment #16
benjy commented@kyuubi, if you're using Panels then the issue is fixed in HEAD but we've been using an older version because HEAD has been a bit flaky.
You can try this fix manually, in Drupal\panels\Plugin\DisplayBuilder\StandardDisplayBuilder::buildRegions()
Comment #17
benjy commentedHere's the actual patch we're using back ported from head.
Comment #18
kyuubi commentedHi benjy,
Thank you for your help!
Cheers,
Comment #19
matt_paz commentedI think this might still be an issue and the patch is outdated.
Can anyone confirm?
Comment #20
rbosscher commentedI just encountered this issue, so I can confirm this is still an issue.
unfortunately the patch of huzooka (#14) didn't help
The patch (#17) is actually allready in the Panels 8.x-4.3 version, so it doesn't need to be patched. That patch causes, I think, to put the contextual links twice on the same block wich just is not a good idea (#1914966: Nested contextual links triggers don't work well)
The contextual links started working again when I removed the following line:
I think this might also be related to: #2743353: Contextual links double trigger And I will post the patch there, as that issue is in the right module.
Comment #21
geek-merlinThis issue looks quite confusing to me... What i can see:
* #17 does not apply agains page_manager (but against panels)
* #14 still applies against current dev and fixes the issue to me.
The code makes sense.
Status NW was incorrect, should be NR as of #14.
So setting RTBC.
Comment #22
pfrenssenThis doesn't have a test yet.
Comment #23
claudiu.cristeaTests provided.
Comment #24
manuel.adanVersion changed to the current -dev branch (4.x). Automated tests should now be triggered.
Comment #25
claudiu.cristea@manuel.adan, thank you. I forgot to select the correct branch.
Comment #27
manuel.adanEmpty block test fail after this PageBlockDisplayVariant::buildBlock refactoring. Cache metadata is expected to be merged for empty blocks, to indicate why they are empty, but after the changes it is returned directly with no cache merging.
I back the buildBlock to its initial implementation, but adding the new code related to the contextual links.
Comment #28
manuel.adanComment #29
claudiu.cristea@manuel.adan, yeah, I was thinking about that, Thank you for fixing the bug I've been introduced. However, as I contributed, I cannot RTBC.
Comment #30
claudiu.cristeaState that the new module is a testing module.
Comment #31
pfrenssenHere is a version of the patch from #30 that only includes the test. This is just to see that the test correctly fails when the functionality is missing. No changes have been made.
Comment #33
pfrenssenPatch looks good! The test fails correctly and the code looks good.
I only have one small remark but this is too trivial to block the patch on.
This should be
Tests the contextual links of the placed blocks..Comment #35
manuel.adanIt looks fine for me too. Thank you all!