Skip to content

Commit

Permalink
Remove others getError() usage
Browse files Browse the repository at this point in the history
  • Loading branch information
xillibit committed May 1, 2024
1 parent 398b628 commit 70a82e5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/site/language/en-GB/en-GB.com_kunena.views.ini
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ COM_KUNENA_MODERATION_ENTER_TOPIC = "Manually Enter Topic ID"
COM_KUNENA_MODERATION_MERGE_TOPIC = "Merge topic with another topic"
COM_KUNENA_POST_EDIT = "Edit Post:"
COM_KUNENA_POST_NEW_TOPIC = "New Topic"
COM_KUNENA_POST_NEW_TOPIC_NO_PERMISSIONS = "You do not have permissions to start a new topic! Or you haven't created/published a top level category ! %s"
COM_KUNENA_POST_NEW_TOPIC_NO_PERMISSIONS = "You do not have permissions to start a new topic! Or you haven't created/published a top level category !"
COM_KUNENA_POST_REPLY_TOPIC = "Reply Topic:"
COM_KUNENA_REPLY_USER_REPLY_DISABLED = "You cannot reply to this topic."
COM_KUNENA_SELECT_CATEGORY = "- Select Category -"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,8 @@ protected function before()
}

if (!$this->topic->category_id) {
throw new KunenaExceptionAuthorise(Text::sprintf(
'COM_KUNENA_POST_NEW_TOPIC_NO_PERMISSIONS',
$this->topic->getError()
throw new KunenaExceptionAuthorise(Text::_(
'COM_KUNENA_POST_NEW_TOPIC_NO_PERMISSIONS'
), $this->me->exists() ? 403 : 401);
}

Expand Down
3 changes: 1 addition & 2 deletions src/site/src/View/Topic/HtmlView.php
Original file line number Diff line number Diff line change
Expand Up @@ -1265,8 +1265,7 @@ protected function DisplayCreate($tpl = null)
list($this->topic, $this->message) = $this->category->newTopic($saved);

if (!$this->topic->category_id) {
$msg = Text::sprintf('COM_KUNENA_POST_NEW_TOPIC_NO_PERMISSIONS', $this->topic->getError());
$this->app->enqueueMessage($msg, 'error');
$this->app->enqueueMessage(Text::_('COM_KUNENA_POST_NEW_TOPIC_NO_PERMISSIONS'), 'error');

return false;
}
Expand Down

0 comments on commit 70a82e5

Please sign in to comment.