Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have properly installed the module Token, Content Profile, and activate the Content Profile Token. However when using rule, there is still nothing like "Replacement Pattern for Author Content Profile" and hence no token available for Content Profile. I'm using Content profile 6x-1.0.
Comment | File | Size | Author |
---|---|---|---|
#4 | select-1063234-4.patch | 1.85 KB | jeffam |
Comments
Comment #1
szeidler CreditAttribution: szeidler commentedSame problem here:
content_profile_tokens.module line 20 is always empty on registration. I think that the node is not created at this point of time.
Comment #2
mrfelton CreditAttribution: mrfelton commentedChanging this line to the following resolves this issue. But, I think it may have a bit of a performance hit, since it will cause the node to be fully reloaded for every single token evaluation.
So, my solution is to call
content_profile_load($type_name, $object->uid, '', TRUE);
myself just before I want to process the tokens in my custom user registration #submit handler. This causes the content profile cache to be rebuilt, and ensures that the tokens are available for use in my registration handler.Comment #3
kmajzlik CreditAttribution: kmajzlik commentedhm almost same issue here: i have custom module using
function content_profile_tokens_token_values($type, $object = NULL, $options = array())
and i have ONLY SOME of fields as tokens there. I searched why and found:
content_profile_tokens.module
Why that stupid IF on line #28 ? I have fields with type Integer and widget Select list. Not important why i need select list, but why somebody thought that i do not want that field as token?
Comment #4
jeffamJust ran into this issue myself and decided to test and see what would happen if I allowed text fields using the select box widget to be used as tokens.
Seems to work just fine.
I suspect that there is a reason that only numbers and textfields were allowed to be used, but I can't really see it. As long as multiple fields are being excluded, this should just work.
So here's a patch.
Comment #5
PinoloMarking as duplicate of #1123030: Content Profile Token support for additional widget types, multiple value fields. There, you can find a more comprehensive approach to the issue.