Skip to content

Commit

Permalink
Merge pull request #4 from osu-wams/tokens-missing-names
Browse files Browse the repository at this point in the history
Saw reports on the admin dashboard about field tokens missing the nam…
  • Loading branch information
emerham authored Feb 7, 2023
2 parents 69a6627 + 61ca9a3 commit cf5d929
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Plugin/Field/FieldType/OsuIcon.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@ public static function schema(FieldStorageDefinitionInterface $field_definition)
// List the values that the field will save. This
// field will only save a single value, 'value'
'value' => [
'description' => 'The icon name.',
'type' => 'text',
'size' => 'tiny',
'not null' => FALSE,
],
'size' => [
'description' => 'The icon size.',
'type' => 'text',
'size' => 'tiny',
'not null' => FALSE,
Expand All @@ -47,8 +49,12 @@ public static function schema(FieldStorageDefinitionInterface $field_definition)
*/
public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
$properties = [];
$properties['value'] = DataDefinition::create('string');
$properties['size'] = DataDefinition::create('string');
$properties['value'] = DataDefinition::create('string')
->setLabel(t('Name'))
->setDescription(t('The icon name.'));
$properties['size'] = DataDefinition::create('string')
->setLabel(t('Size'))
->setDescription(t('The size of the icon.'));
return $properties;
}

Expand Down

0 comments on commit cf5d929

Please sign in to comment.