mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-27 20:28:54 +02:00
Fixed some inspection issues.
This commit is contained in:
parent
3438f15274
commit
6ddc937ec5
32 changed files with 111 additions and 208 deletions
|
@ -205,7 +205,6 @@ abstract class BaseAdminController extends AbstractController
|
|||
|
||||
//Show errors to user:
|
||||
foreach ($errors as $error) {
|
||||
dump($error);
|
||||
$this->addFlash('error', $error['entity']->getFullPath().':'.$error['violations']);
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,6 @@ class AttachmentFileController extends AbstractController
|
|||
*
|
||||
* @return BinaryFileResponse
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function download(Attachment $attachment, AttachmentManager $helper)
|
||||
{
|
||||
|
|
|
@ -151,7 +151,9 @@ class PartController extends AbstractController
|
|||
$cid = $request->get('cid', 1);
|
||||
|
||||
$category = $em->find(Category::class, $cid);
|
||||
$new_part->setCategory($category);
|
||||
if($category !== null) {
|
||||
$new_part->setCategory($category);
|
||||
}
|
||||
|
||||
$form = $this->createForm(PartBaseType::class, $new_part);
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ class RedirectController extends AbstractController
|
|||
}
|
||||
|
||||
/**
|
||||
* Check if mod_rewrite is availabe (URL rewriting is possible).
|
||||
* Check if mod_rewrite is available (URL rewriting is possible).
|
||||
* If this is true, we can redirect to /en, otherwise we have to redirect to index.php/en.
|
||||
* When the PHP is not used via Apache SAPI, we just assume that URL rewriting is available.
|
||||
*
|
||||
|
|
|
@ -39,9 +39,9 @@ use Symfony\Component\Serializer\Serializer;
|
|||
class TypeaheadController extends AbstractController
|
||||
{
|
||||
/**
|
||||
* @Route("/builtInRessources/search/{query}", name="typeahead_builtInRessources", requirements={"query"= ".+"})
|
||||
* @Route("/builtInResources/search/{query}", name="typeahead_builtInRessources", requirements={"query"= ".+"})
|
||||
*/
|
||||
public function builtInRessources(Request $request, string $query, BuiltinAttachmentsFinder $finder)
|
||||
public function builtInResources(Request $request, string $query, BuiltinAttachmentsFinder $finder)
|
||||
{
|
||||
$array = $finder->find($query);
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ class UserController extends AdminPages\BaseAdminController
|
|||
*/
|
||||
public function delete(Request $request, User $entity, StructuralElementRecursionHelper $recursionHelper)
|
||||
{
|
||||
if (User::ID_ANONYMOUS == $entity->getID()) {
|
||||
if (User::ID_ANONYMOUS === $entity->getID()) {
|
||||
throw new \InvalidArgumentException('You can not delete the anonymous user! It is needed for permission checking without a logged in user');
|
||||
}
|
||||
|
||||
|
@ -120,6 +120,7 @@ class UserController extends AdminPages\BaseAdminController
|
|||
//If no user id was passed, then we show info about the current user
|
||||
if (null === $user) {
|
||||
$user = $this->getUser();
|
||||
|
||||
} else {
|
||||
//Else we must check, if the current user is allowed to access $user
|
||||
$this->denyAccessUnlessGranted('read', $user);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue