Closed (outdated)
Project:
Drupal core
Version:
7.x-dev
Component:
field system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Nov 2009 at 15:46 UTC
Updated:
27 Nov 2009 at 13:40 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
sunNot sure whether dropping langcode from the structure is a good idea... wouldn't it prevent the possibility of editing two languages on the same page? (in contrib)
Comment #3
yched commentedThe current implementation doesn't really allow editing two languages on the same page either, because we still have a single #language property:
so we cannot really have another $form[$field['field_name']][$other_langcode] at the same place...
But true, we don't really have to make that change, + it seems to break quite a few other stuff, so let's try with a simpler one.
Comment #4
sunHm. This patch looks fine.
However, ideally, I'd like to pass the #parents upfront to all widgets, so they are able to shift around values (*within* the widget's own elements) and base the operations on the passed in #parents.
As mentioned in the other issue, one-element widgets like the number widget would be perfect candidates for that. They only need 1 form element, and therefore such widgets would just have to extend the existing #parents - instead of altering the form structure.
Comment #5
yched commentedI think this is actually outdated by #641670: Move $form['#field'] meta information into $form_state
Comment #6
yched commentedUndupe, I reduced the scope of #641670: Move $form['#field'] meta information into $form_state for now.
I still think the approach in the initial patch over there (automatic extraction of #parents at after_build time, + using the 'parents' in field_default_extract_form_values()) makes sense, but this can be discussed here.
Additionally, other places in core that currently rely on a hardcoded location in $form_state['values'][$field_name][$langcode]: file_field_widget(), locale_field_node_form_update_field_language().