Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
entity_reference.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 May 2014 at 02:51 UTC
Updated:
19 Nov 2014 at 09:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
larowlanComment #2
tim.plunkettSure, this is harmless, and swaps more functions for methods.
Comment #3
amateescu commentedSince ControllerBase provides $this->entityManager() now, shouldn't we remove the container get call from our create() method instead?
Comment #5
larowlanReroll and fixes #3
Comment #6
amateescu commentedLooks good now, thanks :)
Comment #8
mikemiles86Last patch failed due to changes to PSR-4. Re-rolling patch.
Comment #9
mikemiles86re-rolled patch.
Comment #10
amateescu commentedentity_get_form_display() does a bit more than just loading the entity display. Rerolled without that part and the rest looks good.
Comment #11
berdir@amateescu: entity_get_form_display() and entity_get_display() are one of the few functions left in entity.inc that do not have a OOP replacement. Should we open an issue to add one? Not sure if it will be accepted in 8.0.x, but we can try. Any thoughts on where to put it? static method on the entity classes similar to loadByName()?
Any opinions on the name? EntityViewDisplay::getDisplay() ? or more explicit on what it does like loadOrCreate()?
Comment #12
amateescu commentedYep, having those as static methods "somewhere" sounds good. However, if we put them in their respective entity classes might make them a bit less discoverable, so maybe STUFF ALL THE THINGS inside EntityManager? :)
EntityManager::getViewDisplay() and ::getFormDisplay() is what I'd propose.
It should be if we leave the functions in place as a wrapper.
Comment #13
berdirThat works for me too, although there's an issue open to split up the entity manager into an entity field manager or something, as it's getting huge.
Comment #14
alexpottThese changes are out of scope since deprecated functions have other issues to do this.
How come?
This is fixing a bug. Let's rescope this issue to do just this.
Comment #15
amateescu commentedOkey dokey.
Comment #16
amateescu commentedAlso opened #2367933: Move entity_get_(form_)display() to the entity display repository for #11.
Comment #17
amateescu commentedHard to find a patch simpler than this one.
Comment #18
alexpottThis issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per #2350615: [policy, no patch] What changes can be accepted during the Drupal 8 beta phase?. Committed de1d788 and pushed to 8.0.x. Thanks!