Skip to content
Snippets Groups Projects
Commit 0b3030a6 authored by Adrian Lorenc's avatar Adrian Lorenc
Browse files

ISAICP-9017: Remarks.

parent d5a34f90
No related branches found
No related tags found
1 merge request!183Release v1.112.0
......@@ -18,6 +18,7 @@ function joinup_log_update_111200(): TranslatableMarkup {
$field = BaseFieldDefinition::create('map')
->setLabel(new TranslatableMarkup('Variables'))
->setDefaultValue(serialize([]))
->setDescription(new TranslatableMarkup('Serialized array of variables that match the message string and that is passed into the t() function.'));
$definition_update_manager->installFieldStorageDefinition('variables', 'joinup_log', 'joinup_log', $field);
......
......@@ -81,6 +81,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type): a
$fields['variables'] = BaseFieldDefinition::create('map')
->setLabel(new TranslatableMarkup('Variables'))
->setDefaultValue(serialize([]))
->setDescription(new TranslatableMarkup('Serialized array of variables that match the message string and that is passed into the t() function.'));
$fields['severity'] = BaseFieldDefinition::create('list_integer')
......
......@@ -30,7 +30,7 @@ public function getViewsData(): array {
'options callback' => JoinupLog::class . '::allowedTypes',
];
$data[$base_table]['variables']['field']['id'] = 'log-unserializer';
$data[$base_table]['variables']['field']['id'] = 'log_unserializer';
$data[$base_table]['group']['argument']['id'] = 'og_audience_group';
return $data;
......
......@@ -4,7 +4,7 @@
namespace Drupal\joinup_log\Plugin\views\field;
use Drupal\Component\Serialization\PhpSerialize;
use Drupal\Component\Serialization\Yaml as YamlSerializer;
use Drupal\views\Attribute\ViewsField;
use Drupal\views\Plugin\views\field\FieldPluginBase;
use Drupal\views\ResultRow;
......@@ -15,7 +15,7 @@
*
* @ingroup views_field_handlers
*/
#[ViewsField("log-unserializer")]
#[ViewsField("log_unserializer")]
class LogUnserializer extends FieldPluginBase {
/**
......@@ -24,7 +24,7 @@ class LogUnserializer extends FieldPluginBase {
public function render(ResultRow $values) {
$value = $values->{$this->field_alias};
$data = PhpSerialize::decode($values->{$this->field_alias});
$data = YamlSerializer::decode($values->{$this->field_alias});
if ($data === FALSE) {
return $value;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment