Closed (fixed)
Project:
Reference field option limit
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Sep 2013 at 07:17 UTC
Updated:
1 May 2014 at 22:40 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
joachim commentedFor line 184 I have:
Could you check and see if your entity type has bundles defined? IIRC they always should!
Comment #2
Mołot commentedIt's standard Basic Page, new node form. Drupal 7.23 (upgraded from 7.20 one minor version at a time). Some custom modules, but no other modules touching entities workflow in a way that should matter. Just admin menu, internationalization package and my custom forms writing to my custom tables that aren't even in my main Drupal database.
Comment #3
Mołot commentedIf you need any more info, please tell what exactly. Anyway, if it's possible to have bundles not defined, I think modules should test for it and output something meaningful to the watchdog, not to allow PHP error to happen.
Comment #4
joachim commentedCan you debug the entity info at that point?
From https://api.drupal.org/api/drupal/includes!common.inc/function/entity_ge...
Entity info should always have a bundles array.
Comment #5
Mołot commentedAt what point? I mean, I don't have any custom code. It's built-in entity - good old basic page node. So if you want me to put dpr() somewhere, please tell me where. In your module just before line 184?
Comment #6
joachim commentedI've had a thought -- could it be the combination of array_pop(array_keys())?
What version of PHP are you running?
Comment #7
Mołot commented5.4.14
Comment #8
joachim commentedYup it'll be that then.
The result of array_keys() needs to be set in a variable to then be passed to array_pop().
Comment #9
Mołot commentedI guess it's a change simple enough you don't really need anyone to create a patch?
Comment #10
jgullstr commentedStill getting this warning in current dev.
Comment #11
joachim commentedI'm always a bit wary of the PHP functions for returning an item from an array (end(), key(), etc), because they all speak of returning the item for 'the current array pointer location' and that's something that's sort of concealed, and therefore doesn't feel reliable...
But this seems to be ok, so let's go with it :)