After upgrading to 1.0-beta4 I get the following error:
Notice: Undefined index: comment_node_panel in _token_field_info() (line 1209 of /modules/token/token.tokens.inc).

Comments

dave reid’s picture

Status: Active » Postponed (maintainer needs more info)

This would imply that $entity_info[$entity]['bundles'][$bundle]['label'] is not defined when $bundle = 'comment_node_panel'. What module are you using that creates bundles like that? Panels?

hswong3i’s picture

Confirm also facing this error message. Should I post the list of all enabled modules as refer?

cateye’s picture

I am not using Panels.

I am using:
Node Reference
Profile2
Token
Pathauto
Rules
User Points
Fields

I will try to reproduce it on a clean install and enabeling each module etc.

sun-fire’s picture

I have the same trouble.

There are lot of notices in site's log, like this:

Notice: Undefined index: page in _token_field_info() (line 1209 of /sites/all/modules/token/token.tokens.inc).

Webestdesigns’s picture

I too am getting the following errors after updating;
Notice: Undefined index: comment_node_himuesgallery in _token_field_info() (line 1209 of /---/sites/all/modules/token/token.tokens.inc).
Notice: Undefined index: comment_node_media_gallery in _token_field_info() (line 1209 of /---/sites/all/modules/token/token.tokens.inc).
Notice: Undefined index: himuesgallery in _token_field_info() (line 1209 of /---/sites/all/modules/token/token.tokens.inc).
Notice: Undefined index: default in _token_field_info() (line 1209 of /---/sites/all/modules/token/token.tokens.inc).

dave reid’s picture

Title: Undefined index: comment_node_panel » PHP notice: Undefined index in _token_field_info()
Version: 7.x-1.0-beta4 » 7.x-1.x-dev
Status: Postponed (maintainer needs more info) » Active
dave reid’s picture

This is so frustrating - I never encountered this and all of a sudden apparently fields still have data that says they're attached to non-existant entity bundles. I'll add some protection to prevent this.

dave reid’s picture

If someone can help reproduce starting with a clean install, and slowly working through until this can be reproduced that would be great. I would like to know where it is going wrong.

adamwhite’s picture

I'm getting the same problem. I'm wondering if Quiz has something to do with it as many of my errors reference it:

Notice: Undefined index: comment_node_quiz in _token_field_info() (line 1209 of /---/sites/all/modules/token/token.tokens.inc).
Notice: Undefined index: comment_node_multichoice in _token_field_info() (line 1209 of /---/sites/all/modules/token/token.tokens.inc).
Notice: Undefined index: comment_node_quiz_directions in _token_field_info() (line 1209 of /---/sites/all/modules/token/token.tokens.inc).
Notice: Undefined index: comment_node_scale in _token_field_info() (line 1209 of /---/sites/all/modules/token/token.tokens.inc).
Notice: Undefined index: comment_node_matching in _token_field_info() (line 1209 of /---/sites/all/modules/token/token.tokens.inc).
Notice: Undefined index: quiz in _token_field_info() (line 1209 of /---/sites/all/modules/token/token.tokens.inc).
Notice: Undefined index: multichoice in _token_field_info() (line 1209 of /---/sites/all/modules/token/token.tokens.inc).
Notice: Undefined index: scale in _token_field_info() (line 1209 of /---/sites/all/modules/token/token.tokens.inc).
Notice: Undefined index: matching in _token_field_info() (line 1209 of /---/sites/all/modules/token/token.tokens.inc).

Can I provide any more info to help out?

justmagicmaria’s picture

I got this when I installed the FAQ module, created a FAQ, then disabled the FAQ module. If I uninstall the module, it goes away.

dave reid’s picture

Assigned: Unassigned » dave reid
Status: Active » Needs review
StatusFileSize
new848 bytes

Please test the following patch as a fix in the meantime until I can figure out what is causing this.

design.er’s picture

path from #11 works like a charm for me. thanks so much!

bt82’s picture

...same here. patch worked just fine using d7.7. thanks again

cateye’s picture

I can not reproduce this issue on a clean install yet.

dave reid’s picture

Priority: Normal » Minor
Status: Needs review » Active

Committed #11 to 7.x-1.x as a temporary measure. Still want to debug this and figure out *why* its not working.

http://drupalcode.org/project/token.git/commit/44f9331

cateye’s picture

Entity tokens is causing the problem. If I turn the module off, the notice is gone.

dave reid’s picture

Can anyone else confirm that disabling Entity API prevents this problem? Make sure *not* to update to 7.x-1.x-dev to try this and be sure to clear your caches to get it to generate.

cateye’s picture

To be precise: Entity API is not causing the problem. Entity tokens (7.x-1.0-beta10) is causing the problem. So please confirm that turning on/off "Entity tokens" is effecting the error notices.

michellezeedru’s picture

Hi - I can confirm that turning off Entity tokens makes the errors go away, turning it on makes them come back.

Of course, without Entity tokens my custom breadcrumbs don't work right ...

Let me know if there's anything else I can do to help debug!

paulgemini’s picture

I'm with others in suspecting that this is entity api. Not coincidentally, there have been some recent changes to entity api dev. Here are they are:

http://drupal.org/node/626176/commits

None of those recent commits stick out to me in dealing with entity tokens, though many of them deal with entity/rules integration...

The Rules module just underwent a whole pile of changes:

http://drupal.org/node/190124/commits

js’s picture

Yes disabling entity_tokens worked for me as well.

All my errors messages related to taxonomy vocabularies. The above patch did not help.

AND, thank you for Token.

