Kunena 6.1.3.2 Released

The Kunena team has announce the arrival of Kunena 6.1.3.2 [K 6.1.3] which is now available for download as a native Joomla extension for J! 4.2.x/4.3.x. This version addresses most of the issues that were discovered in K 6.1.0 and issues discovered during the last development stages of K 6.1

Solved User can't post a message - Unsupported operand types: string + string

More
2 months 3 weeks ago #1 by oxygen77
Hello,

Our kunena forum has been migrated some weeks ago from Joomla 3 to 4 and we are now using latest version of kunena.

joomla: 4.3.2
kunena: 6.1.1
template/theme with gantry5 / helium

Some user are not able to post replies and they have following error displayed on their side:

"0 Unsupported operand types: string + string"

I'm not able on myside to reproduce the issue.

In webserver logs I can see a 500 response code on POST https://FQDN/

Enabling some debug on joomla I get this stack (I'm obfuscated the IP address)

Code:
2023-07-05T12:52:41+00:00       CRITICAL        error   Uncaught Throwable of type TypeError thrown with message "Unsupported operand types: string + string". Stack trace: #0 [ROOT]/libraries/kunena/src/Database/(206): Kunena\Forum\Libraries\Forum\Message\KunenaMessage->check() #1 [ROOT]/libraries/kunena/src/Forum/Message/(688): Kunena\Forum\Libraries\Database\KunenaDatabaseObject->save() #2 [ROOT]/components/com_kunena/src/Controllers/(831): Kunena\Forum\Libraries\Forum\Message\KunenaMessage->save() #3 [ROOT]/libraries/kunena/src/Controller/(319): Kunena\Forum\Site\Controllers\TopicController->post() #4 [ROOT]/libraries/kunena/src/Controller/(226): Kunena\Forum\Libraries\Controller\KunenaController->executeTask() #5 [ROOT]/components/com_kunena/src/Dispatcher/(108): Kunena\Forum\Libraries\Controller\KunenaController->execute() #6 [ROOT]/libraries/src/Component/(361): Kunena\Forum\Site\Dispatcher\Dispatcher->dispatch() #7 [ROOT]/libraries/src/Application/(208): Joomla\CMS\Component\ComponentHelper::renderComponent() #8 [ROOT]/libraries/src/Application/(249): Joomla\CMS\Application\SiteApplication->dispatch() #9 [ROOT]/libraries/src/Application/(293): Joomla\CMS\Application\SiteApplication->doExecute() #10 [ROOT]/includes/(61): Joomla\CMS\Application\CMSApplication->execute() #11 [ROOT]/(32): require_once('...') #12 {main}


kunena debug mode is not showing info (I guess this is only available for admin account ?)

Happy to give you more context / info.

Please Log in or Create an account to join the conversation.

More
2 months 2 weeks ago #2 by oxygen77
Adding some info,

I've looked into the code and debug a bit the issue.

The error appears in (), near line 1422, there is a SQL that do:
select MAX(time) from kunena_messages where ip='USER_IP';

where USER_IP is a parameter,

It looks like the result is malformated and is not a date in some cases.

I notice that in the table the ip column can have NULL in some cases.

Also, I was wondering if the following code is supposed to be ok if we don't find the IP, $lastPostTime is NULL in this case ?
Code:
if ($lastPostTime + $config->floodProtection > Factory::getDate()->toUnix()) {                 throw new Exception(Text::sprintf('COM_KUNENA_LIB_MESSAGE_ERROR_FLOOD', (int) $config->floodProtection));                 return false;             }
 

Please Log in or Create an account to join the conversation.

More
2 months 2 weeks ago #3 by oxygen77
any insigt from the dev team ?

Is it a joomla migration 3 => 4 (or following kunena update) that were not OK ?

Should I fix account in the table ?

Please Log in or Create an account to join the conversation.

More
2 months 2 weeks ago #4 by xillibit
Hello,

I haven't looked yet at this issue, if you modify directly in the table the issue could come an another time with others users

I don't provide support by PM, because this can be useful for someone else.

Please Log in or Create an account to join the conversation.

More
2 months 2 weeks ago #5 by oxygen77
thx for your feedback, I'll wait for a deeper analyse, current status is that without flood protection it is ok.

I can provide you with some data from DB if needed

Please Log in or Create an account to join the conversation.

More
2 months 2 weeks ago #6 by gioorl
Same problem on my website which was migrated to Joomla 4 and Kunena 6 last year.
Has been working fine until Kunena 6.1.1 and then Registered users started reporting issues replying to posts.
Super Users are not affected by this problem.

Submitting a Reply in "Private message" works just fine but not in standard "Message". "Thank you" features and "Polls" work too.
Strangely, if a registered user posts a "Private message" and then edits it to become a standard "Message", the post is saved correctly.

Disabling flood protection in the Kunena config removes the problem as reported by oxygen77 (Thanks for that tip) but setting it to a high value does not resolve the issue

Please Log in or Create an account to join the conversation.

More
2 months 1 week ago #7 by xillibit
Hello,

I have just made a fix it, there is it : github.com/Kunena/Kunena-Forum/commit/fa...b19557ebd4c0f0ce0d5a

I don't provide support by PM, because this can be useful for someone else.

Please Log in or Create an account to join the conversation.

More
2 months 1 week ago #8 by oxygen77
Thx!

I've manualy patch the code on my side and I think it has solved the issue.

good job again
The following user(s) said Thank You: xillibit

Please Log in or Create an account to join the conversation.

More
2 months 1 week ago #9 by gioorl
Just tested it and can confirm it works for me.

Thank you for sorting this out so quickly
The following user(s) said Thank You: xillibit

Please Log in or Create an account to join the conversation.

Time to create page: 0.419 seconds