Skip to content

Commit 7136b9c

Browse files
committed
Merge remote-tracking branch 'origin/3.3' into 3.4
2 parents 4873d04 + 76df151 commit 7136b9c

File tree

5 files changed

+25
-12
lines changed

5 files changed

+25
-12
lines changed

src/Controller/Admin/SegmentAssignmentController.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,17 @@ public static function getSubscribedServices()
5050
*/
5151
public function inheritableSegments(Request $request, SegmentManagerInterface $segmentManager)
5252
{
53-
$id = $request->get('id') ?? '';
54-
$type = $request->get('type') ?? '';
53+
$id = $request->get('id');
54+
$type = $request->get('type');
55+
if (!$type || !$id) {
56+
return $this->adminJson(['data' => []]);
57+
}
5558

5659
$db = \Pimcore\Db::get();
57-
$parentIdStatement = sprintf('SELECT `%s` FROM `%s` WHERE `%s` = :value', $type === 'object' ? 'o_parentId' : 'parentId', $type.'s', $type === 'object' ? 'o_id' : 'id');
60+
$parentIdStatement = sprintf('SELECT :parentIdField FROM %s WHERE :idField = :value', $db->quoteIdentifier($type . 's'));
5861
$parentId = $db->fetchOne($parentIdStatement, [
62+
'parentIdField' => $type === 'object' ? 'o_parentId' : 'parentId',
63+
'idField' => $type === 'object' ? 'o_id' : 'id',
5964
'value' => $id
6065
]);
6166

src/CustomerList/Exporter/AbstractExporter.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use CustomerManagementFrameworkBundle\Model\CustomerInterface;
1919
use Pimcore\Model\DataObject\ClassDefinition;
2020
use Pimcore\Model\DataObject\Listing\Concrete;
21+
use Pimcore\Model\Element\Service;
2122

2223
abstract class AbstractExporter implements ExporterInterface
2324
{
@@ -149,6 +150,8 @@ public function getExportData()
149150
}
150151
}
151152

153+
$row[self::COLUMNS] = Service::escapeCsvRecord($row[self::COLUMNS]);
154+
$row[self::SEGMENT_IDS] = Service::escapeCsvRecord($row[self::SEGMENT_IDS]);
152155
$rows[] = $row;
153156
}
154157

src/CustomerView/DefaultCustomerView.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function getDetailviewData(CustomerInterface $customer)
110110
$vf = $this->viewFormatter;
111111

112112
foreach ($definition->getFieldDefinitions() as $fd) {
113-
if ($fd->getInvisible()) {
113+
if ($fd->getInvisible() || $fd->getFieldtype() === 'password') {
114114
continue;
115115
}
116116

src/Model/ActivityList/DefaultMariaDbActivityList.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
namespace CustomerManagementFrameworkBundle\Model\ActivityList;
1717

18-
use CustomerManagementFrameworkBundle\Model\ActivityInterface;
1918
use CustomerManagementFrameworkBundle\Model\ActivityList\DefaultMariaDbActivityList\MariaDbDao;
2019
use CustomerManagementFrameworkBundle\Model\ActivityStoreEntry\ActivityStoreEntryInterface;
2120
use Pimcore\Model\Listing\AbstractListing;
@@ -38,7 +37,7 @@ class DefaultMariaDbActivityList extends AbstractListing implements ActivityList
3837
protected $totalCount = null;
3938

4039
/**
41-
* @var null|ActivityInterface[]
40+
* @var null|ActivityStoreEntryInterface[]
4241
*/
4342
protected $activities = null;
4443

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

54+
/**
55+
* @return ActivityStoreEntryInterface[]
56+
*/
5557
public function getActivities()
5658
{
5759
if ($this->activities === null) {
@@ -116,7 +118,7 @@ public function getOffset()
116118
* @param int $offset Page offset
117119
* @param int $itemCountPerPage Number of items per page
118120
*
119-
* @return array
121+
* @return ActivityStoreEntryInterface[]
120122
*/
121123
public function getItems($offset, $itemCountPerPage)
122124
{
@@ -148,10 +150,10 @@ public function getPaginatorAdapter()
148150
}
149151

150152
/**
151-
* @return ActivityInterface|false
153+
* @return ActivityStoreEntryInterface|false
152154
*/
153155
#[\ReturnTypeWillChange]
154-
public function current()/* : ActivityInterface|false */
156+
public function current()/* : ActivityStoreEntryInterface|false */
155157
{
156158
$this->getActivities();
157159

src/Resources/public/js/config/conditions.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,8 @@ pimcore.plugin.cmf.rule.conditions.CountActivities = Class.create(pimcore.plugin
221221
xtype: "numberfield",
222222
name: "count",
223223
width: 90,
224-
value: this.options.count
224+
value: this.options.count,
225+
minValue: 0
225226
}
226227
]
227228
}
@@ -452,7 +453,8 @@ pimcore.plugin.cmf.rule.conditions.CountTrackedSegment = Class.create(pimcore.pl
452453
//xtype: "numberfield",
453454
name: "count",
454455
width: 90,
455-
value: this.options.count
456+
value: this.options.count,
457+
minValue: 0
456458
});
457459

458460
return [
@@ -531,7 +533,8 @@ pimcore.plugin.cmf.rule.conditions.CountTargetGroupWeight = Class.create(pimcore
531533
xtype: "numberfield",
532534
name: "count",
533535
width: 90,
534-
value: this.options.count
536+
value: this.options.count,
537+
minValue: 0
535538
}
536539
]
537540
},

0 commit comments

Comments
 (0)