Error 500 Internal Server Error

GET https://www.tennisfinder.atts-systems.com/photos/location/0/All/Full

Forwarded to ErrorController (75ab45)

Exceptions

App\Repository\PhotosRepository::findByLocation(): Argument #1 ($photoLocations) must be of type App\Entity\PhotoLocations, null given, called in /var/www/html/tennisfinder/src/Services/PhotoAuthorsByLocationService.php on line 12

TypeError

  1.             ->getQuery()
  2.             ->getOneOrNullResult()
  3.         ;
  4.     }
  5.     */
  6.     public function findByLocation(PhotoLocations $photoLocations)
  7.     {
  8.         return $this->createQueryBuilder('p')
  9.             ->andWhere('p.location = :val')
  10.             ->setParameter('val'$photoLocations)
  11.             ->getQuery()
PhotosRepository->findByLocation() in src/Services/PhotoAuthorsByLocationService.php (line 12)
  1. class PhotoAuthorsByLocationService
  2. {
  3.     public function authorList($location)
  4.     {
  5.         $photos $this->photosRepository->findByLocation($location);
  6.         $author_list = [];
  7.         foreach ($photos as $photo) {
  8.             $author_list[] = $photo->getUploadedBy();
  9.         }
  10.        $unique_authors_list = [];
PhotoAuthorsByLocationService->authorList() in src/Controller/PhotosController.php (line 60)
  1.     public function showPhotosByLocation(Security $securityRequest $requeststring $authorstring $formatint $idPhotosRepository $photosRepositoryPhotoLocationsRepository $locationsRepositoryUserRepository $userRepositoryPhotoLocationsRepository $photoLocationsRepositoryPhotoAuthorsByLocationService $authorsByLocation)
  2.     {
  3.         $locationID $photoLocationsRepository->findOneBy([
  4.             'id' => $id
  5.         ]);
  6.         $authors $authorsByLocation->authorList($locationID);
  7.         if ($author == "All") {
  8.             $all_or_by_author "All";
  9.             $photos $photosRepository->findBy([
  10.                 'location' => $locationsRepository->findOneBy([
in vendor/symfony/http-kernel/HttpKernel.php -> showPhotosByLocation (line 181)
  1.         $this->dispatcher->dispatch($eventKernelEvents::CONTROLLER_ARGUMENTS);
  2.         $controller $event->getController();
  3.         $arguments $event->getArguments();
  4.         // call controller
  5.         $response $controller(...$arguments);
  6.         // view
  7.         if (!$response instanceof Response) {
  8.             $event = new ViewEvent($this$request$type$response$event);
  9.             $this->dispatcher->dispatch($eventKernelEvents::VIEW);
  1.         $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  2.         $this->requestStack->push($request);
  3.         $response null;
  4.         try {
  5.             return $response $this->handleRaw($request$type);
  6.         } catch (\Throwable $e) {
  7.             if ($e instanceof \Error && !$this->handleAllThrowables) {
  8.                 throw $e;
  9.             }
  1.         $this->boot();
  2.         ++$this->requestStackSize;
  3.         $this->resetServices true;
  4.         try {
  5.             return $this->getHttpKernel()->handle($request$type$catch);
  6.         } finally {
  7.             --$this->requestStackSize;
  8.         }
  9.     }
Kernel->handle() in public/index.php (line 20)
  1.     Debug::enable();
  2. }
  3. $kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
  4. $request Request::createFromGlobals();
  5. $response $kernel->handle($request);
  6. $response->send();
  7. $kernel->terminate($request$response);