Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/transformers/Utils/FieldBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,13 @@ protected function getTemplateDir()

public function getFieldName()
{
// @TODO Check if field_ prefix can be dropped in D8 too.
$field_name = 'field_' . $this->parent['id'] . '_' . $this->data['id'];
// Get fieldname from yaml to support fields on existing entities.
if (isset($this->data['field_name'])) {
$field_name = $this->data['field_name'];
} else {
$field_name = 'field_' . $this->parent['id'] . '_' . $this->data['id'];
}

if (strlen($field_name) > 32) {
$a = explode('_', $field_name);
for ($i = 2; $i < count($a) - 1; $i++) {
Expand Down