diff --git a/composer.json b/composer.json index 8844437..ef3bf61 100644 --- a/composer.json +++ b/composer.json @@ -23,9 +23,9 @@ ], "license": "GPL-2.0+", "require": { - "drupal/core": "^8.8.4", + "drupal/courier": "^2.0@alpha", "drupal/dynamic_entity_reference": "^1.0", - "drupal/unlimited_number": "^1.0@beta" + "drupal/unlimited_number": "^2.0" }, "suggest": { "drupal/token": " Improves token UI on message template forms.", diff --git a/rng.info.yml b/rng.info.yml index c37cdb6..0d93f18 100644 --- a/rng.info.yml +++ b/rng.info.yml @@ -4,7 +4,6 @@ description: 'Provides the ability to create and manage events and registrations package: RNG core_version_requirement: ^8.8.4 || ^9.0 dependencies: - - drupal:system (>=8.1) - courier:courier - dynamic_entity_reference:dynamic_entity_reference - - unlimited_number:unlimited_number (>=8.x-1.0-beta2) + - unlimited_number:unlimited_number diff --git a/rng.services.yml b/rng.services.yml index 703cb7f..5034f55 100644 --- a/rng.services.yml +++ b/rng.services.yml @@ -60,7 +60,7 @@ services: - { name: access_check, applies_to: _event_rule_reset } access_check.rng.event_registrations_allowed: class: Drupal\rng\Access\RegistrationAddAccessCheck - arguments: ['@entity.manager'] + arguments: ['@entity_type.manager'] tags: - { name: access_check, applies_to: _registration_add_access } rng.paramconverter.entity_type_rule_component: diff --git a/rng_courier/rng_courier.info.yml b/rng_courier/rng_courier.info.yml deleted file mode 100644 index 6b5d2c4..0000000 --- a/rng_courier/rng_courier.info.yml +++ /dev/null @@ -1,8 +0,0 @@ -name: 'rng_courier' -type: module -description: 'Courier integration for RNG' -core_version_requirement: ^8.8.4 || ^9.0 -package: 'RNG' -dependencies: - - rng - - courier diff --git a/rng_courier/rng_courier.module b/rng_courier/rng_courier.module deleted file mode 100644 index 09bc423..0000000 --- a/rng_courier/rng_courier.module +++ /dev/null @@ -1,24 +0,0 @@ -' . t('About') . ''; - $output .= '

' . t('Courier integration for RNG') . '

'; - return $output; - - default: - } -} diff --git a/src/Entity/EventTypeRule.php b/src/Entity/EventTypeRule.php index dafefa7..c02d108 100644 --- a/src/Entity/EventTypeRule.php +++ b/src/Entity/EventTypeRule.php @@ -15,6 +15,19 @@ * entity_keys = { * "id" = "id", * "label" = "id" + * }, + * config_export = { + * "entity_type", + * "bundle", + * "machine_name", + * "trigger", + * "conditions", + * "actions", + * "client", + * "format", + * "pager_settings", + * "api_key_settings", + * "parameters", * } * ) */ diff --git a/src/Entity/RegistrantType.php b/src/Entity/RegistrantType.php index 3137e02..82736ec 100644 --- a/src/Entity/RegistrantType.php +++ b/src/Entity/RegistrantType.php @@ -36,6 +36,12 @@ * "edit-form" = "/admin/structure/rng/registrant_types/manage/{registrant_type}", * "admin-form" = "/admin/structure/rng/registrant_types/manage/{registrant_type}", * "collection" = "/admin/structure/rng/registrant_types" + * }, + * config_export = { + * "id", + * "label", + * "description", + * "label_pattern", * } * ) */ diff --git a/src/Entity/RegistrationType.php b/src/Entity/RegistrationType.php index 9328e82..331e7e0 100644 --- a/src/Entity/RegistrationType.php +++ b/src/Entity/RegistrationType.php @@ -31,6 +31,11 @@ * "canonical" = "/admin/structure/rng/registration_types/manage/{registration_type}", * "edit-form" = "/admin/structure/rng/registration_types/manage/{registration_type}", * "delete-form" = "/admin/structure/rng/registration_types/manage/{registration_type}/delete", + * }, + * config_export = { + * "id", + * "label", + * "description", * } * ) */ diff --git a/src/Entity/RngEventType.php b/src/Entity/RngEventType.php index f2f3e52..66dba54 100644 --- a/src/Entity/RngEventType.php +++ b/src/Entity/RngEventType.php @@ -37,6 +37,23 @@ * "delete-form" = "/admin/structure/rng/event_types/manage/{rng_event_type}/delete", * "event-access-defaults" = "/admin/structure/rng/event_types/manage/{rng_event_type}/access_defaults", * "field-mapping" = "/admin/structure/rng/event_types/manage/{rng_event_type}/field_mapping", + * }, + * config_export = { + * "id", + * "entity_type", + * "bundle", + * "mirror_operation_to_event_manage", + * "custom_rules", + * "default_registrant", + * "allow_anon_registrants", + * "auto_sync_registrants", + * "auto_attach_users", + * "registrant_email_field", + * "event_start_date_field", + * "event_end_date_field", + * "people_types", + * "default_messages", + * "fields", * } * ) */ diff --git a/src/Form/EventTypeForm.php b/src/Form/EventTypeForm.php index face22c..7de85ec 100644 --- a/src/Form/EventTypeForm.php +++ b/src/Form/EventTypeForm.php @@ -413,7 +413,7 @@ public function save(array $form, FormStateInterface $form_state) { $message = ($status == SAVED_UPDATED) ? '%label event type updated.' : '%label event type added.'; $url = $event_type->toUrl(); - $t_args = ['%label' => $event_type->id(), 'link' => Link::fromTextAndUrl(t('Edit'), $url)]; + $t_args = ['%label' => $event_type->id(), 'link' => (Link::fromTextAndUrl($this->t('Edit'), $url))->toString()]; $this->messenger()->addMessage($this->t($message, $t_args)); $this->logger('rng')->notice($message, $t_args); diff --git a/src/Form/MessageActionForm.php b/src/Form/MessageActionForm.php index 86ba5ca..16795bb 100644 --- a/src/Form/MessageActionForm.php +++ b/src/Form/MessageActionForm.php @@ -59,7 +59,7 @@ public function __construct(ActionManager $action_manager, EntityTypeManagerInte public static function create(ContainerInterface $container) { return new static( $container->get('plugin.manager.action'), - $container->get('entity.manager'), + $container->get('entity_type.manager'), $container->get('rng.event_manager') ); } diff --git a/src/Form/RegistrationTypeForm.php b/src/Form/RegistrationTypeForm.php index 0e7e3a2..76adc6b 100644 --- a/src/Form/RegistrationTypeForm.php +++ b/src/Form/RegistrationTypeForm.php @@ -4,8 +4,8 @@ use Drupal\Core\Entity\EntityForm; use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Entity\Query\QueryFactory; use Drupal\Core\Link; +use Drupal\Core\Entity\EntityTypeManagerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -13,22 +13,26 @@ */ class RegistrationTypeForm extends EntityForm { /** - * @var \Drupal\Core\Entity\Query\QueryFactory + * An instance of the entity type manager. + * + * @var \Drupal\Core\Entity\EntityTypeManagerInterface */ - protected $entityQueryFactory; + protected $entityTypeManager; /** * {@inheritdoc} */ - public function __construct(QueryFactory $query_factory) { - $this->entityQueryFactory = $query_factory; + public function __construct(EntityTypeManagerInterface $entity_type_manager) { + $this->entityTypeManager = $entity_type_manager; } /** * {@inheritdoc} */ public static function create(ContainerInterface $container) { - return new static($container->get('entity.query')); + return new static( + $container->get('entity_type.manager') + ); } /** @@ -80,7 +84,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { * Callback for `id` form element in RegistrationTypeForm->buildForm. */ public function exists($entity_id, array $element, FormStateInterface $form_state) { - $query = $this->entityQueryFactory->get('registration_type'); + $query = $this->entityTypeManager->getStorage('registration_type')->getQuery(); return (bool) $query->condition('id', $entity_id)->execute(); } @@ -93,7 +97,7 @@ public function save(array $form, FormStateInterface $form_state) { $message = ($status == SAVED_UPDATED) ? '%label registration type was updated.' : '%label registration type was added.'; $url = $registration_type->toUrl(); - $t_args = ['%label' => $registration_type->label(), 'link' => Link::fromTextAndUrl(t('Edit'), $url)]; + $t_args = ['%label' => $registration_type->label(), 'link' => (Link::fromTextAndUrl($this->t('Edit'), $url))->toString()]; $this->messenger()->addMessage($this->t($message, $t_args)); $this->logger('rng')->notice($message, $t_args); diff --git a/src/Lists/EventTypeListBuilder.php b/src/Lists/EventTypeListBuilder.php index 44e8d68..d6d6120 100644 --- a/src/Lists/EventTypeListBuilder.php +++ b/src/Lists/EventTypeListBuilder.php @@ -40,8 +40,8 @@ public function __construct(EntityTypeInterface $entity_type, EntityStorageInter public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) { return new static( $entity_type, - $container->get('entity.manager')->getStorage($entity_type->id()), - $container->get('entity.manager'), + $container->get('entity_type.manager')->getStorage($entity_type->id()), + $container->get('entity_type.manager'), $container->get('current_user') ); } diff --git a/src/Lists/GroupListBuilder.php b/src/Lists/GroupListBuilder.php index 2fd9973..1af866f 100644 --- a/src/Lists/GroupListBuilder.php +++ b/src/Lists/GroupListBuilder.php @@ -48,7 +48,7 @@ public function __construct(EntityTypeInterface $entity_type, EntityStorageInter public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) { return new static( $entity_type, - $container->get('entity.manager')->getStorage($entity_type->id()), + $container->get('entity_type.manager')->getStorage($entity_type->id()), $container->get('rng.event_manager') ); } diff --git a/src/Lists/RegistrationListBuilder.php b/src/Lists/RegistrationListBuilder.php index c49d37f..9637cfc 100644 --- a/src/Lists/RegistrationListBuilder.php +++ b/src/Lists/RegistrationListBuilder.php @@ -54,7 +54,7 @@ public function __construct(EntityTypeInterface $entity_type, EntityStorageInter public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) { return new static( $entity_type, - $container->get('entity.manager')->getStorage($entity_type->id()), + $container->get('entity_type.manager')->getStorage($entity_type->id()), $container->get('rng.event_manager') ); } diff --git a/src/Lists/RuleListBuilder.php b/src/Lists/RuleListBuilder.php index 63a2d07..a986ade 100644 --- a/src/Lists/RuleListBuilder.php +++ b/src/Lists/RuleListBuilder.php @@ -58,7 +58,7 @@ public function __construct(EntityTypeInterface $entity_type, EntityStorageInter public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) { return new static( $entity_type, - $container->get('entity.manager')->getStorage($entity_type->id()), + $container->get('entity_type.manager')->getStorage($entity_type->id()), $container->get('rng.event_manager'), $container->get('redirect.destination') ); diff --git a/src/Plugin/Derivative/LocalActions.php b/src/Plugin/Derivative/LocalActions.php index 3962151..de799ef 100644 --- a/src/Plugin/Derivative/LocalActions.php +++ b/src/Plugin/Derivative/LocalActions.php @@ -53,7 +53,7 @@ public function __construct(EntityTypeManagerInterface $entity_manager, RoutePro */ public static function create(ContainerInterface $container, $base_plugin_id) { return new static( - $container->get('entity.manager'), + $container->get('entity_type.manager'), $container->get('router.route_provider'), $container->get('rng.event_manager') );