404s and empty pages on single-document views (when ids are not Mongo-generated?) #19

Closed
julien-c opened this Issue Jul 6, 2012 · 3 comments

Comments

Projects
None yet
2 participants
@julien-c

julien-c commented Jul 6, 2012

I get 404s and empty pages when going into the "detailed" single-document view (e.g. http://localhost/genghis/servers/localhost/databases/amazon_product/collections/similarities/documents/0060517123) though I know these documents exist (they're listed in the "list" view, for one).

Not sure why, but this seems to only happen on collections where ids were not autogenerated by MongoDB (those are barcode-like natural ids).

@bobthecow

This comment has been minimized.

Show comment
Hide comment
@bobthecow

bobthecow Jul 6, 2012

Owner

The issue is (probably) that Genghis implicitly wraps IDs in an ObjectId when requesting the object directly (GET, POST, DELETE):

https://github.com/bobthecow/genghis/blob/master/src/php/Genghis/Api.php#L389-432

This could probably be fixed by only wrapping it if the ID string is a 24 character hex string. Do me a favor and test this version, let me know if it works?

https://dl.dropbox.com/u/439174/genghis.php.tgz

Owner

bobthecow commented Jul 6, 2012

The issue is (probably) that Genghis implicitly wraps IDs in an ObjectId when requesting the object directly (GET, POST, DELETE):

https://github.com/bobthecow/genghis/blob/master/src/php/Genghis/Api.php#L389-432

This could probably be fixed by only wrapping it if the ID string is a 24 character hex string. Do me a favor and test this version, let me know if it works?

https://dl.dropbox.com/u/439174/genghis.php.tgz

@julien-c

This comment has been minimized.

Show comment
Hide comment
@julien-c

julien-c Jul 6, 2012

It does!

(wow, impressive speed :)

julien-c commented Jul 6, 2012

It does!

(wow, impressive speed :)

@bobthecow

This comment has been minimized.

Show comment
Hide comment
@bobthecow

bobthecow Jul 6, 2012

Owner

Cool. Feel free to keep using that version, and I'll get the fix into the next release.

Owner

bobthecow commented Jul 6, 2012

Cool. Feel free to keep using that version, and I'll get the fix into the next release.

@bobthecow bobthecow closed this in 9507f4c Jul 6, 2012

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