Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #220502 Fix: We cannot access 'Notification Templates' in backend -> An error has occurred. 0 Class "JError" not found #171

Open
wants to merge 1 commit into
base: release-3.1.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/com_tjnotifications/admin/views/logs/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ public function display($tpl = null)
// Check for errors.
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode('<br />', $errors));
$app = Factory::getApplication();
$app->enqueueMessage(implode('<br />', $errors), 'error');

return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function display($tpl = null)
if (empty($this->user->authorise('core.create', 'com_tjnotifications')) || empty($this->user->authorise('core.edit', 'com_tjnotifications')))
{
$msg = Text::_('JERROR_ALERTNOAUTHOR');
JError::raiseError(403, $msg);
$this->app->enqueueMessage($msg, 'error');
$this->app->redirect(Route::_('index.php?Itemid=0', false));
}

Expand All @@ -74,7 +74,7 @@ public function display($tpl = null)
// Check for errors.
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode('<br />', $errors));
$this->app->enqueueMessage(implode('<br />', $errors), 'error');

return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function display($tpl = null)
if (empty($this->user->authorise('core.viewlist', 'com_tjnotifications')))
{
$msg = Text::_('JERROR_ALERTNOAUTHOR');
JError::raiseError(403, $msg);
$this->app->enqueueMessage($msg, 'error');
$this->app->redirect(Route::_('index.php?Itemid=0', false));
}

Expand All @@ -78,7 +78,7 @@ public function display($tpl = null)
// Check for errors.
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode('<br />', $errors));
$this->app->enqueueMessage(implode('<br />', $errors), 'error');

return false;
}
Expand Down
12 changes: 7 additions & 5 deletions src/com_tjnotifications/install.tjnotifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ public function installSqlFiles($parent)

if (!$db->execute())
{
JError::raiseWarning(1, Text::sprintf('JLIB_INSTALLER_ERROR_SQL_ERROR', $db->stderr(true)));
$app = Factory::getApplication();
$app->enqueueMessage(Text::sprintf('JLIB_INSTALLER_ERROR_SQL_ERROR', $db->stderr(true)), 'error');

return false;
}
Expand Down Expand Up @@ -294,6 +295,7 @@ public function installSqlFiles($parent)
*/
public function fixTemplateTable($db, $dbprefix, $config)
{
$app = Factory::getApplication();
$query = "SHOW COLUMNS FROM #__tj_notification_templates WHERE `Field` = 'title'";
$db->setQuery($query);
$check = $db->loadResult();
Expand All @@ -305,7 +307,7 @@ public function fixTemplateTable($db, $dbprefix, $config)

if (!$db->execute())
{
JError::raiseError(500, $db->stderr());
$app->enqueueMessage($db->stderr(), 'error');
}
}

Expand All @@ -320,7 +322,7 @@ public function fixTemplateTable($db, $dbprefix, $config)

if (!$db->execute())
{
JError::raiseError(500, $db->stderr());
$app->enqueueMessage($db->stderr(), 'error');
}
}

Expand All @@ -335,7 +337,7 @@ public function fixTemplateTable($db, $dbprefix, $config)

if (!$db->execute())
{
JError::raiseError(500, $db->stderr());
$app->enqueueMessage($db->stderr(), 'error');
}
}

Expand All @@ -350,7 +352,7 @@ public function fixTemplateTable($db, $dbprefix, $config)

if (!$db->execute())
{
JError::raiseError(500, $db->stderr());
$app->enqueueMessage($db->stderr(), 'error');
}
}
}
Expand Down