Issue #2091523 by yched, pfrenssen: Fixed Install in foreign language fails with integrity constraint violation on user_picture_target_id.
parent
683b300a7d
commit
013669a29d
|
@ -653,11 +653,9 @@ class DatabaseStorageController extends FieldableEntityStorageControllerBase {
|
||||||
|
|
||||||
$langcodes = $field['translatable'] ? array_keys($entity->getTranslationLanguages()) : array(Language::LANGCODE_NOT_SPECIFIED);
|
$langcodes = $field['translatable'] ? array_keys($entity->getTranslationLanguages()) : array(Language::LANGCODE_NOT_SPECIFIED);
|
||||||
foreach ($langcodes as $langcode) {
|
foreach ($langcodes as $langcode) {
|
||||||
$items = $entity->getTranslation($langcode)->{$field_name}->getValue();
|
|
||||||
if (!isset($items)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$delta_count = 0;
|
$delta_count = 0;
|
||||||
|
$items = $entity->getTranslation($langcode)->get($field_name);
|
||||||
|
$items->filterEmptyValues();
|
||||||
foreach ($items as $delta => $item) {
|
foreach ($items as $delta => $item) {
|
||||||
// We now know we have someting to insert.
|
// We now know we have someting to insert.
|
||||||
$do_insert = TRUE;
|
$do_insert = TRUE;
|
||||||
|
@ -670,9 +668,8 @@ class DatabaseStorageController extends FieldableEntityStorageControllerBase {
|
||||||
);
|
);
|
||||||
foreach ($field['columns'] as $column => $attributes) {
|
foreach ($field['columns'] as $column => $attributes) {
|
||||||
$column_name = static::_fieldColumnName($field, $column);
|
$column_name = static::_fieldColumnName($field, $column);
|
||||||
$value = isset($item[$column]) ? $item[$column] : NULL;
|
|
||||||
// Serialize the value if specified in the column schema.
|
// Serialize the value if specified in the column schema.
|
||||||
$record[$column_name] = (!empty($attributes['serialize'])) ? serialize($value) : $value;
|
$record[$column_name] = !empty($attributes['serialize']) ? serialize($item->$column) : $item->$column;
|
||||||
}
|
}
|
||||||
$query->values($record);
|
$query->values($record);
|
||||||
$revision_query->values($record);
|
$revision_query->values($record);
|
||||||
|
|
|
@ -98,8 +98,8 @@ class InstallerTranslationTest extends InstallerTest {
|
||||||
// translated interface.
|
// translated interface.
|
||||||
$submit_value = (string) current($this->xpath('//input[@type="submit"]/@value'));
|
$submit_value = (string) current($this->xpath('//input[@type="submit"]/@value'));
|
||||||
|
|
||||||
// Submit the minimal profile installation.
|
// Submit the standard profile installation.
|
||||||
$this->drupalPostForm(NULL, array('profile' => 'minimal'), $submit_value);
|
$this->drupalPostForm(NULL, array('profile' => 'standard'), $submit_value);
|
||||||
|
|
||||||
// Submit the next step.
|
// Submit the next step.
|
||||||
$this->drupalPostForm(NULL, array(), $submit_value);
|
$this->drupalPostForm(NULL, array(), $submit_value);
|
||||||
|
|
Loading…
Reference in New Issue