Entity Token module tries to create property info for entity wsclient_service but there is no property info available. This produces an error on the status report screen saying --Tokens are defined but missing-- The following patch adds very basic property info which effectively removes the error.

Comments

klausi’s picture

Interesting, I do not see this message on my status report page. I greped through the entity and token module, but could not find it. How can I reproduce that message?

Anyway, web service descriptions are configuration items. Is there any use case why we would want to expose tokens at all? We could just set 'token type' to FALSE in hook_entity_info().

wesnick’s picture

Status: Active » Needs review
StatusFileSize
new658 bytes

Setting to FALSE did not work, but unset did.

klausi’s picture

Status: Needs review » Postponed (maintainer needs more info)

Strange. Again: How can I reproduce that error message? On what page exactly? What module throws the message? What is the exact message?

wesnick’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new30.04 KB

I can figure out how to reproduce it in a clean install. My installation is producing an extra token output, somehow it is producing a token, without a corresponding type

[wsclient_service] => Array
                (
                    [url] => Array
                        (
                            [name] => URL
                            [description] => The URL of the web service description.
                            [module] => token
                            [type] => url
                        )

                )

For what it's worth, screenshot attached

klausi’s picture

StatusFileSize
new371 bytes

Thanks, does this patch fix the issue for you? Make sure to clear the cache.

wesnick’s picture

No, this patch doesn't fix it. I have been able to reproduce this on a vanilla install. The offending module that is adding tokens is token.tokens.inc in this code block around line 40.

    // Add [entity:url] tokens if they do not already exist.
    // @todo Support entity:label
    if (!isset($info['tokens'][$token_type]['url']) && (!empty($entity_info['uri callback']) || !empty($entity_info['bundles'][$entity]['uri callback']))) {
      $info['tokens'][$token_type]['url'] = array(
        'name' => t('URL'),
        'description' => t('The URL of the @entity.', array('@entity' => drupal_strtolower($entity_info['label']))),
        'module' => 'token',
        'type' => 'url',
      );
    }

Entity token module filters wsclient_service token types, but token module adds in tokens automatically for all entities that have one of the above conditions. If you have the wsclient_ui module installed, the following is true

$entity_info['uri_callback'] = 'wsclient_ui_uri';

and token module adds wsclient uri token.

So either, we explicitly unset $entity_info['token types'], or we provide some property info for wsclient_service, but as you said, there is probably no real use case for this.

wesnick’s picture

Issue summary: View changes

fixed grammar

klausi’s picture

Issue summary: View changes
Status: Needs review » Closed (works as designed)

I assume this is not an issue anymore? Reopen if this is till a problem.