Attached patch should get the main module rolling (didn't touch colors, legend and GoogleCalendar).
It should be possible to move events between days, and change their start/duration time and have those settings persist.
By default it filters by date of all date fields added under 'FIELDS', it should be possible to add additional exposed filters (e.g. Tags) under 'FILTER CRITERIA' and be able to narrow events even further, if there are exposed filters defined it should not hide their widgets and 'Apply' button.
done:
- updated .js to be compatible with latest fullcalendar lib (3.0.1)
- changed AJAX update controller to support eventResize and added some validation to it
- added 'Date only' fields handling
- update views 'use ajax' code, account for no more 'date_select' widget and changed markup/classes
- minor: ".fc-button" was hardcoded, theme variable (this.tm) was badly set
- added rudimentary timezone handling (uses user's default, needs work, config?)
todo:
- 'data-editable' is hardcoded in src\Plugin\views\style\FullCalendar.php
- initial render of the view still gets all? events into html
- review 'options'/config changes between 1.x and 2.x/3.x of fullcalendar lib (https://fullcalendar.io/wiki/Upgrading-to-v2/)
- untangle $view->getExposedInput() / settings.fullcalendar_fields_count / options['fields']['date_field'] interactions in fullcalendar.views_execution.inc:fullcalendar_views_pre_view() and fullcalendar.ajax.js:Drupal.fullcalendar.fullcalendar.prototype.submitInit()
- check/fix sub modules
note:
- there is no view filter plugin for daterange, so no 'between' filter, use with patch from #2786577: The Views integration Datetime Range fields should extend the views integration for regular Datetime fields if you use daterange fields (rebuild core, flush caches, run updates, might need to re-edit the old views even after that)
- not sure 'between' is the way to go anyway, maybe custom filter will be needed for 'daterange' (end_value > min, value < max)
- jQuery selectors in Drupal.fullcalendar.fullcalendar.prototype.submitInit() might be a bit loose, but it seems there are no views specific classes in exposed widgets
- jQuery.fullCalendar() breaks chaining
- many parts of the code could use refactoring, commenting, plenty of old @todos
| Comment | File | Size | Author |
|---|---|---|---|
| #22 | 2828939-22-ajax-fix-combined.patch | 40.35 KB | nickdickinsonwilde |
Comments
Comment #2
tacituseu commentedAttaching 2 patches:
- 2828939-2-ajax-fix.patch requires: 2827950+2827939+2827936+2827930-combined.patch from #2827950: Call to undefined function l() in AJAX Update controller
- 2828939-2-ajax-fix-combined.patch should work against current HEAD
Comment #3
tacituseu commentedComment #4
tacituseu commentedUpdated for head changes
Comment #5
tacituseu commentedComment #6
arosboro commentedNice work @tacituseu. I've installed this patch and was able to configure a View. Library detection is not working on the most recent version of the jquery dependency. I get
What library version were you using?
Comment #7
arosboro commentedI have tested and confirmed that the following composer patch applies and restores functionality as expected:
The following actions have been tested:
Comment #8
tacituseu commentedPatch is based on fullcalendar-8.x-1.x-dev (8.x-1.x in repository) and fullcalendar-3.0.1.
fullcalendar-8.x-1.0-alpha2 should not be used (or displayed on download page even) as it is 3 years old.
Comment #9
arosboro commentedYes, I eventually figured that out, and have dev branch installed in my project. The library issue seemed to resolve itself.
Comment #10
arosboro commentedis anyone maintaining this project atm?
Comment #11
martin107 commentedThere are a few willing people lurking about, but I am afraid the answer seems to be No :)
Comment #12
tacituseu commentedLeft one
drupalSettings.path.basePathineventResize.@arosboro: 'Looked at once in a full moon' would be the proper maintenance status :), at least on d.o., there's also a git repo, maybe new maintainer expects work to magically happen there, so far it is just a garden of empty issues.
Comment #13
tacituseu commentedAdds support for views with arguments.
Comment #14
tacituseu commented- fixes 'Enable advanced time and date format settings' not being applied (ref: https://fullcalendar.io/docs/views/View-Specific-Options/).
- fixes #2853942: Libraries are not attached for plugins and upgrades fullcalendar_options
Comment #15
tacituseu commentedIt will need a rework after #2648950: [PP-2] Use form element of type date instead textfield when selecting a date in an exposed filter gets in.
Comment #16
griddick commentedGreat work tacituseu thanks!
I have just started playing with your changes against the latest 3.4.0 release of fullcalendar. One small extra change required due to deprecated methods.
Comment #17
tacituseu commented@griddick: looking at the source of
fullcalendar-3.4.0.zipeven though those properties were deprecated, they are still kept there for backward compatibility, so it should work without those changes, might be worth keeping it compatible with all of 3.x vs only latest.Comment #18
tacituseu commentedRe-rolled after #2848422: White Screen of Death (WSD).
Comment #19
socialnicheguru commentedI can install the module with this patch using the dev version.
have not fully tested the functionality yet though.
Comment #20
tacituseu commentedThere is some recent movement in github repo by @lonalore (see: https://github.com/dakala/fullcalendar/pull/22), you might want to check it out too.
Comment #21
brooke_heaton commentedThis patch no longer applies clean for me.
Comment #22
nickdickinsonwildeRerolled
Comment #23
mrpauldriver commentedCould not install patch 22
Comment #24
nickdickinsonwildeComment #25
tacituseu commentedLatest dev has integrated an alternative patch provided by @lonalore over at github repo, so it should no longer be needed (didn't test it yet).
Comment #26
mrpauldriver commentedWith respect, I don't think we can close this issue, marking it outdated, whilst it is causing problems right now. That there is a fix over at github does not mean it should not posted here.
Comment #27
tacituseu commented@MrPaulDriver: The reason the patch doesn't apply is because the fix is no longer only at github, it was merged into latest 8.x-1.x-dev on D.O. (5ff71c7). Give it a try.
Comment #28
mrpauldriver commentedUnderstood. Thank you for the explanation.