- Posts: 7329
- Thank you received: 1425
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
8 years 2 months ago #197405
by 810
Replied by 810 on topic Bug: Configuration 'User Edits - Yes, except no replies' not working properly
ok should be fixed now on the nightly build on the download page.
Please Log in or Create an account to join the conversation.
- WolfgangOWL
-
Topic Author
- Offline
- Senior Member
-
8 years 2 months ago - 8 years 2 months ago #197414
by WolfgangOWL
Replied by WolfgangOWL on topic Bug: Configuration 'User Edits - Yes, except no replies' not working properly
I installed the nightly build but it does not work as expected. As the code is it can't:
Is it possible that I may have fetched the wrong nightly build?
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.
8 years 2 months ago #197418
by 810
Replied by 810 on topic Bug: Configuration 'User Edits - Yes, except no replies' not working properly
You can only edit the first topic message, when there are no replies.
Please Log in or Create an account to join the conversation.
- WolfgangOWL
-
Topic Author
- Offline
- Senior Member
-
8 years 2 months ago - 8 years 2 months ago #197424
by WolfgangOWL
Replied by WolfgangOWL on topic Bug: Configuration 'User Edits - Yes, except no replies' not working properly
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:
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.
- WolfgangOWL
-
Topic Author
- Offline
- Senior Member
-
8 years 2 months ago #197425
by WolfgangOWL
Replied by WolfgangOWL on topic Bug: Configuration 'User Edits - Yes, except no replies' not working properly
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