The Fullcalendar View integration works well so long as the the Smart Date field is directly attached to the entity being queried by the view. But if it's attached through a relationship, then attempting to view he calendar yields this error:

 InvalidArgumentException: Field field_when is unknown. in Drupal\Core\Entity\ContentEntityBase->getTranslatedField() (line 587 of core/lib/Drupal/Core/Entity/ContentEntityBase.php).
Drupal\Core\Entity\ContentEntityBase->get('field_when') (Line: 57)
Drupal\smart_date\Plugin\FullcalendarViewProcessor\SmartDateProcessor->process(Array) (Line: 39)
template_preprocess_views_view_fullcalendar(Array, 'views_view_fullcalendar', Array) (Line: 287)
Drupal\Core\Theme\ThemeManager->render('views_view_fullcalendar', Array) (Line: 431)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 444)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 200)
Drupal\Core\Render\Renderer->render(Array) (Line: 450)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 110)
__TwigTemplate_11a731d2877b9468b744d41fcc439cdebfbcb6b469dda518be48813f789db0cf->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 65)
twig_render_template('core/themes/classy/templates/views/views-view.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('views_view', Array) (Line: 431)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 444)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 200)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 241)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132)
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: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 163)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
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: 91)
Drupal\shield\ShieldMiddleware->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: 706)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19) 

Comments

mandclu created an issue. See original summary.

mandclu’s picture

Component: Code » Calendar integration
roman_l’s picture

Hello !

Having same error (field_date is unknown) with Bookable Calendar module which uses SmartDate, not sure if related though :

https://www.drupal.org/project/bookable_calendar/issues/3239825

But as it seems to use entites relationships perhpas it's worth having a look ?
If i can help i will !

Thanks !

mandclu’s picture

Hmmm it's interesting that in both cases the error seemed to be thrown in getTranslatedField(). I assume your site is using more than one language? Is it possible to make that field not translatable to see if that changes the error?

roman_l’s picture

Hello,

as fields and data strucutre is defined in the module, i can not configure directly the date fields.

I'll have a deeper look into code, also Bookable Calendar module maintainer is informed and will have a look in a non multilanguage website.

mandclu’s picture