Call to an undefined method Drupal\locale\StringStorageInterface::dbStringSelect().

Created on 2 October 2023, 9 months ago
Updated 4 October 2023, 9 months ago

Problem/Motivation

StringDatabaseStorageDecorator::dbStringSelect makes a call to dbStringSelect on the decorated service but it should be called on the parent class instead. Since that method isn't on the service interface.

I ran into this using this module together with Symfony Translation β†’ which decorates the same service.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡ΈπŸ‡ͺSweden marcusml

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

Comments & Activities

  • Issue created by @marcusml
  • @marcusml opened merge request.
  • Status changed to Needs review 9 months ago
  • πŸ‡¬πŸ‡§United Kingdom james.williams

    Thanks for the report and potential fix! Our decorator does currently have to act in a way that means it can't be a pure decorator. Some of the problem with decorating has already been pointed out in #3203641: Don't consider locale fallbacks while editing translations β†’ , with the suggestion that the service should be swapped out entirely rather than decorated. So to some extent, I'm impressed that Symfony Translation and Language Hierarchy are able to work together at all!

    Given that we already use a parent:: call in our StringDatabaseStorageDecorator::dbStringLoad() implementation, there's also a clear precedent that your solution is probably the right way to go. I have done zero testing, and don't really have capacity to do any in the near future (just being honest!), but I feel positive about this change. I welcome reviews from others in order to progress this!

Production build 0.69.0 2024