Not sure if it's a WF_ng or token bug.

I have a user reference. When I output a message with [node:field_user_reference_x-uid] it works ok, when I use [node:field_user_reference_x-name] it has no value

CommentFileSizeAuthor
#3 Snap1_21.png3.53 KBamitaibu
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fago’s picture

Project: Workflow-ng » Token

sounds like a token bug to me.

greggles’s picture

Status: Active » Postponed (maintainer needs more info)

[node:field_user_reference_x-uid]
and
[node:field_user_reference_x-name] are not valid tokens as provided by token module.

The valid format should be
[field_user_reference_x-name]

FWIW, I just tested this feature in both pathauto and auto node title and it worked fine.

amitaibu’s picture

FileSize
3.53 KB

Gerggles,
1. [node:field_user_reference_x-uid] does seem to work.
2. snap1 is from 'Replacement patterns for updated content'.

greggles’s picture

I'm using version = "5.x-1.x-dev"
Based on 1.4.2.15

I can't repeat your problem with the instructions you give. So, afaic, it's not a problem.

amitaibu’s picture

Project: Token » Workflow-ng

@greggles, thanks for the checking.

@Fago, I think this one is a Workflow-ng issue, and here's why - When I look at the 'Replacement patterns' under autonode title, I see the pattern is [nid], [type] and so on.

In WF-ng the patten appears as [node:nid], [node:type] etc'.

Here's my configuration:

array (
  'cfg_22' => 
  array (
    '#type' => 'configuration',
    '#altered' => false,
    '#event' => 'node_update',
    '#label' => 'Notify maintainers on update - Designer',
    '#active' => 1,
    '#module' => 'workflow-ng',
    0 => 
    array (
      '#type' => 'condition',
      '#name' => 'workflow_ng_condition_content_is_type',
      '#argument map' => 
      array (
        'node' => 'node',
      ),
      '#settings' => 
      array (
        'type' => 
        array (
          'style' => 'style',
        ),
      ),
      '#label' => 'node=Style?',
    ),
    1 => 
    array (
      '#type' => 'condition',
      '#name' => 'workflow_ng_condition_token_compare',
      '#negate' => 1,
      '#settings' => 
      array (
        'regex' => 0,
        'used arguments1' => 
        array (
          0 => 'node',
        ),
        'text1' => '[node:field_user_reference_designer-uid]',
        'used arguments2' => 
        array (
          0 => 'node_unchanged',
        ),
        'text2' => '[node_unchanged:field_user_reference_designer-uid]',
      ),
      '#label' => 'Maintainer changed',
      '#weight' => '1',
    ),
    2 => 
    array (
      '#type' => 'action',
      '#name' => 'workflow_ng_action_drupal_message',
      '#settings' => 
      array (
        'message' => 'new:
[node:field_user_reference_designer-uid]
[node:field_user_reference_designer-name]

old:
[node_unchanged:field_user_reference_designer-uid]
[node_unchanged:field_user_reference_designer-name]

Token original pattern?
[field_user_reference_designer-name]',
        'used arguments' => 
        array (
          0 => 'node',
          1 => 'node_unchanged',
        ),
        'error' => 0,
      ),
      '#label' => 'Show a configurable message on the site',
    ),
    '#name' => 'cfg_22',
  ),
)
fago’s picture

The replacement string is correct - workflow-ng invokes token with different prefixes for different entities (prefix == [node:), so that they can be distinguished, e.g. [node:title] vs [node_unchanged:title]. Auto nodetitle uses token default, which is prefix "[" -> [title]. So there is no bug here.

amitaibu, please try it again with the token version greggles stated to work. If it still doesn't work for you please try this token with auto nodetitle.

amitaibu’s picture

Fago,
Can you please send me a link of Gerggles version, I don't really understand what he means by "Based on 1.4.2.15"

(So far I've used token 5-1.9 and 5-1.DEV)

greggles’s picture

I was quoting a specific version of Automatic Node Titles that worked for me - not token.

So, it sounds like you need to be sure that the tokens you use for ANT are appropriate for that realm and the ones for Workflow-NG are the appropriate ones for that realm.

Fago - on a related note I just implemented a token parser for pathauto which finds tokens within patterns, checks if they look reasonable for that scope, and if not then warns them about it. That's starting to feel like a useful feature to have in token core, right?

fago’s picture

ops, sry I thought this was the token version. Hm, amitaibu so can you test it with the latest auto nodetitle dev snapshot? Be sure to test it with the right content type. If it does work there, it looks like a bug in workflow-ng, although I can't imagine this ugly bug ;)

@greggles: yep, that sounds like an amazing feature. This would be a great improvement for auto nodetitle too. But how do you check if it's reasonable for that scope? Is there a way to specify this information for tokens?

Anyway, I don't think amitaibu got hit by that, as another token for the same field [node:field_user_reference_x-uid] is working.

amitaibu’s picture

Ok, I see that in this specific content type also when using Autonode titles no matter what token I use, the title is ANT.

greggles’s picture

Amita - one problem per issue. I believe I know the solution to #10 and I refuse to mention it on the grounds that there should only be one problem per issue.

greggles’s picture

practicing what I preach: fago - I created a new feature request for that checkup feature http://drupal.org/node/188769

amitaibu’s picture

@greggles, I thought I was answering the requirement of one problem per issue ;) I simply replied to Fago question:

Hm, amitaibu so can you test it with the latest auto nodetitle dev snapshot? Be sure to test it with the right content type.

So, now we know it's not a WF_ng issue. I guess the title and project should change, but I'm not sure to what.

Cheers,
Amitai

fago’s picture

Category: bug » support

hm, that's strange. If it would be a token problem, the title wouldn't be ANT. Don't know what's wrong here, but that seems to be another issue. Perhaps some modules are interfering there.

Try deactivating modules and/or try to reproduce bugs on a clean install. Auto nodetitle shouldn't behave like this on a clean install.. If you got it working, test the token with it.

@greggles: I agree that there should be one problem per issue. :)