DBRef objects link to a 404 page #71

Closed
nicktacular opened this Issue Jan 9, 2013 · 6 comments

Comments

Projects
None yet
2 participants
@nicktacular

When displaying DBRef objects, it appears that not all links are working correctly. Suppose you have this in an object:

ParentID: {
    $ref: "page",
    $id: 28
}

Clicking on $ref: "page" takes me to the page collection if I'm not already there and or in some query. Everything is good here; just as expected.

However, clicking on $id: 28 takes me to a 404 page:
/servers/localhost/databases/mydb/collections/page/documents/28

Expected: See the document with _id:28 in the page collection.
Actual: 404 page (/servers/localhost/databases/mydb/collections/page/documents/28)

Genghis version: Version 2.1.6
PHP: 5.3.3
Mongo: 2.2.2

@bobthecow

This comment has been minimized.

Show comment
Hide comment
@bobthecow

bobthecow Jan 10, 2013

Owner

I'm not sure I follow what's happening here... If you navigate directly to that document (rather than clicking through the dbref) what url do you hit?

Owner

bobthecow commented Jan 10, 2013

I'm not sure I follow what's happening here... If you navigate directly to that document (rather than clicking through the dbref) what url do you hit?

@nicktacular

This comment has been minimized.

Show comment
Hide comment
@nicktacular

nicktacular Jan 10, 2013

If I navigate directly to a document (say {_id:28}) then the URL looks like this:
/servers/localhost/databases/mydb/collections/page/documents/~Mjg%3D

I did this by clicking on the collection, scrolling down to the object I wanted to see, and clicking on the title 28 which took me to the URL above.

However, if I do the same thing but utilize a DBRef to get to the same object by clicking on $id: 28 in a DBRef, it tries taking me to this URL (which is a 404):
/servers/localhost/databases/mydb/collections/page/documents/28

The difference appears to be ~Mjg%3D versus 28 in the URL. The latter making more sense, but obviously that's just an implementation detail.

Does this help?

If I navigate directly to a document (say {_id:28}) then the URL looks like this:
/servers/localhost/databases/mydb/collections/page/documents/~Mjg%3D

I did this by clicking on the collection, scrolling down to the object I wanted to see, and clicking on the title 28 which took me to the URL above.

However, if I do the same thing but utilize a DBRef to get to the same object by clicking on $id: 28 in a DBRef, it tries taking me to this URL (which is a 404):
/servers/localhost/databases/mydb/collections/page/documents/28

The difference appears to be ~Mjg%3D versus 28 in the URL. The latter making more sense, but obviously that's just an implementation detail.

Does this help?

@bobthecow

This comment has been minimized.

Show comment
Hide comment
@bobthecow

bobthecow Jan 10, 2013

Owner

Yep, that helps.

It's getting confused because the _id isn't an ObjectId... the ~... encoded url params are used for all non-ObjectId id types. Apparently I didn't add logic for those to the DBRef links :)

Owner

bobthecow commented Jan 10, 2013

Yep, that helps.

It's getting confused because the _id isn't an ObjectId... the ~... encoded url params are used for all non-ObjectId id types. Apparently I didn't add logic for those to the DBRef links :)

@bobthecow

This comment has been minimized.

Show comment
Hide comment
@bobthecow

bobthecow Jan 18, 2013

Owner

Thanks for helping me track this down. It has been fixed in develop. Do you mind giving that version a shot and making sure it works as you expect?

Owner

bobthecow commented Jan 18, 2013

Thanks for helping me track this down. It has been fixed in develop. Do you mind giving that version a shot and making sure it works as you expect?

@bobthecow bobthecow closed this Jan 18, 2013

bobthecow added a commit that referenced this issue Feb 11, 2013

@nicktacular

This comment has been minimized.

Show comment
Hide comment
@nicktacular

nicktacular Feb 11, 2013

It's looking good on my end. Thanks very much!

It's looking good on my end. Thanks very much!

@bobthecow

This comment has been minimized.

Show comment
Hide comment
@bobthecow

bobthecow Feb 11, 2013

Owner

Great, thank you!

Owner

bobthecow commented Feb 11, 2013

Great, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment