- Issue created by @sana.shamsudin
- Status changed to Postponed: needs info
over 1 year ago 8:52pm 3 August 2023 - π¦πΊAustralia mingsong π¦πΊ
Please provide steps to reproduce the error and the raw data of the view and content.
The issue occurs when we install the module's latest version in Drupal php 8.1version.
- πΈπͺSweden joos
I can confirm this error and the fix (for me at least) was to open the view, edit format settings and assign a start and end date field.
Save, flush cache and all is good. - Status changed to Active
over 1 year ago 4:47am 17 August 2023 - Status changed to RTBC
over 1 year ago 10:32pm 17 August 2023 - π¦πΊAustralia mingsong π¦πΊ
I can't reproduce this error on my sites.
It could occur in a certain circumstances.
Please provide more details how this happened, which would make way easier for others to do the trouble shooting and understand why it happens.
The raw data of the view output will tell what really cause this issue.
- Status changed to Postponed: needs info
over 1 year ago 10:35pm 17 August 2023 - π¦πΉAustria anschinsan
I tracked it down to:
$left_buttons = Xss::filter($options['left_buttons']); and
$right_buttons = Xss::filter($options['right_buttons']);lines 168 and line 170 in Drupal\fullcalendar_view\FullcalendarViewPreprocess
strlen() does not accept an array, Xss::filter is using a method Unicode::validateUtf8, which is using strlen().
- π¦πΊAustralia mingsong π¦πΊ
$options['left_buttons'] and $options['right_buttons'] should be a string, right?
Why an array return?
- πΊπΈUnited States Dave Kopecek
I believe the issue is with $options['right_buttons']. Using xdebug I see the value below at FullcalendarViewPreprocess.php line 170"
$options['right_buttons'] = array(7) 0:"dayGridMonth" 1:"timeGridWeek" 2:"timeGridDay" 3:"listYear" agendaWeek:"agendaWeek" agendaDay:"agendaDay" listYear:"listYear"
- πΊπΈUnited States Dave Kopecek
I was able to `drush config:export` and manually update views.view.calendar.yml from:
right_buttons: agendaWeek: agendaWeek agendaDay: agendaDay listYear: listYear default_view: month
to
left_buttons: 'prev,next today' right_buttons: 'dayGridMonth,timeGridWeek,timeGridDay,listYear' default_view: dayGridMonth
after importing the config I manually edited and re-saved the settings in the view, cleared the cache and the error resolved.
- π¦πΊAustralia mingsong π¦πΊ
Once the view setting is saved, following line in the form submit function will convert the array into a string.
$options['right_buttons'] = isset($options['right_buttons']) ? implode(',', array_filter(array_values($options['right_buttons']))) : 'dayGridMonth,timeGridWeek,timeGridDay,listYear';
You can see the above source code at
https://git.drupalcode.org/project/fullcalendar_view/-/blob/5.1.13/src/P...
And also, the following buttons options are not provided by 5.x version.
- agendaWeek
- agendaDay
The options available in 5.x version are:
$fullcalendar_displays = [ 'dayGridMonth' => $this->t('Month'), 'timeGridWeek' => $this->t('Week'), 'timeGridDay' => $this->t('Day'), 'listYear' => $this->t('List (Year)'), 'listMonth' => $this->t('List (Month)'), 'listWeek' => $this->t('List (Week)'), 'listDay' => $this->t('List (Day)'), ];
https://git.drupalcode.org/project/fullcalendar_view/-/blob/5.1.13/src/P...
@David Kopecek, did you upgrade this module from 2.x? If so, as suggested in #6, what you need to do is just to re-save this view again. That is it.
Every time you save the view setting, the option value will be converted into string as explained above.
Other possibility is that you have some out-of-date configuration YML files remained in your configuration export folder. If that is the case, you also need to clean up/ update those YML files as well. Otherwise, once you re-import those out-of-date configuration back to your site, a misconfiguring issue like this one will occure again.
- Status changed to Closed: works as designed
about 1 year ago 11:23pm 25 October 2023 - π¦πΊAustralia mingsong π¦πΊ
I close it as it is a misconfiguring issue.
As advised in the 'Upgrade path' session in the project page, if you upgrade this module from 2.x, you have to re-configure/re-save the view. And also you can't re-import the configuration exported for 2.x version. It won't work.