-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
language independent field definitions for dexterity #170
Comments
could somebody look at 55917b9 |
it seems that language independent fields don't support default values ... default_start is not called and events created show the first possible date, in this case a date in feb 2004 https://github.com/plone/plone.app.event/compare/1.1.x-lang-independent-fields @datakurre @jensens @thet @rnixx any ideas? |
Is the default value missing already from the add-form? Does it affect only p.a.event or all language independent fields? Please, file an issue for p.a.m. And if you have resources, a failing test would be great. It might be possible that the code, which looks lif value from existing translations fails to fallback to the default value when no translations exist yet. agitator kirjoitti la joulukuuta 13 11:28:51 2014 GMT+0200:
|
yes, on creation of the first object, no other langs exist. |
@agitator Would you have time to debug (wih pdb), why LIF-defaultvalueprovider does not fallback to the field's default value? The relevant code is It should, unless the field is somehow initialized before that's called. |
self.field.default is None |
Does the field have defaultFactory? Maybe support for that is what is missing from p.a.m. agitator kirjoitti su joulukuuta 14 13:22:13 2014 GMT+0200:
|
there, but also None |
it seems that the adapter for default_start isn't called
|
@agitator Ok, now that make sense and restores this to p.a.m issue. p.a.m. registers its own default adapter, which overrides your adapter. p.a.m support zope.schema defaults, but not custom z3c.form defaults (because it overrides them). Please, file an issue for p.a.m. Fix should be possible, but maybe not trivial, because it would require some ZCA-tricks for getting the adapter, which the language independent field default adapter hides. |
i don't have much resources to dive into this issues, but maybe this gives some hints? in plone.app.event 1.x we set the default values like so:
vs in plone.app.event 2.x (master branch): https://github.com/plone/plone.app.event/blob/master/plone/app/event/dx/behaviors.py#L56
plone.app.event 2.x doesn't have a custom behavior factory and IIRC, the IContextAwareDefaultFactory way doesn't work with behaviors with custom behavior factories. |
plone.dexterity = 2.2.4 might support zope.schema context aware default Johannes Raggam wrote:
|
context aware adapters work, but still fighting timezone problems with post_processing |
@agitator Nice to hear. @thet might be interested in discussing about post_processing; If I remember correctly, the post processing was almost done in the behavior adapter at one point, but it was later refactored into z3c.form event handler. One main issue has been that post_processing can only truly happen after all field values are known. |
talked to him at the aplinecitysprint, dug further into it, seems to be connected with the special post processing of dates within plone.app.event |
@agigator Yes, there's event handler, which is only called after successful Probably it should somehow be refactored back to behavior adapter, so agitator wrote
|
No description provided.
The text was updated successfully, but these errors were encountered: