Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
entity system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Sep 2012 at 12:42 UTC
Updated:
29 Jul 2014 at 21:13 UTC
Jump to comment: Most recent file
Comments
Comment #1
berdirNo, it needs to be fixed the other way round.
This definition makes no sense. You can't have an optional first argument and a required second.
Comment #2
berdirThe other option would be to switch $values and $entity_type.
Comment #3
sunLet's fix all implementations first.
Let's discuss whether to flip the arguments in a separate issue.
Comment #4
andypostNew patch to fix implementations
Also filed #1796760: Change order of parameters in Entity constructors
Comment #5
andypostThis is a actually a bug
Comment #6
podarok#4 looks like very simple catch
do we need separate issue #1796760: Change order of parameters in Entity constructors from this?
Comment #7
andypost@podarok #1796760 is different task, This issue about bug
Comment #8
podarok#7 if so
#4 looks good for me
any backgrounds from someone?
Comment #9
xjmLooks like a good cleanup to me.
Comment #10
chx commentedWell, certainly this public function __construct(array $values = array(), $entity_type) { makes no sense because if entity_type is mandatory then values is mandatory too. So yes this fix makes sense.
Comment #11
webchickComment #12
webchickOops. Clicking around too fast. :)
This one is simple enough. Committed and pushed to 8.x. Thanks!