Skip to content

Commit

Permalink
[Locate in Tree] Tree paging limit fallback seems to not work (#857)
Browse files Browse the repository at this point in the history
* use core element type for settings

* widget element type is data-object
  • Loading branch information
lukmzig authored Feb 28, 2025
1 parent f7ab99b commit 86f810f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/DataIndex/Query/TreeQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private function getQueryParameters(
$rootPath = null;
}

if ($widget->getElementType() === ElementTypes::TYPE_OBJECT) {
if ($widget->getElementType() === ElementTypes::TYPE_DATA_OBJECT) {
try {
return new DataObjectParameters(
pageSize: $pageSize,
Expand Down
4 changes: 4 additions & 0 deletions src/Setting/Service/SettingsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
namespace Pimcore\Bundle\StudioBackendBundle\Setting\Service;

use Pimcore\Bundle\StudioBackendBundle\Exception\Api\InvalidElementTypeException;
use Pimcore\Bundle\StudioBackendBundle\Util\Trait\ElementProviderTrait;
use function array_key_exists;
use function sprintf;

Expand All @@ -25,6 +26,8 @@
*/
final readonly class SettingsService implements SettingsServiceInterface
{
use ElementProviderTrait;

public function __construct(
private SettingProviderLoaderInterface $settingProviderLoader
) {
Expand All @@ -49,6 +52,7 @@ public function getSettings(): array
public function getTreePageSize(string $elementType): int
{
$settings = $this->getSettings();
$elementType = $this->getCoreElementType($elementType);
$settingKey = $elementType . '_tree_paging_limit';
if (!array_key_exists($settingKey, $settings)) {
throw new InvalidElementTypeException(
Expand Down

0 comments on commit 86f810f

Please sign in to comment.