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.)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Itangalo’s picture

Further 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.

naught101’s picture

Core 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?

naught101’s picture

Status: Active » Postponed
Issue tags: +D7 stable release blocker
FileSize
671 bytes

Here'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.

Itangalo’s picture

Wonderful. 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.

Itangalo’s picture

Patch 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.

naught101’s picture

Status: Postponed » Fixed

Automatically closed -- issue fixed for 2 weeks with no activity.