Closed (fixed)
Project:
Entity API
Version:
7.x-1.x-dev
Component:
Core integration
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Dec 2010 at 20:30 UTC
Updated:
9 Jul 2011 at 17:24 UTC
Jump to comment: Most recent file
Comments
Comment #1
fagoI'm not on it either, but the reference is currently required for user saving to work. Once #999004: user_save() relies on $edit instead of $account is fixed, this problem would be gone though.
Is anyone on 5.3 experiencing troubles with that?
Also, why should the reference problematic? When entity_save() is called directly with an entity object, it should work, or?
Comment #2
pillarsdotnet commentedI'm running php 5.3 without this patch, with E_ALL turned on, and haven't seen any notices pointing to this particular issue.
Comment #3
pillarsdotnet commented@fago -- the reference is only problematic if this particular function gets called by call_user_func_array(). See the note in the PHP manual, just above the user-contributed section. It looks like none of your callback functions take a variable number of arguments, so they should be okay. Hook functions that are dispatched by module_invoke() or module_invoke_all() are a different story.
Comment #4
fagoyep, but entity_save() isn't called that way so it should be fine.
Comment #5
chx commentedThe patch is completely harmless, it's entirely pointless (and one might say wrong and misunderstood) to take an object by reference. http://drupal4hu.com/node/224
Comment #7
sunyeah, I think we did the same for all function arguments being objects throughout Drupal core.
Comment #8
pillarsdotnet commentedTitle change, since this has nothing to do with php 5.3 compatibility.
Comment #9
fagoIn that case, it's not true. As said, the current saving implementing for users changes the reference on the object. PHP5's way of dealing with objects is not the same as a reference, so don't mix that up.
And without the user_save() patch being committed, this patch is not harmless. Try running entity API tests without it...
Comment #10
fagoPostponed till #999004: user_save() relies on $edit instead of $account is fixed.
Comment #11
pillarsdotnet commentedSince #999004: user_save() relies on $edit instead of $account is fixed, this should no longer be postponed.
Comment #12
pillarsdotnet commentedentity.save_.0.patch queued for re-testing.
Comment #13
fagoright. I've updated the patch so the user-callback doesn't try to change the entity object any more.
I guess we should introduce a dependency on 7.2 once we commit the patch. Though #1013302: Composer metadata on dev versions doesn't work in update.php still bothers me.
Comment #14
fagoComment #15
fagocommitted - be sure to run drupal > 7.2 when using entity_save() for user accounts.
I'm adding a note that we require 7.2 on the project page.