Problem/Motivation
View mode class appears only with the media--view-mode- prefix and no actual view mode. The reason for that is the fact that preprocess adds its machine name while template expects the object.
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | 2930274-18.patch | 1.3 KB | sam152 |
| #17 | 2930274-16.patch | 1.42 KB | berdir |
| #13 | 2930274-test.patch | 919 bytes | dawehner |
| #13 | 2930274-13.patch | 1.48 KB | dawehner |
| #9 | 2920678-test.patch | 861 bytes | dawehner |
Comments
Comment #2
slashrsm commentedComment #3
sarguna raj m commentedComment #4
sarguna raj m commentedHi slashrsm,
I have applied the patch #2 and it has applied successfully without any issue. But I'm unable to test it. Could please provide a Test case to test the patch.
Thanks.
Comment #6
pierre-nono commentedThanks you slashrsm, this fixed our problem.
To sarguna raj M, I don't really see the point of a Test case pour this.
Just create a media, any type, and check the html if you see the class
media--view-mode-your_view_idon it.Comment #7
dawehnerI think here is a test which works.
Comment #8
berdirit's actually shipped by classy, and we're also only testing that now I think?
Also wondering if a kernel test for this really makes sense or if we should just add an assertContains() to \Drupal\Tests\media\Functional\MediaUiFunctionalTest or a similar existing actual web test?
Comment #9
dawehnerThat is a good point!
Comment #13
dawehnerWow, it is not obvious that
cssSelectworks different on a different environment.Comment #16
berdirJust removed the print_r() leftover, I expect this will pass.
Comment #17
berdirComment #18
sam152 commentedCame here to RTBC, but tiny nit, this is also equivalent to:
Comment #19
sam152 commentedWhoops, this was already RTBC to begin with. Setting back for #17. If #18 passes, I suppose we can use that one too.
Comment #20
berdir#18 looks fine, agreed that if that passes, that's the patch to commit :)
Yeah, I kind of RTBC'd my own patch but I just removed a debug line. This way it's better anyway :)
Comment #23
lauriiiLooks good. Committed b888a36 and pushed to 8.6.x. Also cherry-picked to 8.5.x 76c103f because it seems highly unlikely that anyone would have themed using the broken class name. Thanks!