Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/3.3' into 3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
dvesh3 committed May 16, 2023
2 parents 4873d04 + 76df151 commit 7136b9c
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 12 deletions.
11 changes: 8 additions & 3 deletions src/Controller/Admin/SegmentAssignmentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,17 @@ public static function getSubscribedServices()
*/
public function inheritableSegments(Request $request, SegmentManagerInterface $segmentManager)
{
$id = $request->get('id') ?? '';
$type = $request->get('type') ?? '';
$id = $request->get('id');
$type = $request->get('type');
if (!$type || !$id) {
return $this->adminJson(['data' => []]);
}

$db = \Pimcore\Db::get();
$parentIdStatement = sprintf('SELECT `%s` FROM `%s` WHERE `%s` = :value', $type === 'object' ? 'o_parentId' : 'parentId', $type.'s', $type === 'object' ? 'o_id' : 'id');
$parentIdStatement = sprintf('SELECT :parentIdField FROM %s WHERE :idField = :value', $db->quoteIdentifier($type . 's'));
$parentId = $db->fetchOne($parentIdStatement, [
'parentIdField' => $type === 'object' ? 'o_parentId' : 'parentId',
'idField' => $type === 'object' ? 'o_id' : 'id',
'value' => $id
]);

Expand Down
3 changes: 3 additions & 0 deletions src/CustomerList/Exporter/AbstractExporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use CustomerManagementFrameworkBundle\Model\CustomerInterface;
use Pimcore\Model\DataObject\ClassDefinition;
use Pimcore\Model\DataObject\Listing\Concrete;
use Pimcore\Model\Element\Service;

abstract class AbstractExporter implements ExporterInterface
{
Expand Down Expand Up @@ -149,6 +150,8 @@ public function getExportData()
}
}

$row[self::COLUMNS] = Service::escapeCsvRecord($row[self::COLUMNS]);
$row[self::SEGMENT_IDS] = Service::escapeCsvRecord($row[self::SEGMENT_IDS]);
$rows[] = $row;
}

Expand Down
2 changes: 1 addition & 1 deletion src/CustomerView/DefaultCustomerView.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function getDetailviewData(CustomerInterface $customer)
$vf = $this->viewFormatter;

foreach ($definition->getFieldDefinitions() as $fd) {
if ($fd->getInvisible()) {
if ($fd->getInvisible() || $fd->getFieldtype() === 'password') {
continue;
}

Expand Down
12 changes: 7 additions & 5 deletions src/Model/ActivityList/DefaultMariaDbActivityList.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

namespace CustomerManagementFrameworkBundle\Model\ActivityList;

use CustomerManagementFrameworkBundle\Model\ActivityInterface;
use CustomerManagementFrameworkBundle\Model\ActivityList\DefaultMariaDbActivityList\MariaDbDao;
use CustomerManagementFrameworkBundle\Model\ActivityStoreEntry\ActivityStoreEntryInterface;
use Pimcore\Model\Listing\AbstractListing;
Expand All @@ -38,7 +37,7 @@ class DefaultMariaDbActivityList extends AbstractListing implements ActivityList
protected $totalCount = null;

/**
* @var null|ActivityInterface[]
* @var null|ActivityStoreEntryInterface[]
*/
protected $activities = null;

Expand All @@ -52,6 +51,9 @@ public function __construct()
$this->dao = new MariaDbDao($this);
}

/**
* @return ActivityStoreEntryInterface[]
*/
public function getActivities()
{
if ($this->activities === null) {
Expand Down Expand Up @@ -116,7 +118,7 @@ public function getOffset()
* @param int $offset Page offset
* @param int $itemCountPerPage Number of items per page
*
* @return array
* @return ActivityStoreEntryInterface[]
*/
public function getItems($offset, $itemCountPerPage)
{
Expand Down Expand Up @@ -148,10 +150,10 @@ public function getPaginatorAdapter()
}

/**
* @return ActivityInterface|false
* @return ActivityStoreEntryInterface|false
*/
#[\ReturnTypeWillChange]
public function current()/* : ActivityInterface|false */
public function current()/* : ActivityStoreEntryInterface|false */
{
$this->getActivities();

Expand Down
9 changes: 6 additions & 3 deletions src/Resources/public/js/config/conditions.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ pimcore.plugin.cmf.rule.conditions.CountActivities = Class.create(pimcore.plugin
xtype: "numberfield",
name: "count",
width: 90,
value: this.options.count
value: this.options.count,
minValue: 0
}
]
}
Expand Down Expand Up @@ -452,7 +453,8 @@ pimcore.plugin.cmf.rule.conditions.CountTrackedSegment = Class.create(pimcore.pl
//xtype: "numberfield",
name: "count",
width: 90,
value: this.options.count
value: this.options.count,
minValue: 0
});

return [
Expand Down Expand Up @@ -531,7 +533,8 @@ pimcore.plugin.cmf.rule.conditions.CountTargetGroupWeight = Class.create(pimcore
xtype: "numberfield",
name: "count",
width: 90,
value: this.options.count
value: this.options.count,
minValue: 0
}
]
},
Expand Down

0 comments on commit 7136b9c

Please sign in to comment.