Remove translation from Season object (to avoid Ajax LogicException)

Created on 7 November 2023, 11 months ago
Updated 9 November 2023, 11 months ago

Problem/Motivation

The season object has an (untranslated) name (like machine_name), and a translated label(), which translates the name.

Let us remove the translation. Trigger is this issue: 🐛 Ajax error on [Add exception] button if "seasons" is activated Active

There are many core issues like this: core issues with 'LogicException: The database connection is not serializable.'

Steps to reproduce

+ // Enable locale module 'User interface translation.
+ // Enable both exceptions and season in widget.
+ // Edit with non-english page /nl/node/8/edit (here NL, but DE, or any other non-EN language)
+ // Click 'Add Exception' button.
+ // Check if an empty exception is added.

Proposed resolution

Remove translation from standard name.
Remove translation from label().

Alternatives:
Use t() instead of $this->t()
add 'use DependencySerializationTrait;' statement in OfficeHoursSeason object.

Remaining tasks

User interface changes

Season name is not translated anymore.

API changes

$season->label() gives untranslated season name.

Data model changes

📌 Task
Status

Fixed

Version

1.12

Component

Code - widget

Created by

🇳🇱Netherlands johnv

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

Comments & Activities

Production build 0.71.5 2024