diff --git a/src/Calendar/TimesheetEntry.php b/src/Calendar/TimesheetEntry.php index 2220f4b8..7dac69eb 100644 --- a/src/Calendar/TimesheetEntry.php +++ b/src/Calendar/TimesheetEntry.php @@ -32,11 +32,16 @@ final class TimesheetEntry implements DragAndDropEntry public function getData(): array { + $tags = null; + if (!empty($this->timesheet->getTagsAsArray())) { + $tags = implode(',', $this->timesheet->getTagsAsArray()); + } + return [ 'description' => $this->timesheet->getDescription(), 'activity' => $this->timesheet->getActivity() !== null ? $this->timesheet->getActivity()->getId() : null, 'project' => $this->timesheet->getProject() !== null ? $this->timesheet->getProject()->getId() : null, - 'tags' => implode(',', $this->timesheet->getTagsAsArray()), + 'tags' => $tags, ]; } diff --git a/src/Form/API/TimesheetApiEditForm.php b/src/Form/API/TimesheetApiEditForm.php index 8abe4661..ef411c10 100644 --- a/src/Form/API/TimesheetApiEditForm.php +++ b/src/Form/API/TimesheetApiEditForm.php @@ -28,19 +28,14 @@ class TimesheetApiEditForm extends TimesheetEditForm if ($builder->has('user')) { $builder->get('user')->setRequired(false); } - } - /** - * Method added to prevent API BC breaks. - * - * @param FormBuilderInterface $builder - */ - protected function addTags(FormBuilderInterface $builder) - { - $builder - ->add('tags', TagsInputType::class, [ + if ($builder->has('tags')) { + $builder->remove('tags'); + // @deprecated for BC reasons here, arrays will be supported in 2.0 + $builder->add('tags', TagsInputType::class, [ 'required' => false, ]); + } } public function configureOptions(OptionsResolver $resolver) diff --git a/templates/reporting/report_by_user.html.twig b/templates/reporting/report_by_user.html.twig index c04460f6..f631c489 100644 --- a/templates/reporting/report_by_user.html.twig +++ b/templates/reporting/report_by_user.html.twig @@ -39,7 +39,7 @@ {% for day in days %}