Kunena / Kunena-Forum

Kunena Forum - Forum / Bulletin Board / Discussions component for Joomla - This is the 6.x/5.x main development branch. Please do not open issues regarding earlier versions of Kunena
https://www.kunena.org
GNU General Public License v3.0
1.75k stars 811 forks source link

$layout->render expects an array as parameter, but string is given #9748

Closed svanschu closed 1 month ago

svanschu commented 1 month ago

In the file https://github.com/Kunena/Kunena-Forum/blob/6417a6a6ab7bb4817d07472e338de7d7d73af8dc/src/libraries/kunena/src/Forum/Message/KunenaMessage.php#L1568

$msg = trim($layout->render($subscription ? 'default' : 'moderator'));

$layout->render expects an array as parameter, but string is given. If a string is given, the method does nothing.

If I read this correctly the msg would be always an empty string.

This method is used for


           // Send email to all subscribers.
            if (!empty($receivers[1])) {
                $this->attachEmailBody($mail, 1, $subject, $url, $once);
                KunenaEmail::send($mail, $receivers[1]);
            }

            // Send email to all moderators.
            if (!empty($receivers[0])) {
                $this->attachEmailBody($mail, 0, $subject, $url, $once);
                KunenaEmail::send($mail, $receivers[0]);
            }

in https://github.com/Kunena/Kunena-Forum/blob/6417a6a6ab7bb4817d07472e338de7d7d73af8dc/src/libraries/kunena/src/Forum/Message/KunenaMessage.php#L543C13-L553C14