Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor deprecated code in CoreBundle #8104

Merged
merged 76 commits into from Nov 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
b3963c6
Removed alias from form extension
alanhartless Nov 1, 2019
9dbbcf5
Update use of getParent to be a FQNS
alanhartless Nov 1, 2019
87abe76
Changed button_group to ButtonGroupType::class
alanhartless Nov 1, 2019
fc77653
Changed ButtonGroupType from setDefaults to configureOptions
alanhartless Nov 1, 2019
3f1ffb6
Add back getName as getBlockPrefix
alanhartless Nov 1, 2019
f644f90
Change slot_imagecaption to SlotImageCaptionType
alanhartless Nov 1, 2019
d520b90
Change spacer to SpacerType
alanhartless Nov 1, 2019
f5a64ed
Change slot_button to SlotButtonType
alanhartless Nov 1, 2019
d63a03c
Remove deprecated ChoiceList
alanhartless Nov 1, 2019
0b0a53f
Removed spacer and hidden_entity form types that are not used
alanhartless Nov 1, 2019
b6ef6ea
Missed a couple group_button
alanhartless Nov 1, 2019
2a4e6bd
Refactored theme_list to ThemeListType
alanhartless Nov 1, 2019
9820f74
Refactored sortablelist to SortableListType
alanhartless Nov 1, 2019
abf152c
Refactored form_buttons to FormButtonsType
alanhartless Nov 1, 2019
4ad5cac
Refactored theme_upload to ThemeUploadType
alanhartless Nov 1, 2019
b1a9d9b
Refactored slot_successmessage to SlotSuccessMessageType
alanhartless Nov 1, 2019
97f5623
Refactored daterange to DateRangeType
alanhartless Nov 1, 2019
f46dd21
Refactored coreconfig to ConfigType
alanhartless Nov 1, 2019
97266ff
Refactored slot_socialshare to SlotSocialShareType
alanhartless Nov 1, 2019
e926423
Refactored dynamic_content_filter to DynamicContentFilterType
alanhartless Nov 1, 2019
aaaf54c
Fixed missing constructor for DateRangeType
alanhartless Nov 1, 2019
2ccf3e4
Refactor slot_dwc to SlotDwcType
alanhartless Nov 2, 2019
00f8301
Refactor slot_imagecard to SlotImageCardType
alanhartless Nov 2, 2019
5a681e7
Refactor standalone_button to StandAloneButtonType
alanhartless Nov 2, 2019
b0270f9
Refactor slot_segmentlist to SlotSegmentListType
alanhartless Nov 2, 2019
57ba5bf
Refactor GatedVideoType
alanhartless Nov 2, 2019
151b89e
Refactor slot_separator to SlotSeparatorType
alanhartless Nov 2, 2019
ccb549e
Refactor dynamic_content_filter_entry to DynamicContentFilterEntryType
alanhartless Nov 2, 2019
06d4b5b
Refactor themeconfig to ConfigThemeType
alanhartless Nov 2, 2019
1d08daf
Convert form types to FQCN
alanhartless Nov 2, 2019
b931e4e
Refactor yesno_button_group to YesNoButtonGroupType
alanhartless Nov 2, 2019
e133084
Refactor dynamiclist to DynamicListType
alanhartless Nov 2, 2019
4806f6b
Refactor slot_categorylist to SlotCategoryListType
alanhartless Nov 2, 2019
53d4a02
Refactor iplookup_download_data_store_button to IpLookupDownloadDataS…
alanhartless Nov 2, 2019
ca54ec4
Refactor slot_channelfrequency to SlotChannelFrequencyType
alanhartless Nov 2, 2019
0266f2e
Refactor slot_image to SlotImageType
alanhartless Nov 2, 2019
08f6f25
Refactor slot_dynamiccontent to SlotDynamicContentType
alanhartless Nov 2, 2019
6c3bf9f
Refactor slot_socialfollow to SlotSocialFollowType
alanhartless Nov 2, 2019
d9f2f07
Refactor builder_section to BuilderSectionType
alanhartless Nov 2, 2019
6908b75
Refactor slot_codemode to SlotCodeModeType
alanhartless Nov 2, 2019
f07fa2d
Refactor slot to SlotType
alanhartless Nov 2, 2019
cb601c0
Refactor tel to TelType
alanhartless Nov 2, 2019
4b9842f
Refactor slot_saveprefsbutton to SlotSavePrefsButtonType
alanhartless Nov 2, 2019
1e8c659
Refactor slot_preferredchannel to SlotPreferredChannelType
alanhartless Nov 2, 2019
65d6015
Refactor dynamic_content_filter_entry_filters to DynamicContentFilter…
alanhartless Nov 2, 2019
f03ddbf
Remove MauticFactory from SlotExtension
alanhartless Nov 2, 2019
e69f623
Refactor getRequest()
alanhartless Nov 2, 2019
f7235ba
Refactored SecurityContext to AuthorizationCheckerInterface
alanhartless Nov 2, 2019
343a6e0
Fixed FlattenException namespace
alanhartless Nov 2, 2019
8fced9b
Updated field types, choices, and entry_options
alanhartless Nov 2, 2019
99eca5d
Remove MauticFactory from repositories
alanhartless Nov 4, 2019
b5ef733
Refactor MauticFactory out of AssetGenerationHelper
alanhartless Nov 4, 2019
28aabe6
Refactor MauticFactory out of TranslationLoader
alanhartless Nov 4, 2019
f76e089
Refactor MauticFactory from MenuRenderer
alanhartless Nov 4, 2019
c3ba6ba
Refactor MauticFactory from GravatarHelper
alanhartless Nov 4, 2019
8109c1f
Refactor MauticFactory from AbstractMauticMigration.
alanhartless Nov 5, 2019
678ccde
Remove all migrations from 3.x; migration path is update schema to la…
alanhartless Nov 5, 2019
46bc6dc
Refactor MauticFactory from ThemeHelper and TemplateNameParser
alanhartless Nov 5, 2019
b24b3f0
Removed deprecated CoreEvents::* channel events
alanhartless Nov 5, 2019
bc5021f
Removed deprecated uses of $allowVisualPlaceholders argument
alanhartless Nov 5, 2019
b3e2a1b
Fixed email dynamic email filter types
alanhartless Nov 5, 2019
4b15a7b
Removed unused classes
alanhartless Nov 5, 2019
1c11e09
Removed unused deprecated methods
alanhartless Nov 5, 2019
9502037
Remove mcrypt cipher
alanhartless Nov 5, 2019
e97fa06
Remove reference to mcrypt
alanhartless Nov 5, 2019
00622ae
Require adaptor for CacheStorageHelper
alanhartless Nov 5, 2019
55d5d73
Remove deprecated use of the plugin: permission prefix
alanhartless Nov 5, 2019
c10f025
Remove deprecated use of the plugin: permission prefix
alanhartless Nov 5, 2019
5f47dfa
Removed custom button injection deprecated code
alanhartless Nov 5, 2019
5ce13ca
Removed deprecated MauticJS.pixelLoaded method
alanhartless Nov 5, 2019
58344c8
Removed another deprecated errors vs error response array
alanhartless Nov 5, 2019
385924a
Removed deprecated public slot used in 1.x templates
alanhartless Nov 5, 2019
9929d27
Remove deprecated getVersion method
alanhartless Nov 5, 2019
a2aa2a0
Define extended_type for custom core form extension
alanhartless Nov 5, 2019
e343b68
Replace 'tel' form type with FQCN
escopecz Nov 26, 2019
3c85700
Fix contact edit form
escopecz Nov 26, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion app/bundles/ApiBundle/Form/Type/ClientType.php
Expand Up @@ -16,6 +16,7 @@
use Mautic\CoreBundle\Form\DataTransformer as Transformers;
use Mautic\CoreBundle\Form\EventListener\CleanFormSubscriber;
use Mautic\CoreBundle\Form\EventListener\FormExitSubscriber;
use Mautic\CoreBundle\Form\Type\FormButtonsType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormError;
Expand Down Expand Up @@ -254,7 +255,7 @@ function (FormEvent $event) use ($translator, $validator) {
);
}

