Kunena 7.0.4 Released

The Kunena team has announce the arrival of Kunena 7.0.4 [K 7.0.4] in stable which is now available for download as a native Joomla extension for J! 5.4.x/6.0.x. This version addresses most of the issues that were discovered in K 6.2 / K 6.3 / K 6.4 and issues discovered during the last development stages of K 7.0

Solved Can't delete private part of topic messages

More
2 weeks 1 day ago - 2 weeks 1 day ago #234899 by itn-ms
Hello,

I tried to remove the private part of a message of a user via the frontend edit function. 
However every time I deleted everything and saved, the text stayed the same. If I just changed a bit, it was saved.
After some debugging I found out that this behaviour is by design:
In the file  github.com/Kunena/Kunena-Forum/blob/eb61.../TopicController.php
Starting with line 1588 in the editPrivate-function I found that there's just a return if the body is empty:
Code:
if (!trim($body) && !$attachIds) {             return;         }

Shouldn't the expected behaviour be, that the private part of the message is deleted instead of just aborting the edit of the private message?
Or is there any other way to remove the private part I don't know of?

Thanks in advance for your answers!

Marco
 
Last edit: 2 weeks 1 day ago by itn-ms.

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

More
2 weeks 1 day ago - 2 weeks 1 day ago #234900 by xillibit
Hello,

Thanks for the feedback.

This change was intented see issue :  github.com/Kunena/Kunena-Forum/issues/9880 , if you have private part empty and normal text part empty it cause some errors.

In your case you had the normal text part empty ?

I don't provide support by PM, because this can be useful for someone else.
Last edit: 2 weeks 1 day ago by xillibit.

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

More
2 weeks 19 hours ago #234901 by xillibit
Hello,

I have just made a change for it, you can try the change :  github.com/Kunena/Kunena-Forum/pull/10031

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 weeks 8 hours ago #234902 by itn-ms
Hello,

thanks for your fast answer and pull request.
You are right, I have a public part and just want to delete the private part of the message.

If I just change the if in line 1588 like you provided, the message automatically fallbacks to "No private message has been set, only private attachments" because of line 1612: 
Code:
$private->body = Text::_('COM_KUNENA_POST_WITH_PRIVATE_ATTACHMENTS_SAVED');

Also even if I would unset the $private->body there,
Code:
if (!$private->body && !$private->attachments) {
in line 1621 would still not be true because even if I don't have private attachments, I still have an array $attachIds with 0 = "" which results in $private->attachments being 1.

However if I quickly try to unset both, $private->body and $private->attachments, the private part is deleted as I would expect.
I don't have a Github account at work but I try to find the time to do some more debugging in private and will then answer your pull request.

Thanks again for your help.

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

More
2 weeks 5 hours ago #234903 by xillibit
Hello,

I will later today to improve my PR, this message in private part is useless is you have something in the normal message part

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
1 week 5 days ago #234907 by xillibit
Hello,

I have made an another Pull Request  with others changes :  github.com/Kunena/Kunena-Forum/pull/10032

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.

Time to create page: 0.256 seconds