From 9bd62e06961ae655463df446902d28d96a4314c3 Mon Sep 17 00:00:00 2001 From: markus-moser Date: Thu, 30 Apr 2026 12:15:12 +0000 Subject: [PATCH 1/2] [Feature]: Expose jobName on JobRun API response Adds the job name to the running-jobs list endpoint so the frontend can route each in-progress job to the correct rehydration handler on page reload, fixing issue #3455. --- src/ExecutionEngine/Hydrator/JobRunListHydrator.php | 1 + src/ExecutionEngine/Schema/JobRun.php | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ExecutionEngine/Hydrator/JobRunListHydrator.php b/src/ExecutionEngine/Hydrator/JobRunListHydrator.php index 4408e61f6..f628f09cc 100644 --- a/src/ExecutionEngine/Hydrator/JobRunListHydrator.php +++ b/src/ExecutionEngine/Hydrator/JobRunListHydrator.php @@ -43,6 +43,7 @@ public function hydrate(JobRunEntity $jobRun): JobRun totalSteps: $totalSteps, creationDate: $jobRun->getCreationDate(), modificationDate: $jobRun->getModificationDate(), + jobName: $jobRun->getJob()?->getName() ?? '', ); } diff --git a/src/ExecutionEngine/Schema/JobRun.php b/src/ExecutionEngine/Schema/JobRun.php index 7dd9f7199..319073a85 100644 --- a/src/ExecutionEngine/Schema/JobRun.php +++ b/src/ExecutionEngine/Schema/JobRun.php @@ -25,7 +25,7 @@ title: 'JobRun', required: [ 'id', 'ownerId', 'state', 'executionContext', 'totalElements', 'currentMessage', - 'jobRunChildId', 'currentStep', 'totalSteps', 'creationDate', 'modificationDate', + 'jobRunChildId', 'currentStep', 'totalSteps', 'creationDate', 'modificationDate', 'jobName', ], type: 'object' )] @@ -56,6 +56,8 @@ public function __construct( private readonly ?int $creationDate = null, #[Property(description: 'Modification date', type: 'integer', example: null)] private readonly ?int $modificationDate = null, + #[Property(description: 'The name of the job', type: 'string', example: 'studio_ee_job_delete_assets')] + private readonly string $jobName = '', ) { } @@ -113,4 +115,9 @@ public function getTotalSteps(): ?int { return $this->totalSteps; } + + public function getJobName(): string + { + return $this->jobName; + } } From 3a793386abb4e8bff31156fa5e9292e275f8c4fb Mon Sep 17 00:00:00 2001 From: markus-moser Date: Thu, 30 Apr 2026 12:50:56 +0000 Subject: [PATCH 2/2] [Bug]: Handle null filters in JobRunRepository gracefully When the request body contains no filters object, CollectionFilterParameter returns null from getFilters(). Use a default FilterParameter instance as fallback so pagination and sort don't throw a null pointer exception. --- src/ExecutionEngine/Repository/JobRunRepository.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ExecutionEngine/Repository/JobRunRepository.php b/src/ExecutionEngine/Repository/JobRunRepository.php index 6bb49f3ce..9e1419052 100644 --- a/src/ExecutionEngine/Repository/JobRunRepository.php +++ b/src/ExecutionEngine/Repository/JobRunRepository.php @@ -18,6 +18,7 @@ use Doctrine\ORM\Tools\Pagination\Paginator; use Pimcore\Bundle\GenericExecutionEngineBundle\Entity\JobRun; use Pimcore\Bundle\StudioBackendBundle\Entity\ExecutionEngine\JobRunHidden; +use Pimcore\Bundle\StudioBackendBundle\Filter\MappedParameter\FilterParameter; use Pimcore\Bundle\StudioBackendBundle\MappedParameter\CollectionFilterParameter; /** @@ -59,14 +60,15 @@ public function getStudioJobRuns(int $ownerId, CollectionFilterParameter $parame $qb->andWhere('jr.ownerId = :ownerId') ->setParameter('ownerId', $ownerId); - $qb->setFirstResult($parameter->getFilters()->getStart()); - $qb->setMaxResults($parameter->getFilters()->getPageSize()); + $filters = $parameter->getFilters() ?? new FilterParameter(); + $qb->setFirstResult($filters->getStart()); + $qb->setMaxResults($filters->getPageSize()); $this->applyFilter($parameter, $qb); $qb->orderBy( - 'jr.'.$parameter->getFilters()->getSortFilter()->getKey(), - $parameter->getFilters()->getSortFilter()->getDirection()); + 'jr.'.$filters->getSortFilter()->getKey(), + $filters->getSortFilter()->getDirection()); // Add execution contexts condition $qb->andWhere('jr.executionContext IN (:executionContexts)')