Error caused when placing date field under Preview Card/List component
Summary
When a display uses the Preview Card/List patterns and a date field is moved under the date format, it causes an error:
The website encountered an unexpected error. Please try again later.
Error: Call to a member function get() on array in Drupal\cern_components\TwigExtension\CernComponentsTwigExtension->formatFieldDate() (line 140 of /drupal/sites/test-kplatis-dev-modules.web.cern.ch/modules/cern-components/src/TwigExtension/CernComponentsTwigExtension.php).
Full Error attached
Steps to reproduce
- Create a display that uses Preview Card/list
- Map to the Post Date field of the pattern to a date field of the CT
- Visit the page that uses this display
Possible fixes
Check where the formatFieldDate
function is used.
Attachments
Edited by Konstantinos Platis