According to #945066: Use token tree UI for D7, "The D7 token module provides a token tree UI, and no longer supports the token_help theme item."

Therefore, whenever I go in to edit a file / image field on my site, I get a WSOD, and an error in the dblog. Working on a patch...

Comments

geerlingguy’s picture

Hmm... might not be this module, but still, filefield_source_attach_settings() probably needs updating...

quicksketch’s picture

Thanks @geerlingguy. I'll be happy to look at anything you'd like to send my way.

Kris Bank’s picture

Version: 7.x-1.x-dev » 7.x-1.4

I'm having the same issue on two sites (D7.0 and 7.9).

I create a content type with an image field, click on edit field, then get "Theme key "token_help" not found." watchdog message as well.

After looking through other modules, I've pinned it down to the following section of filefield_source_attach_settings():

$return['source_attach']['tokens'] = array(
      '#type' => 'markup',
      '#value' => theme('token_help', 'user'),
    );

Suggestions on an appropriate theme hook?

pjcdawkins’s picture

Suggestions on an appropriate theme hook?

As suggested in the OP, I think theme_token_tree() can be used to replace theme_token_help(), so it'd be something like

    '#value' => theme('token_tree', array('token_types' => array('user'))),

(utterly untested)

kingfisher64’s picture

I'm getting this warning as well:

Location: http://core/admin/structure/types/manage/article/fields/field_image
Referrer: http://core/admin/structure/types/manage/article/fields

Theme key "token_help" not found.

Has anything been decided regarding a patch for this?

michellezeedru’s picture

I only see this error in the logs, but the problem I'm experiencing is that in an image field that allows multiple uploads, after an image is selected using "file attach" or "remote url" methods, the user is not presented with the option to add another file. If I just upload the file, I get the "add new file" option.

quicksketch’s picture

Priority: Major » Normal
Status: Active » Fixed
StatusFileSize
new1.09 KB

This patch should correct the problem. @pjcdawkins just about had it, but the theme function name changes from 'token_help' to 'token_tree' in D7. Committed to D7 version.

Status: Fixed » Closed (fixed)

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

Jorrit’s picture

Status: Closed (fixed) » Active

This change leads to the following error logged to watchdog when the token module is not enabled:

Theme key "token_tree" not found.

My suggestion is to not write $return['source_attach']['tokens'] when the token module is not enabled.

quicksketch’s picture

Status: Active » Fixed

Thanks @Jorrit. Fixed that up finally and it will be in the 1.8 version.

Status: Fixed » Closed (fixed)

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