Kunena 7.0.2 Released

The Kunena team has announce the arrival of Kunena 7.0.2 [K 7.0.2] in stable which is now available for download as a native Joomla extension for J! 5.3.x/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

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

More
8 years 2 months ago #197405 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
8 years 2 months ago - 8 years 2 months ago #197414 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: 8 years 2 months ago by WolfgangOWL.

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

More
8 years 2 months ago #197418 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
8 years 2 months ago - 8 years 2 months ago #197424 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: 8 years 2 months ago by WolfgangOWL.

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

More
8 years 2 months ago #197425 by WolfgangOWL
Here is the optimized code:

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

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

Time to create page: 0.375 seconds