robert.laszlo’s picture

I am getting this error as well. Disabling the Entity Token module seemed to make the errors go away on most pages, but not completely.

I also tried reverting back to beta 3, but that didn't seem to work either.

Any suggestions?

dave reid’s picture

Project: Token » Entity API
Component: Code » Entity tokens
Assigned: dave reid » Unassigned

Moving this to the entity issue queue.

We are encountering problems with the following code in token module when entity_tokens is enabled:

      $fields = field_info_fields();
      $instances = field_info_instances();
      $entity_info = entity_get_info();

      foreach ($fields as $field) {
        if (!empty($field['bundles'])) {
          // $field['bundles'] is an array of entities with an array of the bundles that have this field like array('node' => array('article', 'page'), 'comment' => array('comment_article'));
          foreach (array_keys($field['bundles']) as $entity) {
            foreach ($field['bundles'][$entity] as $bundle) {
              // This is where we get the PHP notice since $entity_info[$entity]['bundles'][$bundle] is undefined.
              $label = $entity_info[$entity]['bundles'][$bundle]['label'];
            }
          }
        }
      }
dfishjr’s picture

Subscribe

chemicalroman’s picture

Subscribe

rodrigoaguilera’s picture

sub

guywithglasses’s picture

subscribe

The patch at #11 works for me. THANK YOU.

FWIW: I did a specific action on my site that caused the problem. I enabled the core "blog" module, then changed my mind and disabled it. Then my site had the following error messages on the pages:

Notice: Undefined index: comment_node_blog in _token_field_info() (line 1209 of **path info deleted**/sites/all/modules/token/token.tokens.inc).
Notice: Undefined index: blog in _token_field_info() (line 1209 of **path info deleted**/sites/all/modules/token/token.tokens.inc).

I'm running Drupal 7.7 with current Token release. I didn't check every page of my site for the error message, but it was on every page I looked at which FWIW were all Panels node template pages.

giorgosk’s picture

Have same problem
tried to install the entity API latest dev's thinking that it might solve the problem
still warning messages appear ...

giorgosk’s picture

StatusFileSize
new859 bytes

modification on temporary #11 patch

if you get more warnings after having both
latest dev release token and latest entity api
together with commerce

Notice: Undefined index: comment_node_product in _token_field_info() (line 1209 of /home/dimco/public_html/sites/all/modules/token/token.tokens.inc).
Notice: Undefined index: product in _token_field_info() (line 1209 of /home/dimco/public_html/sites/all/modules/token/token.tokens.inc).
Notice: Undefined index: product in _token_field_info() (line 1209 of /home/dimco/public_html/sites/all/modules/token/token.tokens.inc).

apply on latest token dev release

gratefulsk’s picture

Disabling entity tokens cleared all my errors. I was getting about 10 of them on every page.

ryan258’s picture

Does anybody know if this has any effect on Ubercart sites not having a properly working entity token module?

spacereactor’s picture

Subscribe

BeaPower’s picture

I am also getting these errors after disabling the chatroom module:

Notice: Undefined index: comment_node_chatroom in _token_field_info() (line 1209 of /var/www/vhosts/eex.com/httpdocs/34/modules/token/token.tokens.inc).
Notice: Undefined index: comment_node_chat in _token_field_info() (line 1209 of /var/www/vhosts/eex.com/httpdocs/34/modules/token/token.tokens.inc).

Starminder’s picture

+1

dave reid’s picture

Project: Entity API » Token
Component: Entity tokens » Code
Assigned: Unassigned » dave reid

Ok I'm able to duplicate this by enabling and then disabling core Forum module without having Entity tokens enabled, so I'm moving this issue back. It appears that I didn't account for field_info_field() having information about fields attached to disabled bundles. The temporary patch is good - I'm going to round out some comments.

Also merging in #1256444: Multiple Warnings: Warning: array_count_values() [function.array-count-values]: The argument should be an array in _token_field_ which happens when a field is only attached to all disabled bundles.

dave reid’s picture

Ok everyone I've added http://drupalcode.org/project/token.git/commit/17f41be which should resolve this for good. This is the type of issue I hoped to be able to prevent by having tests written but I didn't have to time to be able to push out the basic token support. I will likely roll another beta release at the end of day.

dave reid’s picture

Status: Active » Fixed
paulgemini’s picture

Many thanks, Dave!

damienmckenna’s picture

timwee’s picture

Path /admin/reports/event/163721
Reference /admin/reports/dblog
Message Notice: Undefined index: label în _token_field_info() (linia 1218 din \sites\all\modules\token\token.tokens.inc).

This error appears only with entity token enabled.

project = "token"
version = "7.x-1.x-dev"
datestamp = "1314061405"

project = "entity"
version = "7.x-1.x-dev"
datestamp = "1313713320"

gabriel.achille’s picture

Many thanks Dave.

Denon’s picture

I use the latest dev version of token datestamp = "1314753094"
I have several lines with this error in my website log, each refresh brings more error lines.
Notice: Undefined index: label in _token_field_info() (line 1225 ..token\token.tokens.inc).

Line 1225 is:
$info[$key]['bundles'][$token_type][$bundle] = $entity_info[$entity]['bundles'][$bundle]['label'];
This error appears only when entity token ( latest dev) is enabled.
Any solution will be greatly appreciated!
Thank you

damienmckenna’s picture

I found the cause of my problem - I had a field exported via Features which was assigned to two content types, but one of them had been deleted, so as it was iterating through the field's $bundles array it came across a reference to the now defunct content type thus logged an error.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.