Skip to content

Commit

Permalink
adding-object-to-the-clipboard
Browse files Browse the repository at this point in the history
  • Loading branch information
kkirsz committed Feb 22, 2018
1 parent b4f2af0 commit 357a0b6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/Controller/DataObjectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ public function getClipboardAction(Request $request, ClipboardService $clipboard

$objectData['general'] = [];
$objectData['idPath'] = Element\Service::getIdPath($object);
$allowedKeys = ['o_published', 'o_key', 'o_id', 'o_type', 'o_path', 'o_modificationDate', 'o_creationDate', 'o_userOwner', 'o_userModification'];
$allowedKeys = ['o_published', 'o_key', 'o_id', 'o_type', 'o_path', 'o_modificationDate',
'o_creationDate', 'o_userOwner', 'o_userModification'];
foreach (get_object_vars($object) as $key => $value) {
if (strstr($key, 'o_') && in_array($key, $allowedKeys)) {
$objectData['general'][$key] = $value;
Expand All @@ -54,7 +55,8 @@ public function getClipboardAction(Request $request, ClipboardService $clipboard
$objectData['classes'] = $this->prepareChildClasses($clipboardService->getClasses());

// grid-config
$configFile = PIMCORE_CONFIGURATION_DIRECTORY . '/object/grid/' . $object->getId() . '-user_' . $this->getAdminUser()->getId() . '.psf';
$configFile = PIMCORE_CONFIGURATION_DIRECTORY . '/object/grid/'
. $object->getId() . '-user_' . $this->getAdminUser()->getId() . '.psf';
if (is_file($configFile)) {
$gridConfig = Tool\Serialize::unserialize(file_get_contents($configFile));
if ($gridConfig) {
Expand Down
5 changes: 4 additions & 1 deletion src/Controller/DataObjectHelperController.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ public function getClipboardBatchJobsAction(Request $request, ClipboardService $
$folder = DataObject::getById($request->get('folderId'));
$class = DataObject\ClassDefinition::getById($request->get('classId'));

$conditionFilters = ["(o_path = ? OR o_path LIKE '" . str_replace('//', '/', $folder->getRealFullPath() . '/') . "%')"];
$conditionFilters = "(o_path = ? OR o_path LIKE '"
. str_replace('//', '/', $folder->getRealFullPath() . '/')
. "%')";
$conditionFilters = [$conditionFilters];

if ($request->get('filter')) {
$conditionFilters[] = DataObject\Service::getFilterCondition($request->get('filter'), $class);
Expand Down

0 comments on commit 357a0b6

Please sign in to comment.