Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
e4797d6
fix(DynamicContentSubscriber): complete Mautic 5 migration of filter …
edouard-mangel Mar 9, 2026
c2f6d62
refactor(ContactFilterMatcher): remove class_alias pattern, use polyf…
edouard-mangel Mar 9, 2026
b469191
refactor(config): remove explicit service definitions, use autowiring
edouard-mangel Mar 10, 2026
bcc4613
test(ContactFilterMatcher): add unit tests
edouard-mangel Mar 11, 2026
57fc84b
fix(ContactFilterMatcher): replace deprecated DBAL execute() with exe…
edouard-mangel Mar 11, 2026
8bcef9f
fix(MatchFilterForLeadTrait): handle empty operator when no custom it…
edouard-mangel Mar 11, 2026
3bd43b4
fix(ContactFilterMatcher): replace #[Autowire] with explicit arg bind…
edouard-mangel Mar 11, 2026
cd38ae9
fix(cs): remove extra blank line, extra parentheses, and PHP 8.1 inte…
edouard-mangel Mar 11, 2026
ca83550
fix(tests): remove MAUTIC_TABLE_PREFIX define from test file (defined…
edouard-mangel Mar 11, 2026
4933a21
fix(phpstan): add baseline entry for transformFilterDataForLeadPolyfi…
edouard-mangel Mar 11, 2026
d73a554
refactor: apply Rector rules (constructor promotion, str_starts_with,…
edouard-mangel Mar 11, 2026
1be1b9d
fix(phpstan): suppress array element type errors for transformFilterD…
edouard-mangel Mar 11, 2026
7b6e76e
ci: update workflow to test against PHP 8.2 and Mautic 6.x
edouard-mangel Mar 11, 2026
56413fe
ci: add fix/** branch trigger and workflow_dispatch for local testing
edouard-mangel Mar 11, 2026
fbef424
fix(services): use #[Autowire] for leadCustomItemFetchLimit on Mautic 6
edouard-mangel Mar 11, 2026
8175837
fix(cs): apply PHP CS Fixer rules for Mautic 6 compatibility
edouard-mangel Mar 11, 2026
0bcae28
fix(phpstan): remove checkGenericClassInNonGenericObjectType (removed…
edouard-mangel Mar 11, 2026
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
6 changes: 4 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ on:
- '[0-9]+\.[0-9]+'
- development
- beta
- 'fix/**'
pull_request:
workflow_dispatch:

env:
PLUGIN_DIR: plugins/CustomObjectsBundle # Same as extra.install-directory-name in composer.json
Expand All @@ -18,9 +20,9 @@ jobs:

strategy:
matrix:
php-versions: ['8.0'] # The supported PHP versions
php-versions: ['8.2'] # The supported PHP versions
db-types: ['mysql'] # can be: ['mysql', 'mariadb'] but not necessary for this plugin that does not add any DB schema
mautic-versions: ['5.1'] # The supported Mautic versions
mautic-versions: ['6.x'] # The supported Mautic versions

name: Tests on PHP ${{ matrix.php-versions }}, ${{ matrix.db-types }}, Mautic ${{ matrix.mautic-versions }}

Expand Down
2 changes: 1 addition & 1 deletion Command/CustomItemsScheduledExportCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class CustomItemsScheduledExportCommand extends Command
public function __construct(
private CustomItemExportSchedulerModel $customItemExportSchedulerModel,
private EventDispatcherInterface $eventDispatcher,
private FormatterHelper $formatterHelper
private FormatterHelper $formatterHelper,
) {
parent::__construct();
}
Expand Down
2 changes: 1 addition & 1 deletion Command/GenerateSampleDataCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class GenerateSampleDataCommand extends Command

public function __construct(
private EntityManager $entityManager,
private RandomHelper $randomHelper
private RandomHelper $randomHelper,
) {
parent::__construct();

Expand Down
3 changes: 2 additions & 1 deletion Config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,7 @@
'custom_object.helper.token_formatter' => [
'class' => MauticPlugin\CustomObjectsBundle\Helper\TokenFormatter::class,
],

'custom_object.data_persister.custom_item' => [
'class' => MauticPlugin\CustomObjectsBundle\DataPersister\CustomItemDataPersister::class,
'tag' => 'api_platform.data_persister',
Expand All @@ -643,7 +644,7 @@
],
],
'custom_object.helper.contact_filter_matcher' => [
'class' => \MauticPlugin\CustomObjectsBundle\Helper\ContactFilterMatcher::class,
'class' => MauticPlugin\CustomObjectsBundle\Helper\ContactFilterMatcher::class,
'arguments' => [
'mautic.custom.model.field',
'mautic.custom.model.object',
Expand Down
2 changes: 2 additions & 0 deletions Config/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
'Report/ReportColumnsBuilder.php',
'Serializer/ApiNormalizer.php',
'Extension/CustomItemListeningExtension.php',
// Registered explicitly in config.php with a non-autowirable int argument
'Helper/ContactFilterMatcher.php',
];

$services->load('MauticPlugin\\CustomObjectsBundle\\', '../')
Expand Down
2 changes: 1 addition & 1 deletion Controller/CustomField/FormController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function renderFormAction(
CustomFieldPermissionProvider $permissionProvider,
CustomFieldRouteProvider $fieldRouteProvider,
CustomObjectModel $customObjectModel,
CustomObjectRouteProvider $objectRouteProvider
CustomObjectRouteProvider $objectRouteProvider,
): Response {
$request = $this->getCurrentRequest();
$objectId = (int) $request->get('objectId');
Expand Down
4 changes: 2 additions & 2 deletions Controller/CustomField/SaveController.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function saveAction(
CustomFieldFactory $customFieldFactory,
CustomFieldPermissionProvider $permissionProvider,
CustomFieldRouteProvider $fieldRouteProvider,
CustomObjectModel $customObjectModel
CustomObjectModel $customObjectModel,
) {
$request = $this->getCurrentRequest();

Expand Down Expand Up @@ -111,7 +111,7 @@ private function buildSuccessForm(
CustomField $customField,
Request $request,
CustomFieldModel $customFieldModel,
FormFactoryInterface $formFactory
FormFactoryInterface $formFactory,
): JsonResponse {
$panelId = is_numeric($request->get('panelId')) ? (int) $request->get('panelId') : null; // Is edit of existing panel in view

Expand Down
2 changes: 1 addition & 1 deletion Controller/CustomItem/BatchDeleteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function deleteAction(
CustomItemPermissionProvider $permissionProvider,
CustomItemRouteProvider $routeProvider,
FlashBag $flashBag,
int $objectId
int $objectId,
): Response {
$request = $this->getCurrentRequest();

Expand Down
2 changes: 1 addition & 1 deletion Controller/CustomItem/CancelController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function cancelAction(
CustomItemRouteProvider $routeProvider,
CustomItemModel $customItemModel,
int $objectId,
?int $itemId = null
?int $itemId = null,
): Response {
$page = $sessionProviderFactory->createItemProvider($objectId)->getPage();

Expand Down
2 changes: 1 addition & 1 deletion Controller/CustomItem/ContactListController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function listAction(
Request $request,
PageHelperFactoryInterface $pageHelperFactory,
int $objectId,
int $page = 1
int $page = 1,
): Response {
return $this->generateContactsGrid(
$request,
Expand Down
2 changes: 1 addition & 1 deletion Controller/CustomItem/DeleteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function deleteAction(
CustomItemPermissionProvider $permissionProvider,
CustomItemRouteProvider $routeProvider,
int $objectId,
int $itemId
int $itemId,
): Response {
try {
$customItem = $customItemModel->fetchEntity($itemId);
Expand Down
2 changes: 1 addition & 1 deletion Controller/CustomItem/ExportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ExportController extends AbstractFormController
public function exportAction(
CustomItemPermissionProvider $permissionProvider,
CustomItemExportSchedulerModel $model,
int $object
int $object,
): Response {
$permissionProvider->canCreate($object);

Expand Down
16 changes: 8 additions & 8 deletions Controller/CustomItem/FormController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function newAction(
CustomItemModel $customItemModel,
CustomObjectModel $customObjectModel,
CustomItemPermissionProvider $permissionProvider,
int $objectId
int $objectId,
): Response {
try {
$customItem = $this->performNewAction($customObjectModel, $customItemModel, $permissionProvider, $objectId);
Expand All @@ -48,7 +48,7 @@ public function newWithRedirectToContactAction(
CustomObjectModel $customObjectModel,
CustomItemPermissionProvider $permissionProvider,
int $objectId,
int $contactId
int $contactId,
): Response {
try {
$customItem = $this->performNewAction($customObjectModel, $customItemModel, $permissionProvider, $objectId);
Expand Down Expand Up @@ -77,7 +77,7 @@ private function performNewAction(
CustomObjectModel $customObjectModel,
CustomItemModel $customItemModel,
CustomItemPermissionProvider $permissionProvider,
int $objectId
int $objectId,
): CustomItem {
$permissionProvider->canCreate($objectId);

Expand All @@ -95,7 +95,7 @@ public function editAction(
LockFlashMessageHelper $lockFlashMessageHelper,
CustomItemPermissionProvider $permissionProvider,
int $objectId,
int $itemId
int $itemId,
): Response {
try {
$customItem = $this->performEditAction($customItemModel, $permissionProvider, $itemId);
Expand Down Expand Up @@ -134,7 +134,7 @@ public function editWithRedirectToContactAction(
CustomItemPermissionProvider $permissionProvider,
int $objectId,
int $itemId,
int $contactId
int $contactId,
): Response {
try {
$customItem = $this->performEditAction($customItemModel, $permissionProvider, $itemId);
Expand Down Expand Up @@ -180,7 +180,7 @@ public function cloneAction(
CustomItemModel $customItemModel,
CustomItemPermissionProvider $permissionProvider,
int $objectId,
int $itemId
int $itemId,
): Response {
try {
$customItem = clone $customItemModel->fetchEntity($itemId);
Expand All @@ -204,7 +204,7 @@ public function cloneAction(
private function performEditAction(
CustomItemModel $customItemModel,
CustomItemPermissionProvider $permissionProvider,
int $itemId
int $itemId,
): CustomItem {
$customItem = $customItemModel->fetchEntity($itemId);
$permissionProvider->canEdit($customItem);
Expand All @@ -217,7 +217,7 @@ private function renderFormForItem(
CustomItemRouteProvider $routeProvider,
CustomItem $customItem,
string $route,
?int $contactId = null
?int $contactId = null,
): Response {
$action = $routeProvider->buildSaveRoute($customItem->getCustomObject()->getId(), $customItem->getId());
$options = [
Expand Down
2 changes: 1 addition & 1 deletion Controller/CustomItem/LinkController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function saveAction(
FlashBag $flashBag,
int $itemId,
string $entityType,
int $entityId
int $entityId,
): JsonResponse {
try {
$customItem = $customItemModel->fetchEntity($itemId);
Expand Down
6 changes: 3 additions & 3 deletions Controller/CustomItem/LinkFormController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function formAction(
FlashBag $flashBag,
int $itemId,
string $entityType,
int $entityId
int $entityId,
): Response {
try {
$customItem = $customItemModel->fetchEntity($itemId);
Expand Down Expand Up @@ -93,7 +93,7 @@ public function saveAction(
FlashBag $flashBag,
int $itemId,
string $entityType,
int $entityId
int $entityId,
): Response {
$relationshipItem = null;
$relationshipObject = null;
Expand Down Expand Up @@ -164,7 +164,7 @@ protected function getRelationshipItem(
CustomObject $relationshipObject,
CustomItem $customItem,
string $entityType,
int $entityId
int $entityId,
): CustomItem {
/** @var CustomItemXrefCustomItem|null $relationshipItemXref */
$relationshipItemXref = $customItem->getCustomItemLowerReferences()
Expand Down
2 changes: 1 addition & 1 deletion Controller/CustomItem/ListController.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function listAction(
CustomItemPermissionProvider $permissionProvider,
CustomItemRouteProvider $routeProvider,
int $objectId,
int $page = 1
int $page = 1,
): Response {
$request = $this->getCurrentRequest();

Expand Down
2 changes: 1 addition & 1 deletion Controller/CustomItem/LookupController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function listAction(
CustomItemModel $customItemModel,
CustomItemPermissionProvider $permissionProvider,
FlashBag $flashBag,
int $objectId
int $objectId,
): JsonResponse {
try {
$permissionProvider->canViewAtAll($objectId);
Expand Down
2 changes: 1 addition & 1 deletion Controller/CustomItem/SaveController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function saveAction(
CustomItemRouteProvider $routeProvider,
LockFlashMessageHelper $lockFlashMessageHelper,
int $objectId,
?int $itemId = null
?int $itemId = null,
): Response {
$request = $this->getCurrentRequest();

Expand Down
2 changes: 1 addition & 1 deletion Controller/CustomItem/UnlinkController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function saveAction(
FlashBag $flashBag,
int $itemId,
string $entityType,
int $entityId
int $entityId,
): JsonResponse {
try {
$customItem = $customItemModel->fetchEntity($itemId);
Expand Down
2 changes: 1 addition & 1 deletion Controller/CustomItem/ViewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function viewAction(
CustomItemPermissionProvider $permissionProvider,
CustomItemRouteProvider $routeProvider,
int $objectId,
int $itemId
int $itemId,
): Response {
$request = $this->getCurrentRequest();

Expand Down
2 changes: 1 addition & 1 deletion Controller/CustomObject/CancelController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function cancelAction(
SessionProviderFactory $sessionProviderFactory,
CustomObjectRouteProvider $routeProvider,
CustomObjectModel $customObjectModel,
?int $objectId
?int $objectId,
): Response {
$page = $sessionProviderFactory->createObjectProvider()->getPage();

Expand Down
2 changes: 1 addition & 1 deletion Controller/CustomObject/DeleteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function deleteAction(
FlashBag $flashBag,
CustomObjectPermissionProvider $permissionProvider,
EventDispatcherInterface $eventDispatcher,
int $objectId
int $objectId,
): Response {
$controller = 'MauticPlugin\CustomObjectsBundle\Controller\CustomObject\ListController:listAction';
$page = [
Expand Down
8 changes: 4 additions & 4 deletions Controller/CustomObject/FormController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function newAction(
FormFactoryInterface $formFactory,
CustomObjectRouteProvider $routeProvider,
CustomFieldTypeProvider $customFieldTypeProvider,
CustomFieldModel $customFieldModel
CustomFieldModel $customFieldModel,
): Response {
try {
$permissionProvider->canCreate();
Expand All @@ -52,7 +52,7 @@ public function editAction(
CustomObjectRouteProvider $routeProvider,
CustomFieldTypeProvider $customFieldTypeProvider,
CustomFieldModel $customFieldModel,
int $objectId
int $objectId,
): Response {
try {
$customObject = $customObjectModel->fetchEntity($objectId);
Expand Down Expand Up @@ -93,7 +93,7 @@ public function cloneAction(
CustomObjectRouteProvider $routeProvider,
CustomFieldTypeProvider $customFieldTypeProvider,
CustomFieldModel $customFieldModel,
int $objectId
int $objectId,
): Response {
try {
$customObject = clone $customObjectModel->fetchEntity($objectId);
Expand All @@ -120,7 +120,7 @@ private function renderFormForObject(
CustomFieldTypeProvider $customFieldTypeProvider,
CustomFieldModel $customFieldModel,
CustomObject $customObject,
string $route
string $route,
): Response {
$form = $formFactory->create(
CustomObjectType::class,
Expand Down
2 changes: 1 addition & 1 deletion Controller/CustomObject/ListController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function listAction(
CustomObjectModel $customObjectModel,
CustomObjectPermissionProvider $permissionProvider,
CustomObjectRouteProvider $routeProvider,
int $page = 1
int $page = 1,
): Response {
$request = $this->getCurrentRequest();

Expand Down
4 changes: 2 additions & 2 deletions Controller/CustomObject/SaveController.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function saveAction(
ParamsToStringTransformer $paramsToStringTransformer,
OptionsToStringTransformer $optionsToStringTransformer,
LockFlashMessageHelper $lockFlashMessageHelper,
?int $objectId = null
?int $objectId = null,
): Response {
$request = $this->getCurrentRequest();

Expand Down Expand Up @@ -133,7 +133,7 @@ private function handleRawPost(
ParamsToStringTransformer $paramsToStringTransformer,
OptionsToStringTransformer $optionsToStringTransformer,
CustomObject $customObject,
array $rawCustomObject
array $rawCustomObject,
): void {
if (empty($rawCustomObject['customFields'])) {
return;
Expand Down
2 changes: 1 addition & 1 deletion Controller/CustomObject/ViewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function viewAction(
AuditLogModel $auditLogModel,
CustomObjectPermissionProvider $permissionProvider,
CustomObjectRouteProvider $routeProvider,
int $objectId
int $objectId,
): Response {
$request = $this->getCurrentRequest();

Expand Down
2 changes: 1 addition & 1 deletion CustomFieldType/AbstractCustomFieldType.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ abstract class AbstractCustomFieldType implements CustomFieldTypeInterface, \Str

public function __construct(
protected TranslatorInterface $translator,
protected FilterOperatorProviderInterface $filterOperatorProvider
protected FilterOperatorProviderInterface $filterOperatorProvider,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion CustomFieldType/AbstractMultivalueType.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ abstract class AbstractMultivalueType extends AbstractCustomFieldType
public function __construct(
TranslatorInterface $translator,
FilterOperatorProviderInterface $filterOperatorProvider,
private CsvHelper $csvHelper
private CsvHelper $csvHelper,
) {
parent::__construct($translator, $filterOperatorProvider);
}
Expand Down
Loading
Loading