Skip to content
Snippets Groups Projects
Commit 779ac392 authored by Owen Bush's avatar Owen Bush
Browse files

Addressing notices thrown when creating and editing series

parent 3d2036e3
No related branches found
No related tags found
No related merge requests found
...@@ -341,11 +341,11 @@ class EventCreationService { ...@@ -341,11 +341,11 @@ class EventCreationService {
} }
} }
else { else {
if ($entity_config['monthday'] !== $form_config['monthday']) { if ($entity_config['day_of_month'] !== $form_config['day_of_month']) {
$diff['monthday'] = [ $diff['day_of_month'] = [
'label' => $this->translation->translate('Day of the Month'), 'label' => $this->translation->translate('Day of the Month'),
'stored' => implode(',', $entity_config['monthday']), 'stored' => implode(',', $entity_config['day_of_month']),
'override' => implode(',', $form_config['monthday']), 'override' => implode(',', $form_config['day_of_month']),
]; ];
} }
} }
......
...@@ -98,7 +98,6 @@ class EventSeriesForm extends ContentEntityForm { ...@@ -98,7 +98,6 @@ class EventSeriesForm extends ContentEntityForm {
/* @var $entity \Drupal\recurring_events\Entity\EventSeries */ /* @var $entity \Drupal\recurring_events\Entity\EventSeries */
$entity = $this->entity; $entity = $this->entity;
$original = $this->storage->loadUnchanged($entity->id());
$form['custom_date']['#states'] = [ $form['custom_date']['#states'] = [
'visible' => [ 'visible' => [
...@@ -107,6 +106,7 @@ class EventSeriesForm extends ContentEntityForm { ...@@ -107,6 +106,7 @@ class EventSeriesForm extends ContentEntityForm {
]; ];
if ($editing) { if ($editing) {
$original = $this->storage->loadUnchanged($entity->id());
if ($this->step === 1) { if ($this->step === 1) {
$diff_array = $this->creationService->buildDiffArray($original, $form_state); $diff_array = $this->creationService->buildDiffArray($original, $form_state);
...@@ -194,12 +194,12 @@ class EventSeriesForm extends ContentEntityForm { ...@@ -194,12 +194,12 @@ class EventSeriesForm extends ContentEntityForm {
/* @var $entity \Drupal\recurring_events\Entity\EventSeries */ /* @var $entity \Drupal\recurring_events\Entity\EventSeries */
$entity = $this->entity; $entity = $this->entity;
$original = $this->storage->loadUnchanged($entity->id());
$editing = ($form_state->getBuildInfo()['form_id'] == 'eventseries_edit_form'); $editing = ($form_state->getBuildInfo()['form_id'] == 'eventseries_edit_form');
$trigger = $form_state->getTriggeringElement(); $trigger = $form_state->getTriggeringElement();
if ($trigger['#id'] !== 'edit-confirm' && $editing) { if ($trigger['#id'] !== 'edit-confirm' && $editing) {
$original = $this->storage->loadUnchanged($entity->id());
if ($this->creationService->checkForRecurConfigChanges($original, $form_state)) { if ($this->creationService->checkForRecurConfigChanges($original, $form_state)) {
$this->step = 1; $this->step = 1;
$form_state->setRebuild(TRUE); $form_state->setRebuild(TRUE);
......
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