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

Fix: ManyToOne relation in combo display mode doesn't respect path formatter #645

Merged
merged 5 commits into from
Sep 17, 2024

Conversation

blankse
Copy link
Contributor

@blankse blankse commented Aug 2, 2024

Fix #638

Copy link

sonarcloud bot commented Aug 7, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

@robertSt7 robertSt7 self-assigned this Sep 6, 2024
@robertSt7
Copy link
Contributor

Hi @blankse when I use the example formatter and add a News Object to the ManyToOne relation I get the following error. Could you please take a look at this? TIA

Status: 500 | Internal Server Error URL: /admin/element/get-nice-path Method: POST Message: Warning: Undefined array key "fullpath" Trace: in /var/www/html/src/Website/PathFormatter/TheFormatter.php:29 #0 /var/www/html/dev/pimcore/admin-ui-classic-bundle/src/Controller/Admin/ElementController.php(915): App\Website\PathFormatter\TheFormatter->formatPath(Array, Object(Pimcore\Model\DataObject\Rel), Array, Array) #1 /var/www/html/dev/pimcore/admin-ui-classic-bundle/src/Controller/Admin/ElementController.php(539): Pimcore\Bundle\AdminBundle\Controller\Admin\ElementController->convertResultWithPathFormatter(Object(Pimcore\Model\DataObject\Rel), Array, Array, Array) #2 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(181): Pimcore\Bundle\AdminBundle\Controller\Admin\ElementController->getNicePathAction(Object(Symfony\Component\HttpFoundation\Request)) #3 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #4 /var/www/html/vendor/symfony/http-kernel/Kernel.php(197): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #5 /var/www/html/vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php(35): Symfony\Component\HttpKernel\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #6 /var/www/html/vendor/autoload_runtime.php(29): Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run() #7 /var/www/html/public/index.php(20): require_once('/var/www/html/v...') #8 {main}

@blankse
Copy link
Contributor Author

blankse commented Sep 13, 2024

@robertSt7 See pimcore/pimcore#17412

Did you really use the latest example? The example formatter should use "path" (correct for ManyToOne) and "fullpath" array keys (correct for ManyToMany).

@robertSt7
Copy link
Contributor

@blankse Yes I do and I am also don't know why there is no path or fullpath.

image

@blankse
Copy link
Contributor Author

blankse commented Sep 16, 2024

@robertSt7 Only in the display mode 'combo,' the array key 'path' was missing. I have added it. Could you please test it again?

Copy link

sonarcloud bot commented Sep 16, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

@robertSt7 robertSt7 added this to the 1.5.5 milestone Sep 17, 2024
@robertSt7 robertSt7 merged commit 45e3504 into pimcore:1.5 Sep 17, 2024
10 of 11 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Sep 17, 2024
@robertSt7
Copy link
Contributor

@blankse Thanks a lot for all your contributions

@blankse blankse deleted the patch-1 branch September 17, 2024 08:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants