I have created content type : Prepaid Coupon (CHAR 16). These are generated by Admins. User suppose to enter valid coupon code to register. I m on D7.15.
My code is as follows :
$query = new EntityFieldQuery;
$pincode = $query
->entityCondition('entity_type', 'node')
->entityCondition('bundle', 'prepaid_coupon')
->propertyCondition('status', 1)
->propertyCondition('title', [value]) // this does not work, whatsoever combination you may try.. works with $this->value
->fieldCondition('field_coupon_status', 'value', 'Unused')
->execute();
if (empty($pincode['node'])) //unused PIN found so scrap it..
{
$this->set_error();
}
I am also using Rules2. So i set status of Coupon to Used after the user successfully logged in. There I am using replacement token : [account:field-prepaid-coupon] which work perfectly.. If this is not error/bug but some of my stupidity then i apologize in advance. This is my 1st report/bug on Drupal.
Comments
Comment #1
g089h515r806 commentedIt does not support this feature in php validator.
Comment #2
Ananya MultiTech commentedHi..
thanks for quick reply. Can you please tell me how should I access these variables/tokens while using PHP??
**and can I help somehow to make this work. Because field validation is great module and i will certainly like to get involved if I can be of some use..
Comment #3
g089h515r806 commentedChange it to feature request.
I have researched on this feature before, maybe we could add more token support in the future. but in Drupal 7, there is not a general way to support field token. I have created a module http://drupal.org/project/compound_token which could solve field token issue.
Comment #4
Yuri commentedThis is not a feature request since the settings show that a replacement pattern can be used.
This issue is 4 years old and should be solved.