Add To Calendar crashes when attempting /admin/structure/events/instance/settings/display

Error Log:

Drupal\Core\Field\FieldException: Attempt to create a base field bundle override of field date without a bundle in Drupal\Core\Field\Entity\BaseFieldOverride->__construct() (line 104 of /Users/the_glitch/Sites/My Suite/core/lib/Drupal/Core/Field/Entity/BaseFieldOverride.php).

Also, Event Series doesn't crash Manage Display page but it's not populating populating Google calendar when Add To Calendar button is selected on nodes.

Comments

the_glitch created an issue. See original summary.

the_glitch’s picture

Title: Event Instance Crashing with add_to_calendar Module. Event Series not populating dates to calendars » Event Instance Crashing with AddToCalendar Module. Event Series not populating dates to calendars
Issue summary: View changes
owenbush’s picture

Thanks for raising the issue. I'll take a look at the event instances.

The event series not populating on the calendar makes sense as there is no date for a series, there is a date recurrence pattern. In reality, event series will never be shown on calendars, only their instances will.

owenbush’s picture

Did you try patching AddToCalendar with the patch in this issue: https://www.drupal.org/project/addtocalendar/issues/2932734 ?

the_glitch’s picture

I applied the patch. It fixed the crashing issue but the instance node's date still isn't being picked up and populated to whichever calendar it links to. In the case of using an Add To Calendar button in an event series, could it pick up the recur rules and populate the linked calendar as a repeating event?

Only local images are allowed.

the_glitch’s picture

Issue still exists for Event Instances. When in /admin/structure/events/instance/settings/display>Event Date field and "Show Add to Calendar" is checked all instance nodes crash with this error:

The website encountered an unexpected error. Please try again later.
Error: Call to undefined method Drupal\recurring_events\Entity\EventInstance::getTitle() in _addtocalendar_preprocess_field() (line 89 of modules/contrib/addtocalendar/includes/addtocalendar.build.inc).
_addtocalendar_preprocess_field(Array) (Line: 61)
addtocalendar_preprocess_field(Array, 'field', Array) (Line: 287)
Drupal\Core\Theme\ThemeManager->render('field', Array) (Line: 437)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 450)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array) (Line: 501)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 70)
__TwigTemplate_09bcd24c7399aa8ee8254a641df9f3e23f0636128af0778683779e71af370b45->block_content(Array, Array) (Line: 216)
Twig\Template->displayBlock('content', Array, Array) (Line: 63)
__TwigTemplate_09bcd24c7399aa8ee8254a641df9f3e23f0636128af0778683779e71af370b45->doDisplay(Array, Array) (Line: 455)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 422)
Twig\Template->display(Array) (Line: 434)
Twig\Template->render(Array) (Line: 64)
twig_render_template('modules/contrib/recurring_events/templates/eventinstance.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('eventinstance', Array) (Line: 437)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 226)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 582)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 227)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 117)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 156)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 693)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
the_glitch’s picture

Priority: Normal » Major
owenbush’s picture

Status: Active » Needs review
StatusFileSize
new516 bytes

Attached is a patch to resolve the error shown in #6 - it looks like addtocalendar is expecting the following function to exist EventInstance::getTitle(). By default I have decided to just pull that straight from the series and bypass the field inheritance for now.

This is ready for review.

the_glitch’s picture

tested and working so far. Thank you Mister Bush.

mrpauldriver’s picture

Priority: Major » Normal
owenbush’s picture

Status: Needs review » Reviewed & tested by the community

Marking this as RTBC.

Thanks all.

  • owenbush committed 32c7152 on 8.x-1.x
    Issue #3084468 by owenbush, the_glitch: Event Instance Crashing with...
owenbush’s picture

Status: Reviewed & tested by the community » Fixed

This has been merged into the 8.x-1.x-dev branch. Marking this as fixed.

Status: Fixed » Closed (fixed)

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