Skip to content

Commit

Permalink
Drupal 9 compatibility fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladyslav Solodovnyk committed Sep 9, 2021
1 parent 692f453 commit 553dc9d
Show file tree
Hide file tree
Showing 30 changed files with 128 additions and 151 deletions.
17 changes: 4 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,17 @@
"license": "GPL-2.0+",
"require": {
"cweagans/composer-patches": "~1.0",
"drupal/panelizer": "4.1",
"drupal/panelizer": "^4.4",
"drupal/panels": "^4.6",
"drupal/ckeditor_font": "^1.0",
"drupal/dynamic_entity_reference": "^1.7",
"drupal/duration_field": "^1.6"
"drupal/duration_field": "^2.0"
},
"minimum-stability": "dev",
"repositories": [
{
"type": "composer",
"url": "https://packages.drupal.org/8"
}
],
"extra": {
"patches": {
"drupal/duration_field": {
"2978206 - Undefined index: #states in drupal_process_states()": "https://www.drupal.org/files/issues/2018-06-08/2978206-2.patch"
},
"drupal/panels": {
"2895962 - Add \"methods\" to Panels IPE routes to support Drupal 8.4.0 / Symfony 3.x": "https://www.drupal.org/files/issues/panels-deprecate-method.patch"
}
}
}
]
}
3 changes: 2 additions & 1 deletion modules/ds_datetime_range/ds_datetime_range.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Digital Signage Datetime Range
type: module
description: Datetime Range cusomizations.
core: 8.x
core_version_requirement: ^8 || ^9
package: "OpenY: Digital Signage"
dependencies:
- datetime_range
- drupal:datetime_range
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: Open Y Digital Signage Alerts
type: module
description: Digital Signage Alerts.
core: 8.x
core_version_requirement: ^8 || ^9
package: "OpenY: Digital Signage"
dependencies:
- openy_digital_signage_screen
- openy_node_alert
- openy_node_alert:openy_node_alert
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ name: OpenY Digital Signage GroupEx Pro Classes Schedule
type: module
description: OpenY Digital Signage GroupEx Pro Classes Schedule.
core: 8.x
core_version_requirement: ^8 || ^9
package: "OpenY: Digital Signage"
dependencies:
- openy_digital_signage_classes_schedule
- openy_digital_signage_room
- ymca_mappings
- ymca_groupex
- openy_digital_signage_room:openy_digital_signage_room
- ymca_mappings:ymca_mappings
- ymca_groupex:ymca_groupex
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ name: OpenY Digital Signage Personify Classes Schedule
type: module
description: OpenY Digital Signage Personify Schedule.
core: 8.x
core_version_requirement: ^8 || ^9
package: "OpenY: Digital Signage"
dependencies:
- openy_digital_signage_classes_schedule
- openy_digital_signage_room
- ymca_mappings
- ymca_personify
- openy_digital_signage_room:openy_digital_signage_room
- ymca_mappings:ymca_mappings
- ymca_personify:ymca_personify
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: Digital Signage Classes Schedule
type: module
description: Digital Signage Classes Schedule.
core: 8.x
core_version_requirement: ^8 || ^9
package: "OpenY: Digital Signage"
dependencies:
- ds_datetime_range
- openy_digital_signage_room
- ds_datetime_range:ds_datetime_range
- openy_digital_signage_room:openy_digital_signage_room
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:
openy_digital_signage_classes_schedule.manager:
class: Drupal\openy_digital_signage_classes_schedule\OpenYClassesScheduleManager
arguments: ['@entity.manager', '@entity.query', '@logger.factory']
arguments: ['@entity_type.manager', '@logger.factory']
openy_digital_signage_classes_schedule.cron:
class: Drupal\openy_digital_signage_classes_schedule\OpenYClassesScheduleCron
arguments: ['@config.factory', '@entity_type.manager', '@logger.factory']
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Drupal\Core\Entity\EntityTypeManager;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Entity\Query\QueryFactory;
use Drupal\Core\Logger\LoggerChannelFactoryInterface;

/**
Expand All @@ -25,13 +24,6 @@ class OpenYClassesScheduleManager implements OpenYClassesScheduleManagerInterfac
*/
const STORAGE = 'openy_ds_classes_session';

/**
* The query factory.
*
* @var QueryFactory
*/
protected $entityQuery;

