refactor(naming): normalise the Smart Links domain to the bundle's canonical names (0.18.1)
One bundle, two domains (Marketing Programs and Smart Links), one naming scheme.\nNothing in the database changed (no tables, columns, URLs or stored data);\nthe runtime was rebuilt and verified live.\n\n- Route names mautic_smartlinks_* -> mt3s_smartlinks_* (paths unchanged);\n the menu ids follow\n- Model service aliases collapsed to one canonical alias per model:\n mautic.mt3smarketingprogram.model.<entity> (core's mautic.<x>.model.<x>\n pattern), so getModel('mt3smarketingprogram.smart_link'); the dead\n mt3s.* and mautic.mt3smp.*-era aliases are gone\n- Translation keys mautic.smartlinks.* -> mt3s.smart_links.*\n (mautic.config.tab.smartlinksconfig stays: core derives it)\n- Settings parameters smartlinks_utm_config/smartlinks_config ->\n mt3s_smart_links_utm_config/mt3s_smart_links_config, with both legacy\n keys (smartlinks_* of the standalone bundle, utm_manager_* of the\n UtmManagerBundle era) still readable until the settings are saved again\n- JS loader prefixes smartlinksSmartLink/smartlinksUtmTaxonomy ->\n mt3sMpSmartLink/mt3sMpUtmTaxonomy (the mt3sMp* family of the program\n domain)\n- Integration/Support/ConfigSupport -> SmartlinksConfigSupport; integration\n display names aligned ('MT3S Marketing Program' / 'Smart Links'); the\n dead mautic.plugin.smartlinks.name catalog keys removed\n- phpunit suite renamed UtmManagerBundle -> MT3SMarketingProgramBundle;\n version 0.18.1\n\nVerified: full php -l, 90/90 unit tests (phpunit 11.5 phar), cache clear +\nwarm + assets regenerate + plugins reload (as www-data), live: both lists\nand forms (mauticContent mt3sMpSmartLink/mt3sMpUtmTaxonomy), both config\ntabs, the menu labels, the program pages (regression), the public /l/y32b\nredirect through the legacy utm_manager_* settings (302 with the taxonomy's\nUTM values, wrong host and unknown slug 404), all ini catalogs parse, zero\nnew log errors.
This commit is contained in:
1 parent
dce849610c
commit
9d81d6c815
53 files changed
+777
-751
No files matched your search
@@ -14,7 +14,7 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
* link to them from their Audiences tab (ProgramAudience carries the audience's priority in that
|
||||
* program).
|
||||
*
|
||||
* Model mt3smp.audience (mt3s.marketing_program.model.audience), permission base mt3smarketingprogram:audiences, translation
|
||||
* Model mt3smarketingprogram.audience (mautic.mt3smarketingprogram.model.audience), permission base mt3smarketingprogram:audiences, translation
|
||||
* base mt3s.marketing_program.audience.
|
||||
*/
|
||||
class AudienceController extends AbstractStandardFormController
|
||||
@@ -24,7 +24,7 @@ class AudienceController extends AbstractStandardFormController
|
||||
|
||||
protected function getModelName(): string
|
||||
{
|
||||
return 'mt3smp.audience';
|
||||
return 'mt3smarketingprogram.audience';
|
||||
}
|
||||
|
||||
protected function getTemplateBase(): string
|
||||
|
||||
@@ -11,10 +11,11 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
/**
|
||||
* List, view, create, edit and delete plans, using core's standard CRUD flow.
|
||||
* List, view, create, edit and delete marketing programs, using core's standard CRUD flow.
|
||||
*
|
||||
* Core derives most names from the model name "program": model mt3s.marketing_program.model.program, permission base
|
||||
* mt3smarketingprogram:programs (from ProgramModel), translation base mt3s.marketing_program, session base mt3s.marketing_program.
|
||||
* Core derives the model alias and the permission base from the model name
|
||||
* "mt3smarketingprogram.program": model mautic.mt3smarketingprogram.model.program, permission
|
||||
* base mt3smarketingprogram:programs (from ProgramModel). The views translate under mt3s.marketing_program.*.
|
||||
*/
|
||||
class ProgramController extends AbstractStandardFormController
|
||||
{
|
||||
@@ -23,7 +24,7 @@ class ProgramController extends AbstractStandardFormController
|
||||
|
||||
protected function getModelName(): string
|
||||
{
|
||||
return 'mt3smp.program';
|
||||
return 'mt3smarketingprogram.program';
|
||||
}
|
||||
|
||||
protected function getTemplateBase(): string
|
||||
@@ -47,7 +48,7 @@ class ProgramController extends AbstractStandardFormController
|
||||
/**
|
||||
* The OnLoad JS prefix: core dispatches Mautic[getJsLoadMethodPrefix() + "OnLoad"]()
|
||||
* (mt3sMpProgramOnLoad in Assets/js/mt3s-mp-program.js). Without this override, core
|
||||
* falls back to the model name ("mt3smp.program"), which nothing listens to.
|
||||
* falls back to the model name ("mt3smarketingprogram.program"), which nothing listens to.
|
||||
*/
|
||||
protected function getJsLoadMethodPrefix(): string
|
||||
{
|
||||
@@ -148,7 +149,7 @@ class ProgramController extends AbstractStandardFormController
|
||||
|
||||
private function getTaskModel(): TaskModel
|
||||
{
|
||||
$model = $this->getModel('mt3smp.task');
|
||||
$model = $this->getModel('mt3smarketingprogram.task');
|
||||
\assert($model instanceof TaskModel);
|
||||
|
||||
return $model;
|
||||
|
||||
@@ -14,8 +14,8 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
/**
|
||||
* Create, edit and delete Smart Links (main menu > Smart Links), using core's standard CRUD flow.
|
||||
*
|
||||
* Model smartlinks.smart_link (mautic.smartlinks.model.smart_link), permission base
|
||||
* smartlinks:smart_links, translation base mautic.smartlinks.smart_links.
|
||||
* Model mt3smarketingprogram.smart_link (mautic.mt3smarketingprogram.model.smart_link), permission base
|
||||
* mt3smarketingprogram:smart_links, translation base mt3s.smart_links.smart_links.
|
||||
*
|
||||
* The slug of a saved link is immutable: the form disables the field, the model refuses another
|
||||
* slug, and this controller drops the submitted value (nothing to re-check). There is no clone:
|
||||
@@ -23,12 +23,12 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
*/
|
||||
class SmartLinkController extends AbstractStandardFormController
|
||||
{
|
||||
public const ROUTE_INDEX = 'mautic_smartlinks_index';
|
||||
public const ROUTE_ACTION = 'mautic_smartlinks_action';
|
||||
public const ROUTE_INDEX = 'mt3s_smart_links_index';
|
||||
public const ROUTE_ACTION = 'mt3s_smart_links_action';
|
||||
|
||||
protected function getModelName(): string
|
||||
{
|
||||
return 'smartlinks.smart_link';
|
||||
return 'mt3smarketingprogram.smart_link';
|
||||
}
|
||||
|
||||
protected function getTemplateBase(): string
|
||||
@@ -47,20 +47,22 @@ class SmartLinkController extends AbstractStandardFormController
|
||||
}
|
||||
|
||||
/**
|
||||
* Core builds mautic_smartlinkssmartlink from the model name; the JS loader relies on this prefix.
|
||||
* The OnLoad JS prefix: core dispatches Mautic[getJsLoadMethodPrefix() + "OnLoad"]()
|
||||
* (Mautic.mt3sMpSmartLinkOnLoad in Assets/js/mt3s-mp-smartlinks.js). Without this
|
||||
* override, core falls back to the model name, which nothing listens to.
|
||||
*/
|
||||
protected function getJsLoadMethodPrefix(): string
|
||||
{
|
||||
return 'smartlinksSmartLink';
|
||||
return 'mt3sMpSmartLink';
|
||||
}
|
||||
|
||||
/**
|
||||
* Core builds mautic.<model name> (singular smart_link); every key of the feature lives
|
||||
* under mautic.smartlinks.smart_links.
|
||||
* under mt3s.smart_links.smart_links.
|
||||
*/
|
||||
protected function getTranslationBase(): string
|
||||
{
|
||||
return 'mautic.smartlinks.smart_links';
|
||||
return 'mt3s.smart_links.smart_links';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -107,7 +109,7 @@ class SmartLinkController extends AbstractStandardFormController
|
||||
if ($entity instanceof SmartLink && null !== $entity->getId()) {
|
||||
$formSlug = $form->has('slug') ? (string) $form->get('slug')->getData() : '';
|
||||
if ('' !== $formSlug && $formSlug !== (string) $entity->getSlug()) {
|
||||
$this->addFlashMessage('mautic.smartlinks.smart_links.error.slug_immutable', ['%slug%' => $formSlug], \Mautic\CoreBundle\FlashBag::LEVEL_ERROR);
|
||||
$this->addFlashMessage('mt3s.smart_links.smart_links.error.slug_immutable', ['%slug%' => $formSlug], \Mautic\CoreBundle\FlashBag::LEVEL_ERROR);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
* core's standard CRUD flow. Stakeholders are independent of programs; programs link to them from their
|
||||
* Stakeholders tab.
|
||||
*
|
||||
* Model mt3smp.stakeholder (mt3s.marketing_program.model.stakeholder), permission base mt3smarketingprogram:stakeholders,
|
||||
* Model mt3smarketingprogram.stakeholder (mautic.mt3smarketingprogram.model.stakeholder), permission base mt3smarketingprogram:stakeholders,
|
||||
* translation base mt3s.marketing_program.stakeholder.
|
||||
*/
|
||||
class StakeholderController extends AbstractStandardFormController
|
||||
@@ -23,7 +23,7 @@ class StakeholderController extends AbstractStandardFormController
|
||||
|
||||
protected function getModelName(): string
|
||||
{
|
||||
return 'mt3smp.stakeholder';
|
||||
return 'mt3smarketingprogram.stakeholder';
|
||||
}
|
||||
|
||||
protected function getTemplateBase(): string
|
||||
|
||||
@@ -14,7 +14,7 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
/**
|
||||
* List, create, edit and delete tasks (Programs > Tasks), using core's standard CRUD flow.
|
||||
*
|
||||
* Model mt3smp.task (mt3s.marketing_program.model.task), permission base mt3smarketingprogram:tasks, translation base mt3s.marketing_program.task.
|
||||
* Model mt3smarketingprogram.task (mautic.mt3smarketingprogram.model.task), permission base mt3smarketingprogram:tasks, translation base mt3s.marketing_program.task.
|
||||
*
|
||||
* Where the user lands after Save or Cancel depends on where the task form was opened from:
|
||||
* - from Programs > Tasks: back to the task list (core's default);
|
||||
@@ -51,7 +51,7 @@ class TaskController extends AbstractStandardFormController
|
||||
|
||||
protected function getModelName(): string
|
||||
{
|
||||
return 'mt3smp.task';
|
||||
return 'mt3smarketingprogram.task';
|
||||
}
|
||||
|
||||
protected function getTemplateBase(): string
|
||||
@@ -144,7 +144,7 @@ class TaskController extends AbstractStandardFormController
|
||||
$entity = parent::getFormEntity($action, $objectId, $isClone);
|
||||
|
||||
if ('new' === $action && $entity instanceof Task && null === $entity->getProgram() && null !== $this->preselectedProgramId) {
|
||||
$program = $this->getModel('mt3smp.program')->getEntity($this->preselectedProgramId);
|
||||
$program = $this->getModel('mt3smarketingprogram.program')->getEntity($this->preselectedProgramId);
|
||||
if ($program instanceof Program) {
|
||||
$entity->setProgram($program);
|
||||
}
|
||||
|
||||
@@ -12,20 +12,20 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
* Create, edit and delete UTM Taxonomies (Smart Links > UTM Taxonomies), using core's standard
|
||||
* CRUD flow.
|
||||
*
|
||||
* Model smartlinks.utm_taxonomy (mautic.smartlinks.model.utm_taxonomy), permission base
|
||||
* smartlinks:taxonomies, translation base mautic.smartlinks.taxonomies.
|
||||
* Model mt3smarketingprogram.utm_taxonomy (mautic.mt3smarketingprogram.model.utm_taxonomy), permission base
|
||||
* mt3smarketingprogram:taxonomies, translation base mt3s.smart_links.taxonomies.
|
||||
*
|
||||
* A taxonomy is never cloned: its name is unique, and a clone would collide immediately. A new
|
||||
* taxonomy is created from scratch.
|
||||
*/
|
||||
class UtmTaxonomyController extends AbstractStandardFormController
|
||||
{
|
||||
public const ROUTE_INDEX = 'mautic_smartlinks_taxonomies';
|
||||
public const ROUTE_ACTION = 'mautic_smartlinks_taxonomy_action';
|
||||
public const ROUTE_INDEX = 'mt3s_smart_links_taxonomies';
|
||||
public const ROUTE_ACTION = 'mt3s_smart_links_taxonomy_action';
|
||||
|
||||
protected function getModelName(): string
|
||||
{
|
||||
return 'smartlinks.utm_taxonomy';
|
||||
return 'mt3smarketingprogram.utm_taxonomy';
|
||||
}
|
||||
|
||||
protected function getTemplateBase(): string
|
||||
@@ -44,20 +44,20 @@ class UtmTaxonomyController extends AbstractStandardFormController
|
||||
}
|
||||
|
||||
/**
|
||||
* Core derives the JS loader method from the model name; no Mautic.<prefix>OnLoad exists for
|
||||
* taxonomies (the form needs none), but the prefix stays deterministic for future use.
|
||||
* The OnLoad JS prefix (no Mautic.mt3sMpUtmTaxonomyOnLoad exists: the form needs none),
|
||||
* deterministic for future use; core's fallback, the model name, would nothing listen to.
|
||||
*/
|
||||
protected function getJsLoadMethodPrefix(): string
|
||||
{
|
||||
return 'smartlinksUtmTaxonomy';
|
||||
return 'mt3sMpUtmTaxonomy';
|
||||
}
|
||||
|
||||
/**
|
||||
* Core builds mautic.<model name>; every key of the feature lives under mautic.smartlinks.taxonomies.
|
||||
* Core builds mautic.<model name>; every key of the feature lives under mt3s.smart_links.taxonomies.
|
||||
*/
|
||||
protected function getTranslationBase(): string
|
||||
{
|
||||
return 'mautic.smartlinks.taxonomies';
|
||||
return 'mt3s.smart_links.taxonomies';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user