Closed (fixed)
Project:
Barcode
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
9 Feb 2012 at 14:22 UTC
Updated:
15 Nov 2017 at 16:55 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
tedbowAttached a patch. not positive about this part
$item['value'] = token_replace($item['value'], array('entity' => $entity), array('clear' => 1));Not sure if 'entity' is the right key.
This patch all makes this module dependent on entity and entity_token(part of entity).
Comment #2
Anonymous (not verified) commentedI tried it with the patch, it continues to generate a bar code in the results page of entityform with core tokens like [current-page:url] or [current-date:short], but it can't seem to get tokens such as [entityform:field_sometext] & [entityform:field-sometext] (this is a text field attached to the entityform type).
This functionality is very desirable.
Comment #3
tedbowAttached another patch. This time using $entity_type as the key in the $data array instead of the string 'entity'. I think this is right.
I would probablyttest this not only with an Entityform but also with the same fields attached to the user account. It technically should work with any entity. Using User might help you avoid any problems introduced by Entityforms module since it is very new.
Let us know if user works and not entityforms then I will know there is a problem with my module.
Thanks
Comment #4
Anonymous (not verified) commentedThe patch in #3 works! Entityform field tokens working with Barcode module to create a bar code from user input. Many thanks. Hope this gets included in Barcode.
Comment #5
tedbowGlad the patch works. Hope it gets included too. I learned a bit about entity_token at least.
Comment #6
Anonymous (not verified) commentedComment #7
MM10 commentedWould this now work with line items in the Commerce module?
SKU integration with line items
Comment #8
tedbowPotentially the patch should allow the Barcode field to be attached to any entity. But it would need to be tested.
Comment #9
oenie commentedI was trying this our myself with the Profile2 module, which uses entities.
I discovered the bug before i found this bug report.
It works for Profile2 fields, referencing other specific fields within a Profile2 entity.
Even referencing other Profile2 entity types for the same user, like:
[profile2:user:profile-main:field-my-name]resolves nicely to getting the field-my-name value from a profile-main entity associated with the user.
That would be a works for me. What do we need to get this patch included in the builds ?
It's over a year ago, and i still run into this very same problem.
Comment #10
bhosmer commentedI'm working on using this with computed field to generate random 13-digit numbers to supply a UPC on user registration.
The problem I am encountering is the form validation for the default value is validating the actual length of the text for the place-holder token, instead of the values for the token itself.
I'm going to dive a little more and see if I can determine a solution to this.
Comment #11
bhosmer commentedAfter diving deeper today, there are multiple validations happening. It seems the plugin validations don't actually do anything.
I wound up just using a token along with the great Ted Bowman's patch and choosing "codabar" for my code type.
Comment #12
bhosmer commentedResetting to RTBC.
Comment #14
skyredwangI have committed this patch to 7.x-2.x-dev http://cgit.drupalcode.org/barcode/commit/?id=d307676
Comment #16
isalmanhaider commentedHello skyredwang,
I have a custom entity type built with ECK
The barcode fields works fine on nodes i.e basic pages etc but not ECK entities.
Any idea on how do I make it work?
Thanks