/**
* The entity type manager.
*
Expand All @@ -56,8 +48,7 @@ class OpenYClassesScheduleManager implements OpenYClassesScheduleManagerInterfac
/**
* Constructor.
*/
public function __construct(EntityTypeManagerInterface $entity_type_manager, QueryFactory $entity_query, LoggerChannelFactoryInterface $logger_factory) {
$this->entityQuery = $entity_query;
public function __construct(EntityTypeManagerInterface $entity_type_manager, LoggerChannelFactoryInterface $logger_factory) {
$this->entityTypeManager = $entity_type_manager;
$this->logger = $logger_factory->get(self::CHANNEL);
$this->storage = $this->entityTypeManager->getStorage(self::STORAGE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ name: Open Y Digital Signage Playlists
type: module
description: Add Playlists to Open Y Digital Signage.
core: 8.x
core_version_requirement: ^8 || ^9
package: "OpenY: Digital Signage"
dependencies:
- openy_digital_signage_schedule
- datetime
- duration_field
- drupal:datetime
- drupal:duration_field
- drupal:media (>= 8.4)
- openy_media_image
- entity_browser
- openy_digital_signage_schedule
- openy_digital_signage_screen
- openy_ds_media_library
- openy_media_image:openy_media_image
- entity_browser:entity_browser
- openy_digital_signage_schedule:openy_digital_signage_schedule
- openy_digital_signage_screen:openy_digital_signage_screen
- openy_ds_media_library:openy_ds_media_library
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Drupal\Core\Ajax\AjaxResponse;
use Drupal\Core\Ajax\RedirectCommand;
use Drupal\Core\Database\Connection;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Entity\EntityRepositoryInterface;
use Drupal\Core\Entity\EntityTypeBundleInfoInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Render\RendererInterface;
Expand All @@ -25,8 +25,8 @@ class OpenYPlaylistAssignScreenForm extends OpenYScheduleItemForm {
/**
* Constructors a OpenYPlaylistAssignScreenForm object.
*
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
* The entity manager service.
* @param \Drupal\Core\Entity\EntityRepositoryInterface $entity_repository
* The entity repository.
* @param \Drupal\Core\Entity\EntityTypeBundleInfoInterface $entity_type_bundle_info
* The entity type bundle info.
* @param \Drupal\Component\Datetime\TimeInterface $time
Expand All @@ -36,16 +36,16 @@ class OpenYPlaylistAssignScreenForm extends OpenYScheduleItemForm {
* @param \Drupal\Core\Render\RendererInterface $renderer
* The renderer service.
*/
public function __construct(EntityManagerInterface $entity_manager, EntityTypeBundleInfoInterface $entity_type_bundle_info, TimeInterface $time, Connection $database, RendererInterface $renderer) {
parent::__construct($entity_manager, $entity_type_bundle_info, $time);
public function __construct(EntityRepositoryInterface $entity_repository, EntityTypeBundleInfoInterface $entity_type_bundle_info, TimeInterface $time, Connection $database, RendererInterface $renderer) {
parent::__construct($entity_repository, $entity_type_bundle_info, $time);

$this->database = $database;
$this->renderer = $renderer;
}

public static function create(ContainerInterface $container) {
return new static(
$container->get('entity.manager'),
$container->get('entity.repository'),
$container->get('entity_type.bundle.info'),
$container->get('datetime.time'),
$container->get('database'),
Expand Down Expand Up @@ -123,21 +123,21 @@ public function validateForm(array &$form, FormStateInterface $form_state) {
// In the first step, we check the intersection of the selected time
// interval with the interval of the current Schedule item, and then
// conversely for determine all intersections of time intervals.
if ($wd_start_time >= $wd_start_time_slot && $wd_start_time <= $wd_end_time_slot ||
$wd_end_time >= $wd_start_time_slot && $wd_end_time <= $wd_end_time_slot ||
$wd_start_time_slot >= $wd_start_time && $wd_start_time_slot <= $wd_end_time ||
$wd_end_time_slot >= $wd_start_time && $wd_end_time_slot <= $wd_end_time) {
if (($wd_start_time >= $wd_start_time_slot && $wd_start_time <= $wd_end_time_slot) ||
($wd_end_time >= $wd_start_time_slot && $wd_end_time <= $wd_end_time_slot) ||
($wd_start_time_slot >= $wd_start_time && $wd_start_time_slot <= $wd_end_time) ||
($wd_end_time_slot >= $wd_start_time && $wd_end_time_slot <= $wd_end_time)) {

// If dates are specified in the selected and current Schedule item,
// they should also be checked for intersection.
if ($time_slot->show_date == 0 && $show_date == 0) {
$start_date_slot = $time_slot->date__value;
$end_date_slot = $time_slot->date__end_value;

if ($start_date >= $start_date_slot && $start_date <= $end_date_slot ||
$end_date >= $start_date_slot && $end_date <= $end_date_slot ||
$start_date_slot >= $start_date && $start_date_slot <= $end_date ||
$end_date_slot >= $start_date && $end_date_slot <= $end_date) {
if (($start_date >= $start_date_slot && $start_date <= $end_date_slot) ||
($end_date >= $start_date_slot && $end_date <= $end_date_slot) ||
($start_date_slot >= $start_date && $start_date_slot <= $end_date) ||
($end_date_slot >= $start_date && $end_date_slot <= $end_date)) {

$isUsed = TRUE;
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Drupal\Core\Ajax\AjaxResponse;
use Drupal\Core\Ajax\HtmlCommand;
use Drupal\Core\Entity\ContentEntityForm;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Entity\EntityRepositoryInterface;
use Drupal\Core\Entity\EntityTypeBundleInfoInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Render\RendererInterface;
Expand All @@ -22,10 +22,17 @@ class OpenYPlaylistForm extends ContentEntityForm {
/**
* OpenYPlaylistForm constructor.
*
* @param \Drupal\Core\Entity\EntityRepositoryInterface $entity_repository
* The entity repository.
* @param \Drupal\Core\Entity\EntityTypeBundleInfoInterface $entity_type_bundle_info
* The entity type bundle info.
* @param \Drupal\Component\Datetime\TimeInterface $time
* The time service.
* @param \Drupal\Core\Render\RendererInterface $renderer
* The renderer service.
*/
public function __construct(EntityManagerInterface $entity_manager, EntityTypeBundleInfoInterface $entity_type_bundle_info = NULL, TimeInterface $time = NULL, RendererInterface $renderer) {
parent::__construct($entity_manager, $entity_type_bundle_info, $time);
public function __construct(EntityRepositoryInterface $entity_repository, EntityTypeBundleInfoInterface $entity_type_bundle_info, TimeInterface $time, RendererInterface $renderer) {
parent::__construct($entity_repository, $entity_type_bundle_info, $time);

$this->renderer = $renderer;
}
Expand All @@ -35,7 +42,7 @@ public function __construct(EntityManagerInterface $entity_manager, EntityTypeBu
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('entity.manager'),
$container->get('entity.repository'),
$container->get('entity_type.bundle.info'),
$container->get('datetime.time'),
$container->get('renderer')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,17 @@ class OpenYDigitalSignageBlockPlaylist extends BlockBase implements ContainerFac
* The plugin definition.
* @param \Symfony\Component\DependencyInjection\ContainerInterface $container
* The container.
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_manager
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* The entity manager service.
* @param \Drupal\openy_digital_signage_screen\OpenYScreenManagerInterface $screen_manager
* The Open Y DS Screen Manager.
* @param \Drupal\openy_digital_signage_room\OpenYRoomManagerInterface $room_manager
* The Open Y DS Room Manager.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, ContainerInterface $container, EntityTypeManagerInterface $entity_manager, OpenYScreenManagerInterface $screen_manager, OpenYRoomManagerInterface $room_manager) {
public function __construct(array $configuration, $plugin_id, $plugin_definition, ContainerInterface $container, EntityTypeManagerInterface $entity_type_manager, OpenYScreenManagerInterface $screen_manager, OpenYRoomManagerInterface $room_manager) {
// Call parent construct method.
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->entityTypeManager = $entity_manager;
$this->entityTypeManager = $entity_type_manager;
$this->screenManager = $screen_manager;
$this->roomManager = $room_manager;
$this->container = $container;
Expand All @@ -93,7 +93,7 @@ public static function create(ContainerInterface $container, array $configuratio
$plugin_id,
$plugin_definition,
$container,
$container->get('entity.manager'),
$container->get('entity_type.manager'),
$container->get('openy_digital_signage_screen.manager'),
$container->get('openy_digital_signage_room.manager')
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: Open Y Digital Signage Room integration with Open Y PEF
type: module
description: Open Y Digital Signage Room integration with Open Y PEF.
core: 8.x
core_version_requirement: ^8 || ^9
package: "OpenY: Digital Signage"
dependencies:
- openy_digital_signage_room
- openy_repeat
- openy_digital_signage_room:openy_digital_signage_room
- openy_repeat:openy_repeat
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: OpenY Digital Signage Room
type: module
description: OpenY Digital Signage Room.
core: 8.x
core_version_requirement: ^8 || ^9
package: "OpenY: Digital Signage"
dependencies:
- openy_digital_signage
- openy_digital_signage:openy_digital_signage
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
services:
openy_digital_signage_room.manager:
class: Drupal\openy_digital_signage_room\OpenYRoomManager
arguments: ['@entity.manager', '@logger.factory', '@config.factory']
arguments: ['@entity_type.manager', '@logger.factory', '@config.factory']
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ name: OpenY Digital Signage Schedule
type: module
description: OpenY Digital Signage Schedule module.
core: 8.x
core_version_requirement: ^8 || ^9
package: "OpenY: Digital Signage"
dependencies:
- time_range
- ds_datetime_range
- openy_digital_signage
- openy_digital_signage_screen_content
- dynamic_entity_reference
- time_range:time_range
- ds_datetime_range:ds_datetime_range
- openy_digital_signage:openy_digital_signage
- openy_digital_signage_screen_content:openy_digital_signage_screen_content
- dynamic_entity_reference:dynamic_entity_reference
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:
openy_digital_signage_schedule.manager:
class: Drupal\openy_digital_signage_schedule\OpenYScheduleManager
arguments: ['@entity.manager', '@entity.query', '@logger.factory']
arguments: ['@entity_type.manager', '@logger.factory']
plugin.manager.schedule_item_data_type:
class: Drupal\openy_digital_signage_schedule\ScheduleItemDataTypePluginManager
parent: default_plugin_manager
Loading

0 comments on commit 553dc9d

Please sign in to comment.