Skip to content
Snippets Groups Projects
Commit e124367b authored by Konstantinos Samaras-Tsakiris's avatar Konstantinos Samaras-Tsakiris
Browse files

Merge branch 'add-composer-file' into 'drupal8'

Add composer file and make module d9-ready

See merge request !1
parents 478fb715 961f4f00
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
type: module
version: '8.0.9'
core: 8.x
core_version_requirement: ^8 || ^9
required: TRUE
......@@ -2,9 +2,9 @@
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() {
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)
// unset($projects['drupal']);
// Remove all centrally managed modules.
foreach (system_get_info("module") as $module_name => $module) {
foreach (\Drupal::service('extension.list.module')->getAllInstalledInfo() as $module_name => $module) {
if (preg_match('#^modules/#', drupal_get_path("module", $module_name))) {
if (isset($module["project"])){
unset($projects[$module["project"]]);
......@@ -52,7 +52,7 @@ function cern_integration_update_projects_alter(&$projects)
}
// Remove all centrally managed themes.
foreach (system_get_info("theme") as $theme_name => $theme) {
foreach (\Drupal::service('extension.list.theme')->getAllInstalledInfo() as $theme_name => $theme) {
if (preg_match('#^themes/#', drupal_get_path("theme", $theme_name))) {
if (isset($theme["project"])){
unset($projects[$theme["project"]]);
......@@ -91,7 +91,7 @@ function cern_integration_form_views_form_user_admin_people_page_1_alter(&$form,
* Disable fields under admin/people/create
*/
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.
foreach (\Drupal\Core\Render\Element::children($form) as $key) {
$form[$key]['#disabled'] = TRUE;
......
{
"name": "drupal/cern-integration",
"description": "Custom functionality and constraints for CERN Drupal infrastructure",
"version": "8.0.9",
"type": "drupal-custom-module",
"license": "GPL-2.0-or-later",
"authors": [
{
"name": "Konstantinos Platis",
"email": "konstantinos.platis@cern.ch"
}
],
"repositories": [
{
"type": "composer",
"url": "https://packages.drupal.org/8"
}
],
"require": {}
}
......@@ -13,7 +13,7 @@ class BackendController extends ControllerBase {
/**
* 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");
}
......
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