Kunstmaan / KunstmaanBundlesCMS

An advanced yet user-friendly content management system, based on the full stack Symfony framework combined with a whole host of community bundles. It provides a full featured, multi-language CMS system with an innovative page and form assembling process, versioning, workflow, translation and media managers and much more.
https://kunstmaancms.be
MIT License
403 stars 187 forks source link

[TranslatorBundle] Fixed MessageCatalogue strict type (string) parameters in Translator Loader #3415

Closed jverdeyen closed 5 months ago

jverdeyen commented 5 months ago
Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Fixed tickets none

As the \Symfony\Component\Translation\MessageCatalogue set function is strict typed to (native) string. Entries from the database with values NULL will throw an error on

 $catalogue->set($translation->getKeyword(), $translation->getText(), $translation->getDomain());

Casting them to string will resolve this.

\Symfony\Component\Translation\MessageCatalogue::set()

    /**
     * @return void
     */
    public function set(string $id, string $translation, string $domain = 'messages')
    {
        $this->add([$id => $translation], $domain);
    }
acrobat commented 5 months ago

Thanks @jverdeyen