cubicweb #961831 migration failure when defining form fields [resolved]
In the cube conference, I use the cube shoppingcart, but define a custom field to override the behavior of the default form for ShoppingItem. This custom field references ShoppingItem in an attribute of the class. When Python reads the class definition, it looks for ShoppingItem in the schema, but since the migration and its add_cube('shoppingcart') has not been run yet, it can not find it. This means that one can not access the shell nor migrate the instance. Embracing the form field definition in a try/except fixes the problem, but is kind of ugly. Could not we find a better way to prevent this to happen ? | |
priority | normal |
---|---|
type | bug |
done in | 3.9.9 |
load | 1.000 |
load left | 0.000 |
closed by | #faee4c380e50 [forms] catching KeyError closes #961831: migration failure when defining form fields |
similar entities
- cubicweb #1113844 Migration script function to reindex a given entity
- cubicweb #473794 when an entity type is renamed, physical db index should be renamed as well
- cubicweb #344306 enhance the input of multiple entities
- cubicweb #342116 make path of bookmark editable without seeing url quoted value
- cubicweb #1381203 [formfields] not all fields delegate form analysis to their widget
[see all]
Comments
-
2010/10/01 15:36, written by sthenault
-
2010/10/01 19:55, written by nchauvat
-
2010/10/04 05:41, written by adimascio
add commentwould you have a snippet of the offending code?
I think it is the migration of conference-0.5.0, but that ticket is not very important to me now.
I think the problem was (is) with code using the etype_relation_field factory, as in:
If either item_type or quantity is only defined in the new version of the schema, this code will break until the migration is done.