Closed (fixed)
Project:
Universally Unique IDentifier
Version:
7.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Aug 2012 at 23:50 UTC
Updated:
21 Jul 2013 at 06:11 UTC
Hi guys check out this patch that fixes a variable name on entity_access. It seems that $entity_id got renamed, moved, and removed on one the last commits.
$entity_ids = entity_get_id_by_uuid($entity_type, array($args[1]));
$entity = NULL;
if (!empty($args[2])) {
$entity = entity_create($entity_type, $args[2]);
// We have to make the entity local (i.e. only have local references), for
// access functions to work on it.
entity_make_entity_local($entity_type, $entity);
}
// Fetch the local entity if we've got an id.
elseif (!empty($entity_id)) {
$entities = entity_load($entity_type, $entity_ids);
$entity = reset($entities);
}
As you can see $entity_id is always empty and the variable should be $entity_ids.
Cheers.
| Comment | File | Size | Author |
|---|---|---|---|
| uuid_services-fix_entity_ids_varialbe.patch | 895 bytes | lucascaro |
Comments
Comment #1
lucascaro commentedComment #2
socialnicheguru commentedchecked the uuid code and you're right it was changed to entity_ids
Comment #3
socialnicheguru commentedthere are a few places where the change was not made:
cd modules/uuid
grep -in entity_id -d recurse *
however it is referenced here:
plugins/arguments/entity_uuid.inc:65: $entity_id = $entity_ids[$arg];
plugins/arguments/entity_uuid.inc:66: $entities = entity_load($entity_type, array($entity_id));
plugins/arguments/entity_uuid.inc:71: return ctools_context_create('entity:' . $entity_type, $entities[$entity_id]);
Comment #4
lucascaro commented@SocialNicheGuru I think those other cases you pointed out are actually meant to be a different variable, $entity_id. AFAIK the only problem was that one variable name in that line that needs to be updated.
In general though, if it's an array, it should be $entity_ids and if it's a scalar (just one id) it should be $entity_id.
Anyways, without the patch $entity never gets loaded by the code.
cheers.
Comment #5
dillix commentedWhen this bug will be fixed?
Comment #6
dillix commentedComment #7
jpstrikesback commentedEDIT: I'm changing the status to critical here, this little gem borks uuid_services retrieve nicely, albeit not in all circumstances, but likely most.
When tested with any user that has the administer users permission we are immediately granted access, any other user without that specific permission will be denied access as the entity object to check is NULL due to the issue described and fixed here.
Comment #8
kevinquillen commentedSounds like the critical bugs need to be round up into an achievable list so a release can be made. There are different facets of UUID that, depending on what you are doing, can cause fatal errors. See #1663390: Roll a new UUID stable release - it's been an extremely long time since a release and there are some pretty heavy bugs sitting in the last stable release.
Comment #9
jpstrikesback commentedReassigning to unassigned.
Comment #10
dixon_Patch from OP is committed to 7.x-1.x-dev. Thanks!