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: Pimcore 11 compat #399

Merged
merged 4 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/DataDefinitionsBundle/Fetcher/ObjectsFetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
namespace Wvision\Bundle\DataDefinitionsBundle\Fetcher;

use InvalidArgumentException;
use Pimcore\Model\DataObject\AbstractObject;
use Pimcore\Model\DataObject\ClassDefinition;
use Pimcore\Model\DataObject\Concrete;
use Pimcore\Model\DataObject\Listing;
use Wvision\Bundle\DataDefinitionsBundle\Context\FetcherContextInterface;
use Wvision\Bundle\DataDefinitionsBundle\Model\ExportDefinitionInterface;
Expand Down Expand Up @@ -60,12 +60,12 @@ private function getClassListing(ExportDefinitionInterface $definition, array $p
$rootNode = null;
$conditionFilters = [];
if (isset($params['root'])) {
$rootNode = Concrete::getById($params['root']);
$rootNode = AbstractObject::getById($params['root']);

if (null !== $rootNode) {
$quotedPath = $list->quote($rootNode->getRealFullPath());
$quotedWildcardPath = $list->quote(str_replace('//', '/', $rootNode->getRealFullPath().'/').'%');
$conditionFilters[] = '(o_path = '.$quotedPath.' OR o_path LIKE '.$quotedWildcardPath.')';
$conditionFilters[] = '(path = '.$quotedPath.' OR path LIKE '.$quotedWildcardPath.')';
}
}

Expand All @@ -79,7 +79,7 @@ private function getClassListing(ExportDefinitionInterface $definition, array $p
}

if (isset($params['only_direct_children']) && $params['only_direct_children'] == 'true' && null !== $rootNode) {
$conditionFilters[] = 'o_parentId = '.$rootNode->getId();
$conditionFilters[] = 'parentId = '.$rootNode->getId();
}

if (isset($params['condition'])) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ document.addEventListener(pimcore.events.prepareObjectTreeContextMenu, function
}

const tree = event.detail.menu;
const item = event.detail.object;

Ext.create('Ext.data.Store', {
model: 'Executable',
Expand Down Expand Up @@ -36,13 +37,13 @@ document.addEventListener(pimcore.events.prepareObjectTreeContextMenu, function
exportMenu.push({
text: executable.get('name'),
iconCls: "pimcore_icon_object pimcore_icon_overlay_add",
handler: function (menuItem) {
handler: function () {
Ext.Ajax.request({
url: '/admin/process_manager/executables/run',
params: {
id: executable.id,
startupConfig: Ext.encode({
root: menuItem.$iid,
root: item.get('id'),
}),
csrfToken: pimcore.settings['csrfToken']
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ pimcore.object.search = Class.create(pimcore.object.search, {
root: this.object.id,
query: this.searchField.getValue(),
only_direct_children: this.checkboxOnlyDirectChildren.getValue(),
condition: this.sqlEditor.getValue(),
ids: ids,
}),
csrfToken: pimcore.settings['csrfToken']
Expand Down
Loading