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.
when a person does a action with ur like send a request, the relationship is not showing with the dev version, the custom message is %relationship_name, Your !relationship_name request has been sent to xxx
Comment | File | Size | Author |
---|---|---|---|
#8 | dsm-placeholder-1485184.patch | 715 bytes | mcrittenden |
Comments
Comment #1
aacraig CreditAttribution: aacraig commentedThere is a bug in user_relationships_ui.module on line 29. It is missing the replacement value for the %relationship_name variable.
The correct code should be:
Comment #2
aacraig CreditAttribution: aacraig commentedAfter further testing, I see that the message parameter is missing in more than one message. That led me to discover the user_relationships_get_message() function in user_relationships.module, which I think is the true culprit.
On line 945, replace:
with this:
This always tries to replace the variable %relationship_name, regardless of which message it's in.
Comment #3
Berdiruser_relationships_type_translations() provides these placeholders already, see http://api.worldempire.ch/api/user_relationships/user_relationships.modu....
You need to use e.g. %rel_name instead of %relationship_name. Assuming that you customized the message and the default one is correct, this is merely a documentation issue, we need a change record for this.
Comment #4
aacraig CreditAttribution: aacraig commentedThe error is in core user_relationships modules, not in custom code.
The message mentioned by printed by alejandro_oses is generated in the user_relationships_ui.module, for instance.
Comment #5
BerdirNot in 7.x-1.x-dev, not in that file...
There actually are some remaining usages of %relationship_name, but not in user_relationships_ui.module.
- Those in user_relationhip_defaults.module should be updated to use the previously mentioned function but aren't technically broken because they are explicitly provides.
- The one in user_relationships.admin.inc is documentation and should be updated with those from the mentioned function instead. Probably move them out of the text there into a single list that also has descriptions.
- Same for the one in actions.inc, should be replaced with a call to the function.
- The one in .install is upgrade path and ok.
So, what's necessary here:
- Fix the the mentioned remaining uses of that one
- Document the new placeholders
- Create an upgrade path for custom messages
- Write a change record.
Patches are welcome :)
Comment #6
Triumphent CreditAttribution: Triumphent commentedGreat fix aacraig, thank you. It worked for me. More than a year after posting your fix in #2, the module still hasn't been corrected. And they claim it is "Actively maintained?" hmmmm....
Comment #7
BerdirWell, it's marked as minimally maintained for now, happy? ;)
Still not seing a patch here.
Comment #8
mcrittenden CreditAttribution: mcrittenden commentedPatch for #2.
Comment #10
BerdirThe relationship doesn't have a name, only the type. And the correct fix is to change remaining cases that use %relationship_name to @rel_name.