Navigation Menu

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

JobController can't resolve Jobs #202

Open
tartexs opened this issue Feb 20, 2018 · 0 comments
Open

JobController can't resolve Jobs #202

tartexs opened this issue Feb 20, 2018 · 0 comments

Comments

@tartexs
Copy link

tartexs commented Feb 20, 2018

I having a problem with the webinterface, i can access to jobs list (.../jobs/) but can't access to job details e.g. (.../jobs/13) because can't resolve job parameter for controller action

{"code":500,"message":"An internal server error has occurred","exception":{"message":"Controller \"JMS\\JobQueueBundle\\Controller\\JobController::detailsAction()\" requires that you provide a value for the \"$job\" argument. Either the argument is nullable and no null value has been provided, no default value has been provided or because there is a non optional argument after this one.

a quick solution for this was change the JobController.php and add a quick find for the job by id

/**
 * @Route("/{id}", name = "jms_jobs_details")
 * @Template("JMSJobQueueBundle:Job:details.html.twig")
 */
public function detailsAction($id)
{
    $qb = $this->getEm()->createQueryBuilder();
    $qb->select('j')->from('JMSJobQueueBundle:Job', 'j')
        ->where($qb->expr()->eq('j.id', $id));
    $query = $qb->getQuery();
    $job = $query
      ->setMaxResults(1)
      ->getOneOrNullResult();
    ...

}

maybe my problem is related with webinterface installation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant