Skip to content

Commit b9a05a1

Browse files
author
Sanjeev Papnoi
committed
Merge branch '1.0' into HEAD
2 parents 2e0c912 + 03e4fdd commit b9a05a1

5 files changed

Lines changed: 44 additions & 3 deletions

File tree

CHANGELOG-1.0.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ CHANGELOG for 1.0.x
33

44
This changelog references any relevant changes introduced in 1.0 minor versions.
55

6+
* 1.0.7 (2020-05-26)
7+
* **Misc. Updates:**
8+
* Added Not found exception in different part of bundle.
9+
610
* 1.0.6 (2020-04-17)
711
* **Misc. Updates:**
812
* Change processing function and removed unnecessary code for speed up..

Controller/Article.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Symfony\Component\HttpFoundation\Request;
99
use Symfony\Component\HttpFoundation\Response;
1010
use Symfony\Component\HttpFoundation\JsonResponse;
11-
11+
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
1212
use Webkul\UVDesk\SupportCenterBundle\Entity\Article as ArticleEntity;
1313
use Webkul\UVDesk\SupportCenterBundle\Entity\ArticleCategory;
1414
use Webkul\UVDesk\SupportCenterBundle\Entity\ArticleRelatedArticle;
@@ -473,4 +473,13 @@ private function removeArticle($article)
473473
->getRepository('UVDeskSupportCenterBundle:Article')
474474
->removeEntryByArticle($article->getId());
475475
}
476+
477+
/**
478+
* If customer is playing with url and no result is found then what will happen
479+
* @return
480+
*/
481+
protected function noResultFound()
482+
{
483+
throw new NotFoundHttpException('Not Found!');
484+
}
476485
}

Controller/Category.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use Symfony\Component\HttpFoundation\Request;
77
use Symfony\Component\HttpFoundation\Response;
88
use Doctrine\Common\Collections\Criteria;
9-
9+
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
1010
use Webkul\UVDesk\SupportCenterBundle\Entity\SolutionCategory;
1111
use Webkul\UVDesk\SupportCenterBundle\Entity\SolutionCategoryMapping;
1212
use Webkul\UVDesk\SupportCenterBundle\Form\Category as CategoryForm;
@@ -59,7 +59,7 @@ public function categoryListBySolution(Request $request)
5959
->getCategoriesCountBySolution($request->attributes->get('solution')),
6060
];
6161
return $this->render('@UVDeskSupportCenter/Staff/Category/categoryListBySolution.html.twig',$solution_category);
62-
}else
62+
} else
6363
$this->noResultFound();
6464
}
6565

@@ -307,4 +307,13 @@ private function removeCategory($category)
307307
->getRepository('UVDeskSupportCenterBundle:SolutionCategory')
308308
->removeEntryByCategory($category);
309309
}
310+
311+
/**
312+
* If customer is playing with url and no result is found then what will happen
313+
* @return
314+
*/
315+
protected function noResultFound()
316+
{
317+
throw new NotFoundHttpException('Not Found!');
318+
}
310319
}

Controller/Folder.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
77
use Symfony\Component\HttpFoundation\Request;
88
use Symfony\Component\HttpFoundation\Response;
9+
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
910
use Webkul\UVDesk\SupportCenterBundle\Entity\Solutions;
1011

1112
class Folder extends Controller
@@ -131,4 +132,13 @@ public function updateFolder($folderId)
131132
'errors' => json_encode(!empty($errors) ? $errors : [])
132133
]);
133134
}
135+
136+
/**
137+
* If customer is playing with url and no result is found then what will happen
138+
* @return
139+
*/
140+
protected function noResultFound()
141+
{
142+
throw new NotFoundHttpException('Not Found!');
143+
}
134144
}

Controller/Website.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,4 +405,13 @@ public function rateArticle($articleId, Request $request)
405405

406406
return new Response(json_encode($response['content']), $response['code'], ['Content-Type: application/json']);
407407
}
408+
409+
/**
410+
* If customer is playing with url and no result is found then what will happen
411+
* @return
412+
*/
413+
protected function noResultFound()
414+
{
415+
throw new NotFoundHttpException('Not Found!');
416+
}
408417
}

0 commit comments

Comments
 (0)