$builder->add('buttons', 'form_buttons');
$builder->add('buttons', FormButtonsType::class);

if (!empty($options['action'])) {
$builder->setAction($options['action']);
Expand Down
5 changes: 3 additions & 2 deletions app/bundles/ApiBundle/Form/Type/ConfigType.php
Expand Up @@ -11,6 +11,7 @@

namespace Mautic\ApiBundle\Form\Type;

use Mautic\CoreBundle\Form\Type\YesNoButtonGroupType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Validator\Constraints\NotBlank;
Expand All @@ -28,7 +29,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add(
'api_enabled',
'yesno_button_group',
YesNoButtonGroupType::class,
[
'label' => 'mautic.api.config.form.api.enabled',
'data' => (bool) $options['data']['api_enabled'],
Expand All @@ -40,7 +41,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)

$builder->add(
'api_enable_basic_auth',
'yesno_button_group',
YesNoButtonGroupType::class,
[
'label' => 'mautic.api.config.form.api.basic_auth_enabled',
'data' => (bool) $options['data']['api_enable_basic_auth'],
Expand Down
3 changes: 2 additions & 1 deletion app/bundles/AssetBundle/Controller/AssetController.php
Expand Up @@ -13,6 +13,7 @@

use Mautic\AssetBundle\Entity\Asset;
use Mautic\CoreBundle\Controller\FormController;
use Mautic\CoreBundle\Form\Type\DateRangeType;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response;

Expand Down Expand Up @@ -153,7 +154,7 @@ public function viewAction($objectId)
// Init the date range filter form
$dateRangeValues = $this->request->get('daterange', []);
$action = $this->generateUrl('mautic_asset_action', ['objectAction' => 'view', 'objectId' => $objectId]);
$dateRangeForm = $this->get('form.factory')->create('daterange', $dateRangeValues, ['action' => $action]);
$dateRangeForm = $this->get('form.factory')->create(DateRangeType::class, $dateRangeValues, ['action' => $action]);

if ($activeAsset === null) {
//set the return URL
Expand Down
Expand Up @@ -74,7 +74,7 @@ public function onBuilderBuild(BuilderEvent $event)
{
if ($event->tokensRequested($this->assetToken)) {
$tokenHelper = new BuilderTokenHelper($this->factory, 'asset');
$event->addTokensFromHelper($tokenHelper, $this->assetToken, 'title', 'id', false, true);
$event->addTokensFromHelper($tokenHelper, $this->assetToken, 'title', 'id', true);
}
}

Expand Down
11 changes: 7 additions & 4 deletions app/bundles/AssetBundle/Form/Type/AssetType.php
Expand Up @@ -16,6 +16,9 @@
use Mautic\CategoryBundle\Form\Type\CategoryListType;
use Mautic\CoreBundle\Form\EventListener\CleanFormSubscriber;
use Mautic\CoreBundle\Form\EventListener\FormExitSubscriber;
use Mautic\CoreBundle\Form\Type\ButtonGroupType;
use Mautic\CoreBundle\Form\Type\FormButtonsType;
use Mautic\CoreBundle\Form\Type\YesNoButtonGroupType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
Expand Down Expand Up @@ -56,7 +59,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
$builder->addEventSubscriber(new CleanFormSubscriber(['description' => 'html']));
$builder->addEventSubscriber(new FormExitSubscriber('asset.asset', $options));

$builder->add('storageLocation', 'button_group', [
$builder->add('storageLocation', ButtonGroupType::class, [
'label' => 'mautic.asset.asset.form.storageLocation',
'choices' => [
'mautic.asset.asset.form.storageLocation.local' => 'local',
Expand Down Expand Up @@ -88,7 +91,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
);
$builder->add(
'disallow',
'yesno_button_group',
YesNoButtonGroupType::class,
[
'label' => 'mautic.asset.asset.form.disallow.crawlers',
'attr' => [
Expand Down Expand Up @@ -163,7 +166,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'required' => false,
]);

$builder->add('isPublished', 'yesno_button_group');
$builder->add('isPublished', YesNoButtonGroupType::class);

$builder->add('publishUp', 'datetime', [
'widget' => 'single_text',
Expand Down Expand Up @@ -201,7 +204,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
]
);

$builder->add('buttons', 'form_buttons', []);
$builder->add('buttons', FormButtonsType::class, []);

if (!empty($options['action'])) {
$builder->setAction($options['action']);
Expand Down
3 changes: 2 additions & 1 deletion app/bundles/CampaignBundle/Controller/CampaignController.php
Expand Up @@ -18,6 +18,7 @@
use Mautic\CampaignBundle\Model\CampaignModel;
use Mautic\CampaignBundle\Model\EventModel;
use Mautic\CoreBundle\Controller\AbstractStandardFormController;
use Mautic\CoreBundle\Form\Type\DateRangeType;
use Mautic\LeadBundle\Controller\EntityContactsTrait;
use Symfony\Component\Form\Form;
use Symfony\Component\Form\FormError;
Expand Down Expand Up @@ -677,7 +678,7 @@ protected function getViewArguments(array $args, $action)
// Init the date range filter form
$dateRangeValues = $this->request->get('daterange', []);
$action = $this->generateUrl('mautic_campaign_action', ['objectAction' => 'view', 'objectId' => $objectId]);
$dateRangeForm = $this->get('form.factory')->create('daterange', $dateRangeValues, ['action' => $action]);
$dateRangeForm = $this->get('form.factory')->create(DateRangeType::class, $dateRangeValues, ['action' => $action]);

/** @var LeadEventLogRepository $eventLogRepo */
$eventLogRepo = $this->getDoctrine()->getManager()->getRepository('MauticCampaignBundle:LeadEventLog');
Expand Down
Expand Up @@ -11,6 +11,7 @@

namespace Mautic\CampaignBundle\Form\Type;

use Mautic\CoreBundle\Form\Type\ButtonGroupType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;

Expand All @@ -26,7 +27,7 @@ class CampaignEventLeadChangeType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$data = (isset($options['data']['action'])) ? $options['data']['action'] : 'added';
$builder->add('action', 'button_group', [
$builder->add('action', ButtonGroupType::class, [
'choices' => [
'added' => 'mautic.campaign.form.trigger_leadchanged_added',
'removed' => 'mautic.campaign.form.trigger_leadchanged_removed',
Expand Down
Expand Up @@ -12,6 +12,7 @@
namespace Mautic\CampaignBundle\Form\Type;

use Mautic\CoreBundle\Factory\MauticFactory;
use Mautic\CoreBundle\Form\Type\FormButtonsType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
Expand Down Expand Up @@ -103,7 +104,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
$btnIcon = 'fa fa-plus';
}

$builder->add('buttons', 'form_buttons', [
$builder->add('buttons', FormButtonsType::class, [
'save_text' => $btnValue,
'save_icon' => $btnIcon,
'save_onclick' => 'Mautic.submitCampaignSource(event)',
Expand Down
8 changes: 5 additions & 3 deletions app/bundles/CampaignBundle/Form/Type/CampaignType.php
Expand Up @@ -15,6 +15,8 @@
use Mautic\CoreBundle\Factory\MauticFactory;
use Mautic\CoreBundle\Form\EventListener\CleanFormSubscriber;
use Mautic\CoreBundle\Form\EventListener\FormExitSubscriber;
use Mautic\CoreBundle\Form\Type\FormButtonsType;
use Mautic\CoreBundle\Form\Type\YesNoButtonGroupType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
Expand Down Expand Up @@ -61,7 +63,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
]);

$builder->add('allowRestart',
'yesno_button_group',
YesNoButtonGroupType::class,
[
'label' => 'mautic.campaign.allow_restart',
'attr' => [
Expand Down Expand Up @@ -90,7 +92,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
$data = false;
}

$builder->add('isPublished', 'yesno_button_group', [
$builder->add('isPublished', YesNoButtonGroupType::class, [
'read_only' => $readonly,
'data' => $data,
]);
Expand Down Expand Up @@ -127,7 +129,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
$builder->setAction($options['action']);
}

$builder->add('buttons', 'form_buttons', [
$builder->add('buttons', FormButtonsType::class, [
'pre_extra_buttons' => [
[
'name' => 'builder',
Expand Down
6 changes: 4 additions & 2 deletions app/bundles/CampaignBundle/Form/Type/EventType.php
Expand Up @@ -12,6 +12,8 @@
namespace Mautic\CampaignBundle\Form\Type;

use Mautic\CoreBundle\Form\EventListener\CleanFormSubscriber;
use Mautic\CoreBundle\Form\Type\ButtonGroupType;
use Mautic\CoreBundle\Form\Type\FormButtonsType;
use Mautic\CoreBundle\Form\Type\PropertiesTrait;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
Expand Down Expand Up @@ -79,7 +81,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
$triggerMode = (empty($options['data']['triggerMode'])) ? $default : $options['data']['triggerMode'];
$builder->add(
'triggerMode',
'button_group',
ButtonGroupType::class,
[
'choices' => $choices,
'expanded' => true,
Expand Down Expand Up @@ -259,7 +261,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)

$builder->add(
'buttons',
'form_buttons',
FormButtonsType::class,
[
'save_text' => $btnValue,
'save_icon' => $btnIcon,
Expand Down
3 changes: 2 additions & 1 deletion app/bundles/CategoryBundle/Form/Type/CategoryType.php
Expand Up @@ -14,6 +14,7 @@
use Mautic\CoreBundle\Form\EventListener\CleanFormSubscriber;
use Mautic\CoreBundle\Form\EventListener\FormExitSubscriber;
use Mautic\CoreBundle\Form\Type\FormButtonsType;
use Mautic\CoreBundle\Form\Type\YesNoButtonGroupType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
Expand Down Expand Up @@ -136,7 +137,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
]
);

$builder->add('isPublished', 'yesno_button_group');
$builder->add('isPublished', YesNoButtonGroupType::class);

$builder->add(
'inForm',
Expand Down
4 changes: 2 additions & 2 deletions app/bundles/ChannelBundle/Event/ChannelBroadcastEvent.php
Expand Up @@ -36,7 +36,7 @@ class ChannelBroadcastEvent extends Event
/**
* Number of contacts successfully processed and/or failed per channel.
*
* @var int
* @var array
*/
protected $results = [];

Expand Down Expand Up @@ -118,7 +118,7 @@ public function setResults($channelLabel, $successCount, $failedCount = 0, array
}

/**
* @return int
* @return array
*/
public function getResults()
{
Expand Down
3 changes: 2 additions & 1 deletion app/bundles/ChannelBundle/Form/Type/ChannelType.php
Expand Up @@ -12,6 +12,7 @@
namespace Mautic\ChannelBundle\Form\Type;

use Mautic\ChannelBundle\Entity\Channel;
use Mautic\CoreBundle\Form\Type\YesNoButtonGroupType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\FormBuilderInterface;
Expand Down Expand Up @@ -58,7 +59,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)

$form->add(
'isEnabled',
'yesno_button_group',
YesNoButtonGroupType::class,
[
'label' => 'mautic.channel.message.form.enabled',
'attr' => [
Expand Down
3 changes: 2 additions & 1 deletion app/bundles/ConfigBundle/Form/Type/ConfigType.php
Expand Up @@ -12,6 +12,7 @@
namespace Mautic\ConfigBundle\Form\Type;

use Mautic\ConfigBundle\Form\Helper\RestrictionHelper;
use Mautic\CoreBundle\Form\Type\FormButtonsType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent;
Expand Down Expand Up @@ -70,7 +71,7 @@ function (FormEvent $event) {

$builder->add(
'buttons',
'form_buttons',
FormButtonsType::class,
[
'apply_onclick' => 'Mautic.activateBackdrop()',
'save_onclick' => 'Mautic.activateBackdrop()',
Expand Down