Closed (fixed)
Project:
Drupal core
Version:
8.1.x-dev
Component:
views.module
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
9 Dec 2015 at 21:28 UTC
Updated:
13 Mar 2016 at 22:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
czigor commentedThis kind of works. Might need some cleanup.
Comment #3
czigor commentedWriting test is in progress.
Comment #4
dawehnerGiven semantic versioning this won't land in 8.0.x but just in 8.1.x
... field handler
There should be a more specific service available now.
Unused
That method is not used
Comment #5
czigor commentedThanks for the review! Tests are still under construction.
I'll fix 1.
2. I'm implementing here \Drupal\views\Entity\Render\EntityTranslationRenderTrait::getEntityManager() which should return a \Drupal\Core\Entity\EntityManagerInterface. Until it's not fixed there I can't really do anything about it.
3-4: I need to implement these too because they are abstract methods of \Drupal\views\Entity\Render\EntityTranslationRenderTrait.
Comment #6
dawehnerOh yeah you are right,
Comment #7
czigor commentedCredits go to @eager_hun for providing a connection to the world wide web.
Comment #8
dawehnerIMHO we could use the API directly, so using
EntityViewMode::create()->save()andEntityViewDisplay::create()->save().Its just unnecessary HTTP requests without any benefit, IMHO
Comment #9
dawehnerGiven that people might want to use it in 8.0.x already, we backported it to https://github.com/fago/entity/pull/19
Comment #10
czigor commentedThanks, that makes perfect sense. Number of lines in test has been drastically reduced.
Comment #11
jibranI think this is ready other then this minor feedback.
AFAICS we are not using this method so this can be removed.
Comment #12
czigor commented:) Yes, it is, see comment #5 -> 3-4.
Comment #13
bojanz commentedI want to try and convert that test to a kernel one, for speed.
Comment #14
dawehnerThank you @bojanz!!
Comment #15
mglamanHere's my attempt at porting it to ViewKernelTestBase
Comment #17
dawehnerConverted the test to use entity_test entities, and some more changes.
Comment #18
bojanz commentedWe're good to go.
Made some final code style tweaks.
Comment #19
bojanz commentedActually the test had unused imports.
Comment #20
bojanz commentedThe calculateDependencies part was requested by dawehner. Fixed a few comments along the way.
Now really RTBC?
Comment #22
jibranWhy not use $entity->getEntityTypeId() instead of $this->getEntityTypeId()?
Comment #23
dawehnerI'm okay with that, but the testbot isn't.
Comment #24
bojanz commentedBah.
Comment #25
dawehnerHa, I'm confused because there is also getEntityType() on there.
Comment #26
dawehnerYeah nevermind the trait adds this.
Comment #27
alexpottI think we should add some more test coverage...
So these views are uncacheable?
Comment #28
digitaldonkey commentedI can Confirm the patch working.
"Uncachable" sounds like a very bad Idea. Didn't check that yet.
But I consider this a an essential feature of views as everybody should use viemodes as much as possible (think about your themers ;) ).
It will also enable e.g. Table layout with rendered entities.
So I hope It will be ready in 8.3.
Comment #29
czigor commentedCaching changed to tags-based.
Translation and cache-tag tests are also coming soon.
Comment #30
michaellenahan commentedI would like to test this manually, but I'm not sure how to manually test the fact that the rendered entity is being cached.
Comment #31
digitaldonkey commentedTested on Drupal VDD with Drupal 8-1.x
Works as expected. Cache entries are created in cache table (tag based). --> Seems to work :)
Comment #32
jcnventuraWe looked at this in the Frankfurt sprint.
Comment #33
czigor commentedComment #34
dawehnerIMHO we should set #access to
$entity->access('view', NULL, TRUE);Comment #35
dawehnerComment #36
dawehner@czigor Did you managed to add some translation / cache-tags tests?
Comment #37
czigor commentedSorry, no. It's high on my list, but I still can't say when I will find the time for it. Feel free to take it.
Comment #38
dawehnerAlright, I'll give it a try. Thanks you for your really quick response.
Comment #39
jibranI think we need an empty update hook to clear the views data cache.
Comment #40
dawehnerTrue, I guess. On the other hand, nothing is broken without it. The new feature will just appear at some point ;)
Comment #41
dawehnerSure, here it is.
Comment #42
mohit_aghera commentedI've tested patch #41 on locally.
It seems working fine. Content is also rendered in proper display format. Screenshot attached.
Comment #45
bojanz commentedWeird, it applies with fuzz locally. Here's a reroll anyway.
Comment #47
bojanz commentedNow with less trash.
Comment #50
bojanz commentedmglaman caught the duplicate update number.
Comment #51
bojanz commentedBack to RTBC.
Comment #52
dawehnerComment #53
catchCan't imagine this is necessary for entity_test.
Copy/paste comments - no nodes or body?
Also copy/paste comments?
Comment #54
dawehnerOh yeah , there we go.
Comment #55
bojanz commentedSorry about that, catch.
#54 addresses #53, a search shows no more mentions of "node". Let's give it another shot.
Comment #57
catchThat's better. Committed/pushed to 8.1.x, thanks!
Comment #59
yannickooOh that's funny, I have created a module for that 4 months ago - well done guys :)
Comment #60
xjm