action_label property does not work in term tag

compujohnny - July 23, 2009 - 17:32
Project:Patterns
Version:6.x-1.x-dev
Component:Miscellaneous
Category:bug report
Priority:normal
Assigned:Unassigned
Status:by design
Description

I created a simple pattern that creates a content type (Item), vocabulary (Cameras) and term (Point-and-Shoots) and assigned that term to a node of type (Item).
It worked just fine.

I then tried to make the term value dynamic by using the same syntax you used on your example for action_label

It worked only when its in a role tag

- tag: role
action_label: adminrole
value: site_admin
- tag: permissions
role: site_admin
value: edit any page content
- tag: user
name: siteadmin
password: adminpassword
mail: siteadmin@localhost
roles:
role: @adminrole@

But when I tried it with a term tag it did not work, I debugged the code and found that the action_label is added to the $clone array only in the role action but not in the term action.

- tag: content
name: Item
type: item
description: Product item
status: 1
promote: false
comment: 0
upload: 1
- tag: vocabulary
name: Cameras
nodes:
item: item
- tag: term
action_label: vocab1_term1
value: Point-and-Shoots
vocabulary: Cameras
- tag: node
type: item
title: Canon Powershot SX10IS
body: Canon Powershot SX10IS 10MP Digital Camera with 20x Wide Angle Optical Image Stabilized Zoom
taxonomy:
vocabulary: Cameras
term: @vocab1_term1@

Please help me if I am doing anything wrong,
Thanks,

#1

sarvab - July 24, 2009 - 06:09

Have you tried changing term: @vocab1_term1@ to term: Point-and-Shoots?

Its true that the taxonomy part doesn't have identifiers built into it currently, which I'll be committing shortly upon realizing that here, but I believe the tags there are looking for names instead of ids.

#2

vaish - August 7, 2009 - 16:44
Status:active» by design

As Sarva already mentioned, term expects term name to be passed, not term id (which would be represented by action_label). Proper syntax should be:

    taxonomy:
      - vocabulary: Cameras
        term: Point-and-Shoots

Once action_label (identifier) is implemented for term action, you will also be able to do the following:

    taxonomy:
      - vocabulary: Cameras
        tid: @vocab1_term1@

Note that here we are using tid instead of term because action_label always represents unique id of created/updated item (e.g. nid, tid, uid, rid, etc).

Vaish

 
 

Drupal is a registered trademark of Dries Buytaert.