Field wrappers and customisations not working for node date

Created on 21 May 2021, over 3 years ago
Updated 17 February 2023, almost 2 years ago

Problem/Motivation

The problem is in olivero_preprocess_node. The code overwrites $variables['date'] with just a date. Previously the value was set by template_preprocess_node() and it contains rendered field output.

  1. This leads to missing classes, therefore custom styling might be missed
  2. For the same reason, custom features might not work (e.g. quickedit)
  3. If a site had customised the field display settings using a hook this would be overwritten

Steps to reproduce

  1. Enable quickedit
  2. Enable "Display author and date information" for a content type
  3. Edit a node of that content type

Proposed resolution

There is a clear requirement to customise the date format for a particular theme. However the current solution is probably not the right way to do it. Ideas:

  1. Alter the settings on the field formatter for the created field. Then it would get render correctly by the code in template_preprocess_node. However field formatter settings are not theme specific, so this would have a global effect.
  2. Hook into the pre-processing and alter the date format.

Remaining tasks

  1. Write a patch
  2. Re-enable commented out code in NodeDisplayConfigurableTest.php

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Needs work

Version

10.1 ✨

Component
OliveroΒ  β†’

Last updated about 3 hours ago

Created by

πŸ‡¬πŸ‡§United Kingdom adamps

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024