Login | Forgot password | Register

X

What is OpenID?

OpenID is an Internet-wide identity system that allows you to sign in to many websites with a single account.

With OpenID, your ID becomes a URL (e.g. http://username.myopenid.com/). You can get a free OpenID for example from myopenid.com.

For more information visit the official OpenID site.

Jump to:

1155 Posts in 324 Topics by 274 members

Data Model Questions

SilverStripe Forums » Data Model Questions » RESTful Server bug with many_many relations

Page: 1
Go to End
Author Topic: RESTful Server bug with many_many relations 462 Views
  • motoservo
    avatar
    Community Member
    23 posts

    RESTful Server bug with many_many relations Link to this post

    On the wiki it explains that I should be able to use a restful operation in the form:

    "GET /api/v1/(ClassName)/(ID)/(Relation) - get all of the records linked to this database record by the given relation".

    but this operation won't execute if the relation is a many_many. It seems to work okay as a has_one or a has_many though.

    Does anyone have a suggestion? I'm using a daily build of trunk from just a few days ago.

  • motoservo
    avatar
    Community Member
    23 posts

    Re: RESTful Server bug with many_many relations Link to this post

    UPDATE

    The reason for this bug is an error on line 521 of RestfulServer.php. The
    method called getObjectRelationQuery() should return this line:

    return $this->getSearchQuery($relationClass[1], $params, $sort, $limit,
    $query);

    instead of:

    return $this->getSearchQuery($relationClass, $params, $sort, $limit,
    $query);

  • Ingo
    avatar
    Administrator
    596 posts

    Re: RESTful Server bug with many_many relations Link to this post

    Thanks for tracking this down motoservo! So much for consistent API return values... ;)
    I've fixed this in trunk with http://open.silverstripe.com/changeset/81346

    462 Views
Page: 1
Go to Top

Currently Online: motly, Euphemismus, Thomas B. Nielsen

Welcome to our latest member: fearofbuttons

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.