I see that I can pass "parameters[vid]=X" in the query string to get the entity/node that has revision X, but it seems to work only if X is the latest revision. Any prior revision results in "No entities found."

Any idea how to retrieve prior revisions through this interface?

Comments

joachim’s picture

Status: Active » Fixed

There is no support for revisions in this module currently.

Your use of "parameters[vid]=X" is working purely nodes have a 'vid' column and the resulting query makes sense. Hence you're not loading a revision, you're just specifying a condition which the node happens to satisfy.

Supporting revisions in the way you'd like would probably mean major changes to the module.

Status: Fixed » Closed (fixed)

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

wodenx’s picture

Category: support » feature
Status: Closed (fixed) » Needs review
StatusFileSize
new4.17 KB

Reopening. The attached patch allows specifying a "revision=" query param on GET requests to retrieve a specified revision. No support for update or delete.

Status: Needs review » Needs work

The last submitted patch, 1981890-3-services_entity-revisions.patch, failed testing.

wodenx’s picture

Version: 7.x-2.0-alpha3 » 7.x-2.x-dev
Status: Needs work » Needs review
wodenx’s picture

wodenx’s picture

Title: How to request specific revision of an entity? » Ability to request specific revision of an entity.

I think the original failure was because I hadn't changed the version for the issue. Now it's not testing, but the patch applies cleanly to 7.x-2.x-dev.

joachim’s picture

Looks fine to me, not tried it out.

wodenx’s picture

Status: Needs review » Postponed

Postponing until we have working tests.

wodenx’s picture

Assigned: Unassigned » wodenx
Issue summary: View changes
Status: Postponed » Needs work

Would like to see this get into the next release. Marking as needs-work bc I need to complete a test.

wodenx’s picture

Status: Needs work » Needs review
StatusFileSize
new6.77 KB

Here's a new version with a test.

wodenx’s picture

StatusFileSize
new6.02 KB

Updated patch to apply to HEAD. Would like to see this in the next release.

joachim’s picture

+++ b/plugins/services_entity_resource.inc
@@ -59,10 +59,22 @@ class ServicesEntityResourceController extends ServicesResourceControllerAbstrac
+        if ($id !== $entity_id) {
+          $entity = FALSE;
+        }

I think this should get its own call to services_error(), for better DX -- something specifically saying that the revision ID does not match up to the entity ID.

But I'm happy for that to be done as a follow-up.

Patch looks good to me otherwise :)

wodenx’s picture

Status: Needs review » Fixed

OK - committed with the suggested modification: http://drupalcode.org/project/services_entity.git/commit/103e0ec

Status: Fixed » Closed (fixed)

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