Problem/Motivation
The website encountered an unexpected error. Try again later.
TypeError: implode(): Argument #2 ($array) must be of type ?array, string given in implode() (line 214 of modules/contrib/recurring_events/src/Plugin/Field/FieldType/YearlyRecurringDate.php).
Drupal\recurring_events\Plugin\Field\FieldType\YearlyRecurringDate::buildDiffArray() (Line: 390)
Steps to reproduce
Create a new Event Series with the following setup:
1. Recur Type: “Yearly”
2. Create Events Between: “2025-12-25"
3. And: “2025-12-25”
4. Event Start Time: “8:30 PM”
5. Event Duration: “3.5 hours”
6. Event Recurrence Schedule: “Recur on Day of Month”
7. Days of the Month: “25th”
Other settings:
- Registration: Enabled - Scheduled Registration - Custom Schedule - 10 days before the event starts
- Location:
, In Person
Save the node and check if an Event Instance is created, for this case is not created.
If not, edit the Event Series and try to re-save the node, the error happens.
if (($entity_config['months'] ?? []) !== ($form_config['months'] ?? [])) {
$diff['months'] = [
'label' => t('Months'),
'stored' => implode(',', ($entity_config['months'] ?? [])),
'override' => implode(',', ($form_config['months'] ?? [])),
];
}
The validation for ?? is not working as it's passing an empty string to it.
| Comment | File | Size | Author |
|---|
Issue fork recurring_events-3565683
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
Comment #2
aurora.luzzardiWe are using on: 2.x-dev#400e300
With those patches:
This file was automatically generated by Composer Patches (https://github.com/cweagans/composer-patches)
Patches applied to this directory:
3483283: Unexpected error when adding reference field into event instance.
Source: patches/recurring_events/3483283.patch
3484209: EventSeriesForm breaks when editing an empty entity.
Source: patches/recurring_events/3484209.patch
3090186: Registration quantity widget
Source: patches/recurring_events_registration/3090186-multiple-registration-MR111-Oct29.patch
Fix token replacement issue
Source: patches/recurring_events_registration/tokens_replacement.patch
Remove waitlisted users email alerts
Source: patches/recurring_events_registration/remove_waitlisted_alert.patch
Event Instace Update Notification
Source: patches/recurring_events_registration/event_instance_update.patch
Waitlist promotion - duplicating email
Source: patches/recurring_events_registration/watilist_duplicate_email.patch
3496270: Deprecated: Optional parameter $entity_type_bundle_info declared before required parameter
Source: patches/recurring_events_registration/3496270-deprecated-optional-parameter.patch
3178696: Make compatible with Scheduler
Source: patches/recurring_events/3178696.patch
3499792: Improve warning message when updating Event Series date
Source: patches/recurring_events/3499792.patch
3500920: The 'Contact Registrant' and 'Resend Mail' forms are not replacing the subject and message tokens
Source: patches/recurring_events_registration/3500920.patch
Add a revision log message if the instance was updated by the event series entity
Source: patches/recurring_events/revision_log_message.patch
3550534: Add Registration open-close time
Source: patches/recurring_events_registration/custom_registration_time.patch
3498718: retrieveRegisteredParties() should never get all of the registrants for the whole site
Source: patches/recurring_events_registration/3498718-retrieveRegisteredParties_should_not_return_all_registrants.patch
Comment #3
aurora.luzzardiHere a patch to solve that directly on the check, but we migth want to rework it to make the data to be stored in the correct format on the db to not receive an empty string.
Comment #4
aurora.luzzardiComment #5
aurora.luzzardiThis might be related to the "Months" not being required and the first save for the Yearly event is not selecting any month, which is storing an empty value.
Comment #6
aurora.luzzardiAfter some additional testing, regarding the Yearly recurrence type, I believe the Month selection and the Day of the Week / Day of the Month options should use radio buttons instead of checkboxes.
Since a Yearly event is expected to occur once per year, allowing multiple months or multiple days results in multiple instances being created within the same year. For scenarios that require multiple occurrences per year, the Daily, Weekly, or Monthly recurrence types would be more appropriate.
I opened a new Plan issue so that could be properly discussed: https://www.drupal.org/project/recurring_events/issues/3565700
Comment #7
aurora.luzzardiComment #8
muriqui commentedConfirmed still occurs on 3.0.x:
Comment #9
muriqui commentedWhile the patch does fix the exception, it would be great to also address the root cause here; i.e., that the recurrence fields allow you to submit an invalid schedule that yields zero instances.
Also, the fix should be rerolled as an MR, not a patch file.
Comment #10
muriqui commentedComment #12
muriqui commentedComment #13
muriqui commentedOn second thought, no need to complicate matters here for what is otherwise a simple fix. Going to add a test to validate the fix and then call this one good. Work to address the root cause will happen on #3605486: Add constraint validator to prevent invalid recurrence patterns instead.
Comment #15
muriqui commented