Commit d4e88df0 authored by catch's avatar catch

Issue #1934772 by sun, andypost, tim.plunkett: Filter module is not required,...

Issue #1934772 by sun, andypost, tim.plunkett: Filter module is not required, but is marked as required.
parent 466ef999
......@@ -19,7 +19,7 @@ abstract class BlockTestBase extends WebTestBase {
*
* @var array
*/
public static $modules = array('block', 'test_page_test');
public static $modules = array('block', 'filter', 'test_page_test');
/**
* A list of theme regions to test.
......
......@@ -7,3 +7,4 @@ version: VERSION
dependencies:
- contextual
- field
- filter
......@@ -4,5 +4,6 @@ description: 'Filters content in preparation for display.'
package: Core
version: VERSION
core: 8.x
required: true
configure: filter.admin_overview
dependencies:
- user
......@@ -5,3 +5,5 @@ package: Core
version: VERSION
core: 8.x
configure: node.overview_types
dependencies:
- text
......@@ -4,6 +4,7 @@ description: 'Defines simple text field types.'
package: Field types
version: VERSION
core: 8.x
required: true
dependencies:
- field
required: true
- filter
......@@ -217,7 +217,12 @@ public function form(array $form, array &$form_state) {
'#weight' => 1,
'#access' => (!$register && $config->get('signatures')),
);
// While the details group will simply not be rendered if empty, the actual
// signature element cannot use #access, since #type 'text_format' is not
// available when Filter module is not installed. If the user account has an
// existing signature value and format, then the existing field values will
// just be re-saved to the database in case of an entity update.
if ($this->moduleHandler->moduleExists('filter')) {
$form['signature_settings']['signature'] = array(
'#type' => 'text_format',
'#title' => $this->t('Signature'),
......@@ -225,6 +230,7 @@ public function form(array $form, array &$form_state) {
'#description' => $this->t('Your signature will be publicly displayed at the end of your comments.'),
'#format' => $account->getSignatureFormat(),
);
}
$user_preferred_langcode = $register ? $language_interface->id : $account->getPreferredLangcode();
......
......@@ -147,14 +147,17 @@ public function buildForm(array $form, array &$form_state) {
}
// Account settings.
$filter_exists = $this->moduleHandler->moduleExists('filter');
$form['personalization'] = array(
'#type' => 'details',
'#title' => $this->t('Personalization'),
'#access' => $filter_exists,
);
$form['personalization']['user_signatures'] = array(
'#type' => 'checkbox',
'#title' => $this->t('Enable signatures.'),
'#default_value' => $config->get('signatures'),
'#default_value' => $filter_exists ? $config->get('signatures') : 0,
'#access' => $filter_exists,
);
// Default notifications address.
......
......@@ -1809,6 +1809,10 @@ function user_modules_installed($modules) {
function user_modules_uninstalled($modules) {
// Remove any potentially orphan module data stored for users.
\Drupal::service('user.data')->delete($modules);
// User signatures require Filter module.
if (in_array('filter', $modules)) {
\Drupal::config('user.settings')->set('signatures', FALSE)->save();
}
}
/**
......
......@@ -267,6 +267,7 @@ function user_views_data() {
),
);
if (\Drupal::moduleHandler()->moduleExists('filter')) {
$data['users']['signature'] = array(
'title' => t('Signature'),
'help' => t("The user's signature."),
......@@ -279,6 +280,7 @@ function user_views_data() {
'id' => 'string',
),
);
}
if (\Drupal::moduleHandler()->moduleExists('content_translation')) {
$data['users']['translation_link'] = array(
......
......@@ -4,3 +4,5 @@ description: 'Create customized lists and queries from your database.'
package: Core
version: VERSION
core: 8.x
dependencies:
- filter
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment