3
0
Fork 0
mirror of https://github.com/farmOS/farmOS.git synced 2024-02-23 11:37:38 +01:00

Change 'body_location' property to more general 'location'.

This commit is contained in:
Michael Stenta 2020-10-11 21:54:16 -04:00
parent 04d71e351c
commit f2dc22f95b
3 changed files with 6 additions and 6 deletions

View file

@ -27,7 +27,7 @@ class FarmIdTagFormatter extends FormatterBase {
foreach ($items as $delta => $item) {
$elements[$delta]['id'] = ['#markup' => $item->id];
$elements[$delta]['type'] = ['#markup' => $item->type];
$elements[$delta]['body_location'] = ['#markup' => $item->body_location];
$elements[$delta]['location'] = ['#markup' => $item->location];
}
return $elements;

View file

@ -38,7 +38,7 @@ class FarmIdTagItem extends FieldItemBase {
'length' => 255,
'not null' => TRUE,
],
'body_location' => [
'location' => [
'description' => 'The location of the tag.',
'type' => 'varchar',
'length' => 1024,
@ -56,7 +56,7 @@ class FarmIdTagItem extends FieldItemBase {
->setLabel(t('Id of the tag'));
$properties['type'] = DataDefinition::create('string')
->setLabel(t('Type of the tag'));
$properties['body_location'] = DataDefinition::create('string')
$properties['location'] = DataDefinition::create('string')
->setLabel(t('Location of the tag'));
return $properties;
}
@ -65,7 +65,7 @@ class FarmIdTagItem extends FieldItemBase {
* {@inheritdoc}
*/
public function isEmpty() {
return ($this->id === NULL || $this->id === '') && ($this->type === NULL || $this->type === '') && ($this->body_location === NULL || $this->body_location === '');
return ($this->id === NULL || $this->id === '') && ($this->type === NULL || $this->type === '') && ($this->location === NULL || $this->location === '');
}
/**

View file

@ -38,10 +38,10 @@ class FarmIdTagWidget extends WidgetBase {
'#default_value' => isset($items[$delta]->type) ? $items[$delta]->type : NULL,
];
$element['body_location'] = [
$element['location'] = [
'#type' => 'textarea',
'#title' => $this->t('Tag location'),
'#default_value' => isset($items[$delta]->body_location) ? $items[$delta]->body_location : NULL,
'#default_value' => isset($items[$delta]->location) ? $items[$delta]->location : NULL,
];
return $element;