Needs work
Project:
User Relationships
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Mar 2012 at 10:59 UTC
Updated:
26 Apr 2013 at 18:08 UTC
Jump to comment: Most recent file
Comments
Comment #1
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 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 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 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 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.