Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Steps to reproduce:
- Create a
date_recur
field - Install
fullcalendar
module - Create a view that uses
fullcalendar
display and add thedate_recur
field created in 1
You will see error:
Call to undefined method Drupal\date_recur\Plugin\Field\FieldType\DateRecurItem::getOccurrenceHandler() in Drupal\fullcalendar\Plugin\views\style\FullCalendar->prepareEvents()
Proposed resolution
Fullcalendar does not supports 2.x version of date_recur
and is using 1.x API. The code needs to support 2.x. date_recur
1.x will only get maintenance fixes. 2.x will be maintained actively.
Remaining tasks
N/A
User interface changes
N/A
API changes
N/A
Data model changes
N/A
Release notes snippet
N/A
Comment | File | Size | Author |
---|---|---|---|
#13 | date_recur-incompat_fix-3023612-13.patch | 4.97 KB | grahl |
#12 | date_recur_incompat_fix-3023612-12.patch | 2.07 KB | grahl |
#5 | interdiff-3-5.txt | 1.63 KB | subhojit777 |
#5 | 3023612-5.patch | 1.83 KB | subhojit777 |
#3 | 3023612-3.patch | 2.06 KB | subhojit777 |
Comments
Comment #2
dpiThe error is showing because the API no longer exists for 2.x. Fullcalendar was built using DR 1.x API's.
I encourage FC to upgrade, as users of DR 1.x have an upgrade path to 2.x: https://www.drupal.org/docs/8/modules/recurring-dates-field/date-recur-1...
Functionality of old API's are easy to replicate, see API guide: https://www.drupal.org/docs/8/modules/recurring-dates-field/date-recur-f...
Comment #3
subhojit777Comment #4
subhojit777Comment #5
subhojit777The patch in #3 was causing issues with timezone. The dates were displayed in UTC. Fixed it now. The solution is also simpler.
Comment #6
MrPaulDriver CreditAttribution: MrPaulDriver commentedI am getting views errors after patching. Not sure if I'm doing anything wrong.
Comment #7
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedI get that error too @MrPaulDriver
Comment #8
elamanThe last patch didn't work. Here is the fix, where instead of pushing occurrences into
$event
array, I push it into$events
array.Using latest dev FullCalendar and latest stable Date Recur 2.0.
Comment #9
elamanThis might be a better approach, given that view results, might override date occurrences if they have the same index/delta.
Comment #10
elamanFix compatibility with regular date fields for the previous patch.
Comment #11
DuaelFrHi @elaman,
Thanks a lot for your patches!
I think something went wrong with your last patch, though. It seems to be replacing the entire FullCalendar.php file without focusing on your real changes. Would you try to upload it again? It would also be really appreciated if you could add an interdiff to only show the things you changed since your previous patch.
Comment #12
grahl10 has an additional one-line change:
Attaching what would be 10 without replacement. The cause for this issue is #3098523: Convert CRLF to LF.
Still working on actually getting that running on my end.
Comment #13
grahlAttached is a slightly different approach which tries to simplify event aggregation in that function and adds a workaround for unlimited events (this should be taken from some source in the field but is hardcoded for now at 100). I've removed variables which were no longer needed after those changes.
This patch will likely not apply without #3098523: Convert CRLF to LF already applied.
Note that $date_range is not used and probably should be.