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
Routed to "undefined" collection item when adding new items #17
Comments
Your configuration looks fine. This is definitely a bug. My guess right now is that the MySQL backend isn't correctly finding the ID after the row is created. Could you post the Also, are you upgraded to the latest version of Yancy? There was a bug fixed in v1.005 where the editor would show new items as "undefined" instead of the real data. That would probably make the log look like that. |
Just want to add a couple more things: When you use read_schema without any collection config Yancy doesn't display any fields at all unless you use x-list-columns. Not sure if this is the intended behavior. Also x-ignore under Extended Field Configuration references collections instead of fields. |
|
Right now, The Thanks for posting the table schema. I'll run some tests and see what I come up with. Might be a week or so. |
Awesome, thank you. Yancy really is an amazing piece of work, there's nothing else like it (drop-in database management). I also love it because it's a very quick way to include Bootstrap, jQuery and Font Awesome in my project. FYI, I"m using "$VERSION = '1.007';" |
When we aren't given a list of columns we have to try to make one up. If we then also don't have a field named "id", it is quite possible that our table will have no columns in it at all. Now, we use the x-id-field if specified to make sure that we have at least one useful column in the table. Thanks @ViktorNacht for reporting this problem Refs #17
Okay, I think I've fixed this problem: It was an issue with setting I've also updated the default Once Travis-CI tells me it's okay, I'll release v1.008. Thanks for the help in fixing this issue! |
[Fixed] - Fixed editor not fetching newly-created item when `x-id-field` is set in the collection. Thanks @ViktorNacht for reporting this issue! [Github #17] - Fixed item list table not showing any columns when `x-id-field` is set. Thanks @ViktorNacht for reporting this issue! [Github #17] - Fixed docs for the `x-ignore` collection configuration appearing under the field configuration
When creating new collection items I receive the following output from Morbo:
`[Mon Sep 10 10:34:36 2018] [debug] POST "/yancy/api/vendors" (8622a8f9)
[Mon Sep 10 10:34:36 2018] [debug] Routing to controller "Yancy::Controller::Yancy::API" and action "add_item"
[Mon Sep 10 10:34:36 2018] [debug] 201 Created (0.007491s, 133.494/s)
[Mon Sep 10 10:34:36 2018] [debug] GET "/yancy/api/vendors/undefined" (03f60b91)
[Mon Sep 10 10:34:36 2018] [debug] Routing to controller "Yancy::Controller::Yancy::API" and action "get_item"
[Mon Sep 10 10:34:36 2018] [warn] OpenAPI >>> GET /yancy/api/vendors/undefined [{"message":"Missing property.","path":"/vendor_address"},{"message":"Missing property.","path":"/vendor_name"},{"message":"Missing property.","path":"/vendor_phone"}]
[Mon Sep 10 10:34:36 2018] [debug] 500 Internal Server Error (0.002883s, 346.861/s)
`
I'm using a very minimal test config:
plugin Yancy => { backend => 'mysql://***', read_schema => 1, collections => { vendors => { title => 'Vendors', 'x-list-columns' => [qw(vendor_name vendor_address)], 'x-id-field' => 'vendor_id' } } };
I sincerely apologize if this is a configuration issue, but as far as I can tell, it should just work.
Updating and deleting work fine.
The text was updated successfully, but these errors were encountered: