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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

StryKaizer created an issue. See original summary.

bkhandruk’s picture

Assigned: Unassigned » bkhandruk
bkhandruk’s picture

Project: Calendar » Scheduler
Assigned: bkhandruk » Unassigned
Status: Active » Needs review
FileSize
895 bytes

Added id for filter and sort of unpublish_on and publish_on fields.

bkhandruk’s picture

The last submitted patch, 3: scheduler-notice_for_undefined_index_id-2849490-3.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 4: scheduler-notice_for_undefined_index_id-2849490-4.patch, failed testing.

jonathan1055’s picture

Status: Needs work » Needs review

Hi 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

Status: Needs review » Needs work

The last submitted patch, 4: scheduler-notice_for_undefined_index_id-2849490-4.patch, failed testing.

jonathan1055’s picture

I 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.

bkhandruk’s picture

I think that would be the correct id for filter and sort of unpublish_on and publish_on fields.

bkhandruk’s picture

Status: Needs work » Needs review
jonathan1055’s picture

Thinking 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?

Status: Needs review » Needs work
johnpicozzi’s picture

Was 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.

jonathan1055’s picture

Thanks johnpicozzi. However, I not convince that Scheduler 8.x needs this file at all - see my comments in #12.

johnpicozzi’s picture

@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?

jonathan1055’s picture

Yes, 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.

  • jonathan1055 committed 1076391 on 8.x-1.x
    Issue #2849490 by rocket.man, jonathan1055, johnpicozzi, StryKaizer:...
jonathan1055’s picture

Title: Scheduler + Calendar module throws notice for "Undefined index: id" issue » Scheduler + Calendar module throws notice for "Undefined index: id"
Status: Needs review » Fixed

Fixed. 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

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.