Problem/Motivation

Error messages when editing an event that already exists and adding or changing include or exclude dates. It does save the event, but throws several errors.

Steps to reproduce

1. Create a new event and set the start and end dates and set a few exclude or include dates and then save the event.
2. Go back and edit the same event and add one or more extra exclude and/or include dates and hit save.
3. You will se a long set of errors about undefined array key consecutive_recurring_date in Drupal\recurring_events\Plugin\Field\FieldType\ConsecutiveRecurringDate::convertFormConfigToArray()

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

weddled created an issue. See original summary.

owenbush’s picture

Thank you for raising this issue, I'll try and recreate it and see what is happening.

owenbush’s picture

I've been unable to recreate this issue, can you provide more information on what settings you were using to cause the errors.

vlad.dancer’s picture

Getting the same here.

vlad.dancer’s picture

Status: Active » Needs review

Related error:

Warning: Undefined array key "consecutive_recurring_date" in Drupal\recurring_events\Plugin\Field\FieldType\ConsecutiveRecurringDate::convertFormConfigToArray() (line 144 of modules/contrib/recurring_events/src/Plugin/Field/FieldType/ConsecutiveRecurringDate.php).

Drupal\recurring_events\Plugin\Field\FieldType\ConsecutiveRecurringDate::convertFormConfigToArray(Object) (Line: 265)
Drupal\recurring_events\Plugin\Field\FieldWidget\ConsecutiveRecurringDateWidget::checkDuration(Object) (Line: 177)
Drupal\recurring_events\Plugin\Field\FieldWidget\ConsecutiveRecurringDateWidget->formElement(Object, 0, Array, Array, Object) (Line: 353)

Steps to reproduce:
1. Install latest module
2. Go to /admin/structure/events/series/settings
2.1 Scroll to "Enabled Recur Field Types" setting
2.2 Untick "Consecutive Event" option.
3. Create event with "Custom/Single Event" Recur Type
4. Edit event and change Dates

Workaround/solution.
Go to /admin/structure/events/series/types/eventseries_type/default/edit/form-display and move "Consecutive Event" field into disabled section.

vlad.dancer’s picture

I've added one possible code improvement

owenbush’s picture

Thank you for the MR, I made one change to it which I believe should address the issue in all circumstances. Attached is a patch for those who wish to safely include this change with composer.

muriqui’s picture

Status: Needs review » Reviewed & tested by the community

Tested and confirmed: patch in #8 resolves the error.

  • owenbush committed 2733639 on 2.0.x authored by vlad.dancer
    Issue #3309859 by vlad.dancer, owenbush, weddled: Undefined Array Key...

  • owenbush committed b7a69f3 on 8.x-1.x authored by vlad.dancer
    Issue #3309859 by vlad.dancer, owenbush, weddled: Undefined Array Key...
owenbush’s picture

Status: Reviewed & tested by the community » Fixed

This has been merged into the latest dev release. Thanks for all involved.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.