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.
How to reproduce:
Enable both the scheduler and calendar module
Create a CT with a date field, and create a calendar view (using views template) for this field.
Following notice is thrown when visitting the calendar page.
Notice: Undefined index: id in Drupal\views\Plugin\ViewsHandlerManager->getHandler() (line 107 of core/modules/views/src/Plugin/ViewsHandlerManager.php).
Uninstalling scheduler module fixes this notice.
Comment | File | Size | Author |
---|---|---|---|
#17 | 2849490-17.remove_scheduler_views_inc.patch | 2.57 KB | jonathan1055 |
| |||
#14 | scheduler-notice_for_undefined_index_id-2849490-14.patch | 915 bytes | johnpicozzi |
Comments
Comment #2
bkhandruk CreditAttribution: bkhandruk commentedComment #3
bkhandruk CreditAttribution: bkhandruk commentedAdded id for filter and sort of unpublish_on and publish_on fields.
Comment #4
bkhandruk CreditAttribution: bkhandruk commentedComment #7
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedHi StryKaizer and rocket.man,
Thanks for spotting this and reporting it. Your tests failed because the core version has been increased to 8.4 which breaks our Rules tests. (nothing to do with your patch). I will retest at 8.3 and also check this manually. Thanks also for the repro steps - very helpful, but many forget to edd them, making our job slower.
Jonathan
Comment #9
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedI have raised #2851618: Rules automated tests fail at D8.3 and 8.4 to investigate the test failures which are not related to this patch.
Comment #10
bkhandruk CreditAttribution: bkhandruk commentedI think that would be the correct id for filter and sort of unpublish_on and publish_on fields.
Comment #11
bkhandruk CreditAttribution: bkhandruk commentedComment #12
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedThinking about this more, are you actually sure that this file is used in 8.x? It was added when Scheduler had its own custom db table to hold the dates. Now that these are held as fields against the node, the dates are available in views without the need to specify separately.
I'll do some manual testing to check this.
@StryKaizer, @rocket.man, Have you actually needed this file? or were you just helpfully removing the warning?
Comment #14
johnpicozziWas having the same issue when viewing Calendar Views. Went through the same testing steps (uninstalled Scheduler) and the error went away. Tried to apply the last patch (above) and it didn't work. Applied it manually and it resolved the issue. Attaching a new patch that should work with Drupal 8.3 and Scheduler RC.
Comment #15
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedThanks johnpicozzi. However, I not convince that Scheduler 8.x needs this file at all - see my comments in #12.
Comment #16
johnpicozzi@jonathan1055 - You're Welcome! I did see your comment and if the file and patch aren't needed so be it. However, The issue was present and this seems to address it. Are you suggesting removing the file all together would also fix the issue?
Comment #17
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedYes, I have done some manual testing, to create a view with scheduler fields having already deleted the scheduler.views.inc file. All works fine. Also I have run through the reproduction steps and there is obviously no "Undefined index: id" error.
Here's a patch which removes the file, just to prove that the automated tests are not affected.
Comment #19
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedFixed. Thanks to all for the patches, I've given credit to you all, even though the solution was actually to remove the file that was needed in 7.x but not required for 8.x