Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Drupal Environment
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
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
Composer
plugin
Drupal Environment
Merge requests
!358
Merging develop into main
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Merging develop into main
develop
into
main
Overview
0
Commits
1
Pipelines
1
Changes
5
Merged
GitLab CI
requested to merge
develop
into
main
4 months ago
Overview
0
Commits
1
Pipelines
1
Changes
5
Expand
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
fc2ff4dc
1 commit,
4 months ago
5 files
+
169
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
5
Search (e.g. *.vue) (Ctrl+P)
patches/d10/33525862-2.diff
0 → 100644
+
165
−
0
Options
diff --git a/composer.json b/composer.json
index 41b19f5fe9afe25dabdac641c11baaa94f2ba8ab..bda38d5015851179c99ece6f46a67312a36ccae2 100755
--- a/composer.json
+++ b/composer.json
@@ -24,6 +24,6 @@
"source": "https://git.drupalcode.org/project/taxonomy_machine_name"
},
"require": {
- "drupal/core": "^9.4 || ^10"
+ "drupal/core": "^9.4 || ^10 || ^11"
}
}
diff --git a/config/install/taxonomy_machine_name.settings.yml b/config/install/taxonomy_machine_name.settings.yml
new file mode 100644
index 0000000000000000000000000000000000000000..4593ad4f74557433d1b3a98bed866d0917c3a142
--- /dev/null
+++ b/config/install/taxonomy_machine_name.settings.yml
@@ -0,0 +1 @@
+hide_machine_name_in_terms_overview: 0
diff --git a/modules/search_api_taxonomy_machine_name/search_api_taxonomy_machine_name.info.yml b/modules/search_api_taxonomy_machine_name/search_api_taxonomy_machine_name.info.yml
index c30e70172377b0de1c213087f6e4e73ae02b2c95..a67abac92a6f11288cb3d78addf68d6e07963d22 100644
--- a/modules/search_api_taxonomy_machine_name/search_api_taxonomy_machine_name.info.yml
+++ b/modules/search_api_taxonomy_machine_name/search_api_taxonomy_machine_name.info.yml
@@ -2,8 +2,7 @@
name: Search API Taxonomy Machine Name
description: Search API integration for the Taxonomy Machine Name module
type: module
package: Other
-core: 8.x
-core_version_requirement: ^8 || ^9 || ^10
+core_version_requirement: ^10 || ^11
dependencies:
- taxonomy_machine_name:taxonomy_machine_name
diff --git a/src/Form/Settings.php b/src/Form/Settings.php
new file mode 100644
index 0000000000000000000000000000000000000000..0476b6b19e4e8053c0fb73742c1e8e75cd531cc8
--- /dev/null
+++ b/src/Form/Settings.php
@@ -0,0 +1,54 @@
+<?php
+
+namespace Drupal\taxonomy_machine_name\Form;
+
+use Drupal\Core\Form\ConfigFormBase;
+use Drupal\Core\Form\FormStateInterface;
+
+/**
+ * Configure Taxonomy Machine Name settings for this site.
+ */
+final class Settings extends ConfigFormBase {
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getFormId(): string {
+ return 'taxonomy_machine_name_settings';
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function getEditableConfigNames(): array {
+ return ['taxonomy_machine_name.settings'];
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function buildForm(array $form, FormStateInterface $form_state): array {
+ $config = $this->config('taxonomy_machine_name.settings');
+
+ $form['hide_machine_name_in_terms_overview'] = [
+ '#type' => 'checkbox',
+ '#title' => $this->t('This hides the machine name in the terms overview.'),
+ '#default_value' => $config->get('hide_machine_name_in_terms_overview'),
+ '#description' => $this->t('By default, the machine name is displayed.'),
+ ];
+
+ return parent::buildForm($form, $form_state);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function submitForm(array &$form, FormStateInterface $form_state): void {
+ $config = $this->config('taxonomy_machine_name.settings');
+ $config->set('hide_machine_name_in_terms_overview',
+ $form_state->getValue('hide_machine_name_in_terms_overview'));
+ $config->save();
+ parent::submitForm($form, $form_state);
+ }
+
+}
diff --git a/taxonomy_machine_name.info.yml b/taxonomy_machine_name.info.yml
index 1ec84a8daba43059a61f8345c987e8524f05e206..533d41372b4be7ec1388ef03967c9c0a9eca4872 100644
--- a/taxonomy_machine_name.info.yml
+++ b/taxonomy_machine_name.info.yml
@@ -2,7 +2,7 @@
name: Taxonomy Machine Name
description: Provides a new property to store machine name for taxonomy terms.
type: module
package: Other
-core_version_requirement: ^9.4 || ^10
+core_version_requirement: ^10 || ^11
dependencies:
- drupal:taxonomy
diff --git a/taxonomy_machine_name.install b/taxonomy_machine_name.install
index 55607499a02cd6eac59956ed1fcfd6924d7f3662..a3a996e3832482276919faa576c8f08e4a872aa7 100644
--- a/taxonomy_machine_name.install
+++ b/taxonomy_machine_name.install
@@ -43,10 +43,10 @@
function taxonomy_machine_name_update_8001(array &$sandbox = NULL) {
/**
* Update machine names for existing terms, usable both in batch and update.
*
- * @param array $context
+ * @param array|DrushBatchContext $context
* The $context parameter in updates, called $context in Batch API.
*/
-function taxonomy_machine_name_update_all_terms(array &$context) {
+function taxonomy_machine_name_update_all_terms(&$context) {
$sandbox = &$context['sandbox'];
if (empty($sandbox['tids'])) {
// Size of the batch to process.
diff --git a/taxonomy_machine_name.links.menu.yml b/taxonomy_machine_name.links.menu.yml
new file mode 100644
index 0000000000000000000000000000000000000000..d06f5425102a95f63c60439aba59e77e52636051
--- /dev/null
+++ b/taxonomy_machine_name.links.menu.yml
@@ -0,0 +1,6 @@
+taxonomy_machine_name.settings:
+ title: Taxonomy Machine Name
+ description: Configure Taxonomy Machine Name
+ parent: system.admin_config_ui
+ route_name: taxonomy_machine_name.settings
+ weight: 10
diff --git a/taxonomy_machine_name.module b/taxonomy_machine_name.module
index de7468cbabc03d32016c4b721098871482153ffb..1765908f715f042e8d6559af6380858a6835fa1c 100644
--- a/taxonomy_machine_name.module
+++ b/taxonomy_machine_name.module
@@ -37,6 +37,11 @@
function taxonomy_machine_name_entity_base_field_info(EntityTypeInterface $entit
* Implements hook_form_FORM_ID_alter().
*/
function taxonomy_machine_name_form_taxonomy_overview_terms_alter(&$form, FormStateInterface $form_state, $form_id) {
+ $shouldHide = Drupal::config('taxonomy_machine_name.settings')
+ ->get('hide_machine_name_in_terms_overview');
+ if($shouldHide) {
+ return;
+ }
$user = \Drupal::currentUser();
if($user->hasPermission('view machine name overview page')) {
if (isset($form['terms']['#header'])) {
diff --git a/taxonomy_machine_name.routing.yml b/taxonomy_machine_name.routing.yml
new file mode 100644
index 0000000000000000000000000000000000000000..837855b11344d084993c967e1af32591e059a5ce
--- /dev/null
+++ b/taxonomy_machine_name.routing.yml
@@ -0,0 +1,7 @@
+taxonomy_machine_name.settings:
+ path: '/admin/config/user-interface/taxonomy_machine_name'
+ defaults:
+ _title: 'Taxonomy Machine Name'
+ _form: 'Drupal\taxonomy_machine_name\Form\Settings'
+ requirements:
+ _permission: 'administer site configuration'
\ No newline at end of file
Loading