Problem/Motivation
When using the sort criteria given in the example, the preview no longer works (after save) and when you test the view, the view crashes with the following error message:
The website encountered an unexpected error. Please try again later.
Error: Call to undefined function Drupal\views_birthday\Plugin\views\sort\drupal_get_user_timezone() in Drupal\views_birthday\Plugin\views\sort\Birthday->getOffset() (line 162 of modules\contrib\views_birthday\src\Plugin\views\sort\Birthday.php).
Drupal\views_birthday\Plugin\views\sort\Birthday->getOffset('', 'UTC') (Line: 120)
Drupal\views_birthday\Plugin\views\sort\Birthday->getNow() (Line: 96)
Drupal\views_birthday\Plugin\views\sort\Birthday->getDateField() (Line: 106)
Drupal\views_birthday\Plugin\views\sort\Birthday->getDateFormat('Ymd') (Line: 64)
Drupal\views\Plugin\views\sort\Date->query() (Line: 1373)
Drupal\views\ViewExecutable->_build('sort') (Line: 1289)
Drupal\views\ViewExecutable->build() (Line: 387)
Drupal\views\Plugin\views\display\PathPluginBase->execute() (Line: 180)
Drupal\views\Plugin\views\display\Page->execute() (Line: 1630)
Drupal\views\ViewExecutable->executeDisplay('page_1', Array) (Line: 77)
Drupal\views\Element\View::preRenderViewElement(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s.) (Line: 781)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 372)
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: 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)
Steps to reproduce
Tested with Drupal 9.1.5 and German date formats e.g. d.m.Y
It may not work with all international date formats.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| Error View Birthday.jpg | 76.69 KB | uwe_mue |
Issue fork views_birthday-3206779
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
uwe_mue commentedComment #3
uwe_mue commentedComment #4
uwe_mue commentedComment #5
uwe_mue commentedComment #6
uwe_mue commentedComment #7
avpadernoComment #10
uwe_mue commentedVery nice. It works now.
Comment #11
ivnish