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.
It seems that the view pages for relations including file entities fail. I get the following error message:
Recoverable fatal error: Argument 3 passed to l() must be an array, string given, called in …/sites/all/modules/relation/relation.field.inc on line 122 and defined in l() (line 2306 of …/includes/common.inc).
Steps to reproduce:
* Drupal 7 + Relation, latest versions.
* Upload an image to account for user 1.
* Add a relationship "uses image", directional, relating any node bundle to any file bundle.
* Use the relation picker block to add a node and then the user image to a new relation.
* Follow the link to the new relation.
-> Error message, as described above.
(This bug is also captured in a sceencast. Link will appear once it is posted.)
Comment | File | Size | Author |
---|---|---|---|
#5 | 1260134-5-formatter_for_files.patch | 849 bytes | Itangalo |
#3 | relation-file-uri-workaround.patch | 671 bytes | naught101 |
Comments
Comment #1
Itangalo CreditAttribution: Itangalo commentedFurther investigations show that if you hide the relation endpoints in the "field display" settings for the relation type, its view page renders just fine. The same error appears if you try to edit, though.
This strengthens the suspicion that this is a rendering issue.
Comment #2
naught101 CreditAttribution: naught101 commentedCore bug report is here #1057242: entity_uri() should not use $entity->uri (was $file->uri doesn't match the contract for uri callbacks)
Not sure if that's likely to get in to d7, if it looks like it won't, it won't be difficult to implement a work-around. How much do you need this right now?
Comment #3
naught101 CreditAttribution: naught101 commentedHere's a basic workaround patch, if you need it. Postponing until more comes up on that issue. tagging as release blocker just as a reminder to add this work around if core isn't fixed by then.
Comment #4
Itangalo CreditAttribution: Itangalo commentedWonderful. I'll try out the patch.
There is no time pressure from my part – it was just a bug I encountered while recording screencasts, and I thought I should report it. Interesting to know that it actually is an effect of a core bug.
Comment #5
Itangalo CreditAttribution: Itangalo commentedPatch works fine! I re-rolled it against the new project structure (relation_endpoints.module) and added a comment.
Let's hope the $file->uri bug gets fixed in core, to make this patch unnecessary.
Comment #6
naught101 CreditAttribution: naught101 commented#1057242: entity_uri() should not use $entity->uri (was $file->uri doesn't match the contract for uri callbacks) has been backported to 7. This is fixed, no need for the patch.