In case you want to use token replacements to store data, not to display it to user, you would prefer to to store it as is rather in formatted form. But right now we have no ability to choose does replacements should be formatted or no, they always formatted.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | unformatted_replacements-2082407-6.patch | 1.96 KB | rosk0 |
Comments
Comment #1
rosk0Initial patch.
Comment #2
valthebaldTested patch manually with CRM core donation profile.
Before patch: donation form fails with white screen.
After patch: donation form submits correctly.
Comment #3
fagoThen you are using the wrong system - token system is for formatting data for text replacements. If you want data values, uses the metadata wrapper.
Besides that, this introduces an undocumented option switch which is not good either.
Comment #4
rosk0@fago: Probably I described our use case with wrong words. We are using tokens in CRM Core Profile in this way: user creates a form with UI, lets say for event registration, this form when get submitted creates multiple entities: contact to store data about who is registered, activity - stores info about registration to event. In CRM Core Profile form builder we allow user to use tokens to specify values that should be set automatically upon submission. This values can include node id of the event user registered to, amount user paid for registration, etc. We can use wrapper to get real values, it's not a problem, the problem is that we don't know what field of what entity the user will decide to use and where(in what field). And for me the token system is working great for this purpose. Without this patch we can't use CRM Core Profile forms to collect integer data values greater then 1000 via token system and I want to ask you to help me figure out workaround for this problem.
Comment #5
rosk0Comment #6
rosk0Reroll against HEAD.
@fago: Is there any chance that you will think about solution to our problem?
Comment #7
socialnicheguru commentedComment #8
roborew commentedI ran into a similar issue. I needed to use the Key value in a field select list, but found the Entity Token module re-formats the token using the label value, if its available.
I wrote a simple module to tackle the problem which I believe would solve the feature you are looking for above. Please take a look and have a test.
https://www.drupal.org/sandbox/roboco/2709617
Comment #9
chris matthews commentedThe 4 year old patch in #6 to entity_token.tokens.inc applied cleanly to the latest entity 7.x-1.x-dev, but changing the status back to Won't fix per Fago's comment in #3 and workaround here: https://www.drupal.org/sandbox/roboco/2709617