Repositioning of Language field fails. It can not be placed after the body field once it has been placed above it.
Steps to reproduce:
1. git pull
2. drush si
3. drush en translation language
4. Login as admin and using admin/config/regional/language, add a language.
5. Using admin/structure/types/manage/article under language settings select Show language selector, Enable translation and then Save Content Type.
5. Edit Article. Select Show language selector, Enable translation, Save Content Type
6. View node/add/article and notice that the Language field comes right after Image. (Screen shot)
7. Using admin/structure/types/manage/article/fields, move Language after Title. (Screen shot)
8. View node/add/article and notice that the Language field comes after Title. (Screen shot)
9. Using admin/structure/types/manage/article/fields, move Language after Body. (Screen shot)
10. View node/add/article and notice that the Language field DOES NOT come after Title. (Screen shot)
Comment | File | Size | Author |
---|---|---|---|
#14 | 1912992-14.patch | 3.9 KB | amateescu |
#11 | 1912992-11.patch | 3.92 KB | swentel |
#11 | interdiff.txt | 778 bytes | swentel |
#9 | 1912992-9.patch | 3.16 KB | swentel |
#9 | interdiff.txt | 773 bytes | swentel |
Comments
Comment #0.0
mitron CreditAttribution: mitron commentedUpdated issue summary.
Comment #1
mitron CreditAttribution: mitron commentedComment #2
ChrisMiller627 CreditAttribution: ChrisMiller627 commentedComment #3
ChrisMiller627 CreditAttribution: ChrisMiller627 commentedSo the issue here appears to be with the way the language field information is stored. The two naming conventions that look to be in dispute are
language
andlangcode
. I'm willing to bet by correcting the naming conventions of the machine name this issue will be solved.In the
cache_field
table the language field weight is being stored successfully in the extra field bundlefield_info:bundle_extra:node:article
. However, when the language select field is rendered on the node form in node/add/article, it's namedlangcode
.I traced the issue back a ways through the field.module, and isolated the problem to what is returned from
field_info_extra_fields()
in_field_extra_fields_pre_render()
. $extra_fields is populated incorrectly with the name 'language,' while $elements contains the name 'langcode.' This discrepancy wiIl prevent $elements['langcode'] from being updated correctly. I added a simple conditional below to demonstrate the issue:With that conditional added, the weight is correctly rendered on the node edit form.
I'm not entirely familiar enough with the larger scope of why the language module naming conventions are what they are, so I'll let someone else work through this a bit more. Hope this information helps however.
Comment #4
swentel CreditAttribution: swentel commentedConfirmed this is still an issue.
This is probably more a field api problem then language, so changing the component.
Comment #5
swentel CreditAttribution: swentel commentedThis fixes it
Comment #7
swentel CreditAttribution: swentel commentedfixing tests
Comment #9
swentel CreditAttribution: swentel commentedComment #11
swentel CreditAttribution: swentel commentedDjeez
Comment #12
amateescu CreditAttribution: amateescu commentedThis is so confusing! I had to dig a bit in EntityFormController and the fix is correct. RTBC hoping that the tests will pass this time.
Comment #13
alexpottPatch no longer applies.
Comment #14
amateescu CreditAttribution: amateescu commentedRerolled.
Comment #15
webchickWow, what a fantastic bug report! :) Glad the fix was so easy.
Committed and pushed to 8.x. Thanks!
Comment #15.0
webchickUpdated issue summary.