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
Resource creation fails with IDatasetForm extra fields with names sorting before and after 'extra_validation' #621
Comments
@wardi could you replace the links so that they point to the specific file/patch you are referring to. Also if you could add the traceback in a comment on this issue that would be really helpful thanks |
@tobes links updated and:
|
From the mailing list http://lists.okfn.org/pipermail/ckan-dev/2013-March/004242.html Fabian says this applies to another issue as well
|
@seanh have you any thoughts on this? |
Yes, I think I need a drink |
:) |
The schema is a dict so I don't know how we can make it run the "extra_validation" rule before or after all the others, unless we special-case that rule, If @wardi's fix fixes this problem and doesn't break any of the tests (either the core tests or my IDatasetForm tests) then I would be tempted to take it as-is, on the grounds that I want to merge my pending IDatasetForm pull request before I look at this one |
@seanh Assigning this to you just so you are aware of it and in case is related to the IDatasetForm stuff you are working on now. Feel free to ignore it if not. |
I think we need to get my other idatasetform pull requests merged first, then we can see if this bug still occurs and if this fix still fixes it |
Confirmed this is still happening on master |
Confirmed @wardi's commit fixes the problem, and all the tests (including example_idatasetform tests) still pass with this commit. I'm tempted to just take this commit but I'll have a look after lunch and see if there's a more elegant way... |
Fix a crash when generating a 'duplicate extras key' error. To trigger the crash, post a dataset dict to package_create() containing two extras dicts with the same key. There is no test for this yet.
This code path was not covered by the tests.
This makes it consistent with other errors that CKAN returns.
This fixes an issue where creating a new resource would crash in validation if there was a custom field (using convert_to/from_extras) with a name that sorted after extras validation alphabetically. Fixes #621.
Fix a crash when generating a 'duplicate extras key' error. To trigger the crash, post a dataset dict to package_create() containing two extras dicts with the same key. There is no test for this yet.
This code path was not covered by the tests. Conflicts: ckan/tests/logic/test_action.py
This makes it consistent with other errors that CKAN returns.
Steps to reproduce:
What happens:
A traceback is issued with an IndexError in ckan.lib.navl.dictization_functions.flatten()
Workaround:
I wrote a patch wardi@fa99298 that avoids the problem. This fix is rather inelegant, better would be to execute the 'extra_validation' rule before or after all the other rules. I leave that decision to the experts.
The text was updated successfully, but these errors were encountered: