Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

@julien-c
Copy link

@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
Copy link
Owner

@bobthecow 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
Copy link
Author

@julien-c julien-c commented Jul 6, 2012

It does!

(wow, impressive speed :)

@bobthecow
Copy link
Owner

@bobthecow 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.