Kunena 6.2.5 & module Kunena Latest 6.0.7 released

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

Question Bug: Configuration 'User Edits - Yes, except no replies' not working properly

More
6 years 3 months ago #1 by WolfgangOWL
I'm on Kunena 5.0.12 and the configuration option 'User Edits - Yes, except no replies' does not work as expected.

It does only affect the delete-button. In my humble opinion this should also hide the edit-button when the option is set. At least I would expect this behaviour since the option suggests that. I'm pretty sure this worked correctly in the past. I don't know in which Kunena version the behaviour changed.

Do you have a patch for me?

I wish everyone a merry Christmas,
Wolfgang

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

More
6 years 3 months ago #2 by rich
Yes you're right, it does not work anymore. But for me it was also a bug before. It makes no sense, to edit a previously message, when already a answer exist.

Please correct me if I'm wrong: The text "Yes, except no replies" means grammatically, the user can always edit, it's only forbidden, if still nobody has answered. And exactly so has worked this option in previously versions.

It should be:
User Edits - Yes, when no replies

Can you confirm this?

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

More
6 years 3 months ago #3 by WolfgangOWL
Hi Rich,

yes, you are right. The option should be named 'Yes, when no replies' or 'Yes, except when replies'. I didn't think about this because it makes absolutely no sense the other way round.

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

More
6 years 3 months ago #4 by rich
Thank you for the confirmation Wolfgang!

I will create a ticket on Git.
The following user(s) said Thank You: WolfgangOWL

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

More
6 years 3 months ago #5 by WolfgangOWL
Hello Rich,

I saw at Git that 810 added a commit for this bug. He made a change in line 1646 in libraries/kunena/forum/message/message.php.

Unfortunately, this change is not working correctly.
Code:
if (intval($config->useredit) == 2 && $this->getTopic()->getReplies())

This means if there is any reply within a topic a user can't edit his own post, even if the last post is his own.

The following change should fix it:
Code:
if (intval($config->useredit) == 2 && $this->getTopic()->getReplies() && $this->getTopic()->last_post_id > $this->id)

Could you possibly contact 810 to check.

Thank you,
Wolfgang
The following user(s) said Thank You: rich

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

More
6 years 3 months ago - 6 years 3 months ago #6 by rich
Hello Wolfgang,

Thanks for the hint! I've noticed this mistake before read this message and created a new ticket, because this problem now also exists at the Option "User can delete when no replies". github.com/Kunena/Kunena-Forum/issues/5688
But I've now 810 made aware of your contribution.
Last edit: 6 years 3 months ago by rich.
The following user(s) said Thank You: WolfgangOWL

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

More
6 years 2 months ago #7 by 810
ok should be fixed now on the nightly build on the download page.

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

More
6 years 2 months ago - 6 years 2 months ago #8 by WolfgangOWL
I installed the nightly build but it does not work as expected. As the code is it can't:

Code:
if (intval($config->useredit) == 0) { return new KunenaExceptionAuthorise(JText::_('COM_KUNENA_POST_EDIT_NOT_ALLOWED'), 403); } if (intval($config->useredit) == 2 && $this->getTopic()->getReplies()) { return new KunenaExceptionAuthorise(JText::_('COM_KUNENA_POST_EDIT_NOT_ALLOWED'), 403); } if ($this->getTopic()->getReplies() && $this->getTopic()->last_post_id > $this->id) { return new KunenaExceptionAuthorise(JText::_('COM_KUNENA_POST_EDIT_NOT_ALLOWED'), 403); }

Is it possible that I may have fetched the wrong nightly build?
Last edit: 6 years 2 months ago by WolfgangOWL.

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

More
6 years 2 months ago #9 by 810
You can only edit the first topic message, when there are no replies.

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

More
6 years 2 months ago - 6 years 2 months ago #10 by WolfgangOWL
I'm sorry, but there is no option for 'only edit the first topic message when there are no replies' and I see no reason why it should.

It is really hard for me not to get sarcastic here, but I hold back myself.

To make clear how it should work see this code where the if-statements are based on the selected option:

Code:
if (intval($config->useredit) == 0) { /* user is never allowed to edit own post */ return new KunenaExceptionAuthorise(JText::_('COM_KUNENA_POST_EDIT_NOT_ALLOWED'), 403); } elseif (intval($config->useredit) == 1) { /* user is always allowed to edit own post */ /* no action needed here */ } elseif (intval($config->useredit) == 2) { /* user is only allowed to edit own post when no replies */ /* check if the post has any replies */ if ($this->getTopic()->getReplies() && $this->getTopic()->last_post_id > $this->id) { return new KunenaExceptionAuthorise(JText::_('COM_KUNENA_POST_EDIT_NOT_ALLOWED'), 403); } }
Last edit: 6 years 2 months ago by WolfgangOWL.

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

Time to create page: 0.340 seconds