Skip to content

Commit

Permalink
Fixing some errors in strict mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Hunziker committed Feb 16, 2017
1 parent 4bba54f commit d9721b0
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions plugins/sampledata/blog/blog.php
Expand Up @@ -121,13 +121,18 @@ public function onAjaxSampledataApplyStep1()
'associations' => array(),
'description' => '',
'language' => '*',
'params' => '',
);

if (!$categoryModel->save($category))
try
{
$categoryModel->save($category);
}
catch (Exception $e)
{
$response = array();
$response['success'] = false;
$response['message'] = JText::sprintf('PLG_SAMPLEDATA_BLOG_STEP_FAILED', 1, $categoryModel->getError());
$response['message'] = JText::sprintf('PLG_SAMPLEDATA_BLOG_STEP_FAILED', 1, $e->getMessage());

return $response;
}
Expand All @@ -150,13 +155,18 @@ public function onAjaxSampledataApplyStep1()
'associations' => array(),
'description' => '',
'language' => '*',
'params' => '',
);

if (!$categoryModel->save($category))
try
{
$categoryModel->save($category);
}
catch (Exception $e)
{
$response = array();
$response['success'] = false;
$response['message'] = JText::sprintf('PLG_SAMPLEDATA_BLOG_STEP_FAILED', 1, $categoryModel->getError());
$response['message'] = JText::sprintf('PLG_SAMPLEDATA_BLOG_STEP_FAILED', 1, $e->getMessage());

return $response;
}
Expand Down Expand Up @@ -210,6 +220,9 @@ public function onAjaxSampledataApplyStep1()
$article['state'] = 1;
$article['featured'] = 0;
$article['images'] = '';
$article['metakey'] = '';
$article['metadesc'] = '';
$article['xreference'] = '';

if (!isset($article['access']))
{
Expand Down

0 comments on commit d9721b0

Please sign in to comment.