Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cern_integration
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
drupal
modules
cern_integration
Commits
d8e7b2c7
Commit
d8e7b2c7
authored
6 years ago
by
Ismael Posada Trobo
Browse files
Options
Downloads
Patches
Plain Diff
Memcache module disabled from the Uninstall modules admin page.
parent
f4d2011a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cern_integration.module
+30
-1
30 additions, 1 deletion
cern_integration.module
with
30 additions
and
1 deletion
cern_integration.module
+
30
−
1
View file @
d8e7b2c7
<?php
<?php
/* Debugging purposes */
//function cern_integration_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
//function cern_integration_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
//
drupal_set_message(t("Form ID: $form_id"), "status");
//
drupal_set_message(t("Form ID: $form_id"), "status");
//}
//}
//function cern_integration_form_menu_edit_item_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
// drupal_set_message(t("Form ID: $form_id"), "status");
//}
/* Debugging purposes */
/**
* Implements hook_form_FORM_ID_alter() for system_modules_uninstall().
* Checks whether memcache module exists. If so, disable the possibility of uninstalling it. It's mandatory to have it installed.
*/
function
cern_integration_form_system_modules_uninstall_alter
(
&
$form
,
&
$form_state
,
$form_id
){
$moduleHandler
=
\Drupal
::
service
(
'module_handler'
);
if
(
$moduleHandler
->
moduleExists
(
'memcache'
)){
$form
[
'uninstall'
][
'memcache'
][
'#disabled'
]
=
TRUE
;
global
$base_url
;
$memcache_setup_link
=
\Drupal\Core\Link
::
fromTextAndUrl
(
'Memcache Setup'
,
\Drupal\Core\Url
::
fromUri
(
"
$base_url
/_site/memcache.php"
))
->
toString
();
$txt
=
'</br>'
;
$txt
.
=
'<em>Please, do not uninstall memcache module since it can break down your site.</em>'
;
$txt
.
=
'</br>'
;
$txt
.
=
"<em>If you do not want to use it, please go to "
.
$memcache_setup_link
.
".</em>"
;
$form
[
'modules'
][
'memcache'
][
'description'
][
'memcache_warning'
]
=
array
(
'#markup'
=>
t
(
$txt
)
);
}
}
/**
/**
* Implements hook_update_projects_alter().
* Implements hook_update_projects_alter().
* Remove Drupal core as well as all centrally managed modules and themes from the Update manager.
* Remove Drupal core as well as all centrally managed modules and themes from the Update manager.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment