Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Updated: Comment #N
Problem/Motivation
Go to edit any view, under "Advanced tab" click on "Field language" options.. You will get an empty form. This form also throws errors by assuming all entity info items will have a base table.
Proposed resolution
The DisplayPluginBase buildOptionsForm switch statement is for 'field_language' but the link (and other places) have been changed to 'field_langcode'. Change this switch case to 'field_langcode'
Remaining tasks
Review fix, tests
User interface changes
A fixed Field language form.
API changes
None
Related Issues
Comment | File | Size | Author |
---|---|---|---|
#15 | langcode.jpg | 243.06 KB | Anonymous (not verified) |
#2 | 2087069-2-tests-only.patch | 1.75 KB | damiankloip |
#2 | 2087069-2.patch | 3.64 KB | damiankloip |
#1 | 2087069.patch | 1.16 KB | damiankloip |
Comments
Comment #1
damiankloip CreditAttribution: damiankloip commentedHere is a fix, haven't got round to the tests yet.
Comment #2
damiankloip CreditAttribution: damiankloip commentedOk, changed the logic a bit as it seems pretty flaky at the moment. It basically only works in a normal install because the custom_block entity type have an item in it's 'translation' array in entity_info. So it seems like the $has_translation_handlers is not really working as it should? I've changed this to check the 'translatable' key in entity_info instead, and only add tables to the array that are translatable, then check against that.
Thoughts?
Comment #4
jibran#2: 2087069-2.patch queued for re-testing.
Comment #6
damiankloip CreditAttribution: damiankloip commented#2: 2087069-2.patch queued for re-testing.
Comment #7
damiankloip CreditAttribution: damiankloip commented#2: 2087069-2-tests-only.patch queued for re-testing.
Comment #8
dawehnerThis seems to be a patch which could be backported to d7?
Comment #9
alexpottCommitted dfce8c0 and pushed to 8.x. Thanks!
Comment #10
Gábor HojtsyThis *BROKE HEAD*. Fix committed now in #2100303: HEAD BROKEN: call to undefined function in ViewEditTest.php.
Comment #11.0
(not verified) CreditAttribution: commentedUpdated issue summary.
Comment #12
Anonymous (not verified) CreditAttribution: Anonymous commentedI have a custom entity with custom fields displaying in Views and I'm getting this notice:
There is 'field_langcode' but not 'field_language' key in
Drupal\field\Plugin\views\field\Field->view->display_handler->options
array with " ***CURRENT_LANGUAGE***" as value.If I rename the 'field_language' to 'field_langcode' I get:
Could this be the same issue?
Comment #13
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #14
Anonymous (not verified) CreditAttribution: Anonymous commentedBTW: the error is triggered by 'body' field. Here is the config:
And here is how the instance is created:
Comment #15
Anonymous (not verified) CreditAttribution: Anonymous commentedAnd this is content of /core\modules\field\lib\Drupal\field\Plugin\views\field\Field->view->display_handler->options
Comment #16
Anonymous (not verified) CreditAttribution: Anonymous commentedI've noticed that the field.field.node.body.yml has 'translatable' set to false. That's probably why my body is throwing errors and node is not.
Comment #17
dawehnerPlease open a follow up and not reopen an existing issue. Thank you!
Comment #18
Anonymous (not verified) CreditAttribution: Anonymous commentedSure, I just wasn't sure if this is the same issue or not.