Hello;
I am a Drupal user and front-end developer. I recently switched to Drupal 8.0.2 and I'm having some issues with the contextual links.
With permissions to use contextual links active only for admin, I still can see the DIVs generated on my markup when the page is accesed anonymously.
i.e, I can see this DIV:
<div data-contextual-id="block:block=views_block__noticias_en_portada_block_1:langcode=es|entity.view.edit_form:view=noticias_en_portada:location=block&name=noticias_en_portada&display_id=block_1&langcode=es"></div>
Caches were cleared, both the browser's and Drupal.
This is an issue for designers because when using flexbox the presence of unwanted siblings like those divs throws away the design (since they're used for calculations - "justify-content: space-between" and the like - even when empty or height and width = 0"
I think this is a bug and not a feature. However, this is my first time filing a core issue so please help me if I am putting this in the wrong place...
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | 2650246-13.patch | 2.88 KB | swentel |
Comments
Comment #2
idiaz.ronceroJust for the record: obviously drush pm-uninstall quickedit and contextual solves the problem...
Comment #3
idiaz.ronceroI found some other people reporting the same issue at StackOverflow
http://stackoverflow.com/questions/34073778/why-is-data-contextual-id-sh...
Comment #4
swentel commentedHmm yes, it seems a little silly to generate markup when the current user has no access to it.
Patch attached fixes this.
Comment #6
swentel commentedInteresting fails, even though I think the fix is right since contextual_page_attachments() does the same check, so we should fix the tests here.
Comment #7
wim leersComment #8
wim leersComment #9
swentel commentedSo what exactly is the work now ? :)
Comment #10
wim leersOops!
Nit: Let's omit the comment, that's quite obvious?
More importantly, the corresponding cache context is missing:
Comment #11
swentel commented1. sure, makes sense
2. ok, but we'll probably want test coverage for this then I guess, or is this enough ?
Comment #12
swentel commentedOk scratch that patch, looked at the referenced issue where the context needs to be, new patch coming up
Comment #13
swentel commentedAnd go
Comment #14
wim leersYou can't test for the presence of
user.permissionsbecause it's always present. It's just a best practice to be explicit about it.(At some point, we should start adding the ability to tests with no required cache contexts, so that code that's written entirely correctly can indeed test for this. But that will only start making sense when 9.x is on the horizon, because only in 9.x will we be able to remove at least
user.permissionsas a required cache context.)RTBC as far as I'm concerned, but I'd like a front-end person to approve it.
Comment #16
star-szrComment #17
zakiya commentedFront-ender here. Wasn't sure which branch to test against. The patch works on 8.0.x branch. 8.1.x seems broken for other reasons. Marking as RTBC.
Comment #18
zakiya commentedGot clarity on which branch to test against. Should be 8.1.x because that's what the issue is set to. Changing back to needs review. Sorry for the noise.
Comment #19
jacineI can confirm what @zakiya found. The patch is good, but 8.1.x is borked right now (can't even install Drupal), so we can't properly test it there. However, we both applied the patch to HEAD, tested it there and all is working perfectly.
Given the state of this branch, is it ok to mark RTBC?
Comment #20
wim leersQueued for retesting. Patch applies cleanly locally.
I guess #17 & #19 are saying Drupal 8.1 HEAD itself is currently broken?
Comment #21
jacineYup. Core itself is borked. Specifically:
Comment #22
wim leersThat's not a bug. Since a few days ago, Drupal 8.1 doesn't include the vendor libraries (Symfony etc.) anymore. See https://www.drupal.org/node/2648064.
In the command line, go to your Drupal 8 install and do this:
composer install. Now you can install Drupal 8.1 again.Comment #23
swentel commented@Jacine you need to run composer install in the root directory of drupal from now on if you checkout from git. (tarballs are find IIRC)
Comment #24
swentel commentedah, typing the same thing [won't comment now anymore ;)]
Comment #25
jacineO.M.G. Thanks guys.
Comment #26
zakiya commentedOkay tested #13 on 8.1.x and it works. Marking RTBC.
Comment #27
xjmBringing #13 back to the top of the list.
Comment #28
xjmI.... do not know what just happened to the files summary. Trying to hide earlier files.
Comment #31
catchCommitted/pushed to 8.2.x and cherry-picked to 8.1.x. Thanks!
Comment #32
star-szrNice, was just coming to commit this. Thanks all :D