Problem/Motivation

Commit 3465d2b4eca303fa8eec1ba7e17588edfc0074e6 removed the explicit definition of uri callbacks with an intent to delegate that back to Entity API or some other default uri behavior.

This means that, as far as the Entity API goes, there is no URI for a course object.

To demonstrate, you can use the following snippet.
Assuming $id is a valid course object id/nid...

$co= reset(entity_load('course_object', array($id)));
  $node= reset(entity_load('node', array($id)));
  dsm(entity_uri('course_object', $co), 'entity_uri for course_object!');
  dsm(entity_uri('node', $node), 'entity_uri for node!');

The first `dsm()` will be empty. The second will be 'node/XXXX' as you'd expect.
Using `$co->uri()` similarly comes up empty.

Is this even a bug, or was it intentional to remove the uri property for course objects completely?

Proposed resolution

TBD... this might have been intentional.

Remaining tasks

Maintainer input on intent behind change: Should course objects completely lack a url property now?

Comments

stickywes created an issue.

djdevin’s picture

Since course objects cannot be shared across courses we always know the full URL, which comes from ->getURL()

So maybe this is the one that should be used?