Skip to content
Snippets Groups Projects
Commit 0332fc06 authored by Konstantinos Platis's avatar Konstantinos Platis
Browse files

Add d9 support (passes d9 upgrade status check)

parent e0a86b4b
No related branches found
No related tags found
1 merge request!1Add composer file and make module d9-ready
...@@ -4,5 +4,6 @@ package: CERN ...@@ -4,5 +4,6 @@ package: CERN
type: module type: module
version: '8.0.9' version: '8.0.9'
core: 8.x core: 8.x
core_version_requirement: ^8 || ^9
required: TRUE required: TRUE
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
function cern_integration_install() { function cern_integration_install() {
drupal_set_message(t('CERN Integration module installed successfully.')); \Drupal::messenger()->addMessage(t('CERN Integration module installed successfully.'));
} }
function cern_integration_uninstall() { function cern_integration_uninstall() {
drupal_set_message(t('CERN Integration module was uninstalled successfully.')); \Drupal::messenger()->addMessage(t('CERN Integration module was uninstalled successfully.'));
} }
...@@ -43,7 +43,7 @@ function cern_integration_update_projects_alter(&$projects) ...@@ -43,7 +43,7 @@ function cern_integration_update_projects_alter(&$projects)
// unset($projects['drupal']); // unset($projects['drupal']);
// Remove all centrally managed modules. // Remove all centrally managed modules.
foreach (system_get_info("module") as $module_name => $module) { foreach (\Drupal::service('extension.list.module')->getExtensionInfo() as $module_name => $module) {
if (preg_match('#^modules/#', drupal_get_path("module", $module_name))) { if (preg_match('#^modules/#', drupal_get_path("module", $module_name))) {
if (isset($module["project"])){ if (isset($module["project"])){
unset($projects[$module["project"]]); unset($projects[$module["project"]]);
...@@ -52,7 +52,7 @@ function cern_integration_update_projects_alter(&$projects) ...@@ -52,7 +52,7 @@ function cern_integration_update_projects_alter(&$projects)
} }
// Remove all centrally managed themes. // Remove all centrally managed themes.
foreach (system_get_info("theme") as $theme_name => $theme) { foreach (\Drupal::service('extension.list.theme')->getExtensionInfo() as $theme_name => $theme) {
if (preg_match('#^themes/#', drupal_get_path("theme", $theme_name))) { if (preg_match('#^themes/#', drupal_get_path("theme", $theme_name))) {
if (isset($theme["project"])){ if (isset($theme["project"])){
unset($projects[$theme["project"]]); unset($projects[$theme["project"]]);
...@@ -91,7 +91,7 @@ function cern_integration_form_views_form_user_admin_people_page_1_alter(&$form, ...@@ -91,7 +91,7 @@ function cern_integration_form_views_form_user_admin_people_page_1_alter(&$form,
* Disable fields under admin/people/create * Disable fields under admin/people/create
*/ */
function cern_integration_form_user_register_form_alter(&$form, &$form_state, $form_id){ function cern_integration_form_user_register_form_alter(&$form, &$form_state, $form_id){
drupal_set_message(t("Adding/Removing users is DISABLED."),"warning"); \Drupal::messenger()->addMessage(t("Adding/Removing users is DISABLED."),"warning");
// Disable all elements from this form. // Disable all elements from this form.
foreach (\Drupal\Core\Render\Element::children($form) as $key) { foreach (\Drupal\Core\Render\Element::children($form) as $key) {
$form[$key]['#disabled'] = TRUE; $form[$key]['#disabled'] = TRUE;
......
...@@ -13,7 +13,7 @@ class BackendController extends ControllerBase { ...@@ -13,7 +13,7 @@ class BackendController extends ControllerBase {
/** /**
* Returns a render-able array for a test page. * Returns a render-able array for a test page.
*/ */
public function redirect() { public function redirect($route_name, array $route_parameters = [], array $options = [], $status = 302) {
return new RedirectResponse("/_site"); return new RedirectResponse("/_site");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment