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

CommentFileSizeAuthor
Error View Birthday.jpg76.69 KBuwe_mue
Command icon 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

uwe_mue created an issue. See original summary.

uwe_mue’s picture

Title: Sort criteria does not work » Sortierkriterien funktionieren nicht
uwe_mue’s picture

uwe_mue’s picture

Title: Sortierkriterien funktionieren nicht » Sort criteria does not work
uwe_mue’s picture

Assigned: Unassigned » uwe_mue
Issue summary: View changes
uwe_mue’s picture

Issue summary: View changes
avpaderno’s picture

Version: 8.x-1.0 » 8.x-1.x-dev
Assigned: uwe_mue » Unassigned

tchandelle made their first commit to this issue’s fork.

uwe_mue’s picture

Very nice. It works now.

ivnish’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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