Skip to content
Snippets Groups Projects
Unverified Commit 8553f256 authored by weaver299's avatar weaver299 Committed by GitHub
Browse files

Merge pull request #266 - views_autocomplete_filters, field_group,...

Merge pull request #266 - views_autocomplete_filters, field_group, block_region_permissions, block_permissions

Updating drupal/views_autocomplete_filters (1.2.0 => 1.3.0)
Updating drupal/field_group (3.0.0 => 3.1.0)
Updating drupal/block_region_permissions (1.2.0 => 1.3.0)
Installing drupal/block_permissions (1.1.0)
Removing block_permissions patch
parents 3f016710 5f90f2d7
No related branches found
No related tags found
No related merge requests found
Showing
with 257 additions and 234 deletions
......@@ -95,8 +95,8 @@
"drupal/better_exposed_filters": "3.0-alpha6",
"drupal/bigmenu": "1.0.0-alpha1",
"drupal/block_field": "1.0.0-rc1",
"drupal/block_permissions": "1.0",
"drupal/block_region_permissions": "1.2",
"drupal/block_permissions": "1.1",
"drupal/block_region_permissions": "1.3",
"drupal/bootstrap": "3.16",
"drupal/ckeditor_indentblock": "1.0.0-beta2",
"drupal/config_direct_save": "1.0",
......@@ -120,7 +120,7 @@
"drupal/entity_reference_revisions": "1.8",
"drupal/externalauth": "1.1",
"drupal/features": "3.8",
"drupal/field_group": "3.0",
"drupal/field_group": "3.1",
"drupal/field_permissions": "1.0",
"drupal/file_browser": "1.1",
"drupal/focal_point": "1.4",
......@@ -176,7 +176,7 @@
"drupal/view_unpublished": "1.0-rc1",
"drupal/views_accordion": "1.1",
"drupal/views_ajax_history": "1.2",
"drupal/views_autocomplete_filters": "1.2",
"drupal/views_autocomplete_filters": "1.3",
"drupal/views_bootstrap": "3.1",
"drupal/views_bulk_operations": "3.4",
"drupal/views_fieldsets": "3.3",
......@@ -279,9 +279,6 @@
"drupal/better_exposed_filters": {
"2961022": "https://www.drupal.org/files/issues/2018-09-27/better_exposed_filters-autosubmit-fix-2961022-4.patch"
},
"drupal/block_permissions": {
"2962965": "https://www.drupal.org/files/issues/2018-09-01/block-permissions-2962965-4.patch"
},
"drupal/entity_clone": {
"3060223": "https://www.drupal.org/files/issues/2019-10-17/%20entity_clone-corrupted-paragraph-cloning-3060223-5.patch"
},
......
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "7d3787aaafd1ba3db8d0785fee363f8b",
"content-hash": "97a7b4312e4113ee81b8d863f237ad12",
"packages": [
{
"name": "alchemy/zippy",
......@@ -2516,43 +2516,41 @@
},
{
"name": "drupal/block_permissions",
"version": "1.0.0",
"version": "1.1.0",
"source": {
"type": "git",
"url": "https://git.drupalcode.org/project/block_permissions.git",
"reference": "8.x-1.0"
"reference": "8.x-1.1"
},
"dist": {
"type": "zip",
"url": "https://ftp.drupal.org/files/projects/block_permissions-8.x-1.0.zip",
"reference": "8.x-1.0",
"shasum": "3f1cb219379fc88a80445d494f66dd4fb2a5befa"
"url": "https://ftp.drupal.org/files/projects/block_permissions-8.x-1.1.zip",
"reference": "8.x-1.1",
"shasum": "734c00f78dfb674294b2d35bc87fcaed7ecf2042"
},
"require": {
"drupal/core": "~8.0"
"drupal/core": "^8 || ^9"
},
"type": "drupal-module",
"extra": {
"branch-alias": {
"dev-1.x": "1.x-dev"
},
"drupal": {
"version": "8.x-1.0",
"datestamp": "1478790983",
"version": "8.x-1.1",
"datestamp": "1592480089",
"security-coverage": {
"status": "covered",
"message": "Covered by Drupal's security advisory policy"
}
},
"patches_applied": {
"2962965": "https://www.drupal.org/files/issues/2018-09-01/block-permissions-2962965-4.patch"
}
},
"notification-url": "https://packages.drupal.org/8/downloads",
"license": [
"GPL-2.0-or-later"
"GPL-2.0+"
],
"authors": [
{
"name": "Steven Buteneers",
"homepage": "https://www.drupal.org/user/3301055"
},
{
"name": "jefuri",
"homepage": "https://www.drupal.org/user/2733365"
......@@ -2565,37 +2563,35 @@
"description": "Adds specific permissions for administering blocks.",
"homepage": "https://www.drupal.org/project/block_permissions",
"support": {
"source": "http://cgit.drupalcode.org/block_permissions"
"source": "http://cgit.drupalcode.org/block_permissions",
"issues": "https://www.drupal.org/project/issues/block_permissions?version=8.x"
}
},
{
"name": "drupal/block_region_permissions",
"version": "1.2.0",
"version": "1.3.0",
"source": {
"type": "git",
"url": "https://git.drupalcode.org/project/block_region_permissions.git",
"reference": "8.x-1.2"
"reference": "8.x-1.3"
},
"dist": {
"type": "zip",
"url": "https://ftp.drupal.org/files/projects/block_region_permissions-8.x-1.2.zip",
"reference": "8.x-1.2",
"shasum": "9776b2be5af7b9ebe7777f17487ef31e48f76c78"
"url": "https://ftp.drupal.org/files/projects/block_region_permissions-8.x-1.3.zip",
"reference": "8.x-1.3",
"shasum": "ae52eaf8e4186aa68f8cc151770030addc4b8742"
},
"require": {
"drupal/core": "~8.0"
"drupal/core": "^8 || ^9"
},
"type": "drupal-module",
"extra": {
"branch-alias": {
"dev-1.x": "1.x-dev"
},
"drupal": {
"version": "8.x-1.2",
"datestamp": "1507771445",
"version": "8.x-1.3",
"datestamp": "1592351316",
"security-coverage": {
"status": "not-covered",
"message": "Project has not opted into security advisory coverage!"
"status": "covered",
"message": "Covered by Drupal's security advisory policy"
}
}
},
......@@ -2612,7 +2608,7 @@
"description": "Adds specific permissions for administering blocks for each theme's regions.",
"homepage": "https://www.drupal.org/project/block_region_permissions",
"support": {
"source": "http://cgit.drupalcode.org/block_region_permissions"
"source": "https://git.drupalcode.org/project/block_region_permissions"
}
},
{
......@@ -4813,29 +4809,29 @@
},
{
"name": "drupal/field_group",
"version": "3.0.0",
"version": "3.1.0",
"source": {
"type": "git",
"url": "https://git.drupalcode.org/project/field_group.git",
"reference": "8.x-3.0"
"reference": "8.x-3.1"
},
"dist": {
"type": "zip",
"url": "https://ftp.drupal.org/files/projects/field_group-8.x-3.0.zip",
"reference": "8.x-3.0",
"shasum": "8d87cdc4abc417aa4d411bffcaeb0a3ef1afa497"
"url": "https://ftp.drupal.org/files/projects/field_group-8.x-3.1.zip",
"reference": "8.x-3.1",
"shasum": "8a719eaea594f0ba874172831cb28da93c66b77a"
},
"require": {
"drupal/core": "^8 || ^9"
"drupal/core": "^8.8 || ^9"
},
"require-dev": {
"drupal/jquery_ui_accordion": "^1.0"
},
"type": "drupal-module",
"extra": {
"branch-alias": {
"dev-3.x": "3.x-dev"
},
"drupal": {
"version": "8.x-3.0",
"datestamp": "1580250787",
"version": "8.x-3.1",
"datestamp": "1591772567",
"security-coverage": {
"status": "covered",
"message": "Covered by Drupal's security advisory policy"
......@@ -4844,7 +4840,7 @@
},
"notification-url": "https://packages.drupal.org/8/downloads",
"license": [
"GPL-2.0+"
"GPL-2.0-or-later"
],
"authors": [
{
......@@ -4871,7 +4867,8 @@
"description": "Provides the field_group module.",
"homepage": "https://www.drupal.org/project/field_group",
"support": {
"source": "https://git.drupalcode.org/project/field_group"
"source": "https://git.drupalcode.org/project/field_group",
"issues": "https://www.drupal.org/project/issues/field_group"
}
},
{
......@@ -8100,29 +8097,26 @@
},
{
"name": "drupal/views_autocomplete_filters",
"version": "1.2.0",
"version": "1.3.0",
"source": {
"type": "git",
"url": "https://git.drupalcode.org/project/views_autocomplete_filters.git",
"reference": "8.x-1.2"
"reference": "8.x-1.3"
},
"dist": {
"type": "zip",
"url": "https://ftp.drupal.org/files/projects/views_autocomplete_filters-8.x-1.2.zip",
"reference": "8.x-1.2",
"shasum": "bab27febe29aa69eff5c6b3ce3125e49685a6346"
"url": "https://ftp.drupal.org/files/projects/views_autocomplete_filters-8.x-1.3.zip",
"reference": "8.x-1.3",
"shasum": "55762182e55c70f117d5edb8692049e0881ec4ce"
},
"require": {
"drupal/core": "*"
"drupal/core": "^8 || ^9"
},
"type": "drupal-module",
"extra": {
"branch-alias": {
"dev-1.x": "1.x-dev"
},
"drupal": {
"version": "8.x-1.2",
"datestamp": "1500109743",
"version": "8.x-1.3",
"datestamp": "1587146330",
"security-coverage": {
"status": "covered",
"message": "Covered by Drupal's security advisory policy"
......@@ -8138,15 +8132,24 @@
"name": "RobLoach",
"homepage": "https://www.drupal.org/user/61114"
},
{
"name": "colan",
"homepage": "https://www.drupal.org/user/58704"
},
{
"name": "vasike",
"homepage": "https://www.drupal.org/user/156237"
}
],
"description": "Use Autocomplete for string field filters.",
"description": "Add autocomplete functionality to the views filter text fields.",
"homepage": "https://www.drupal.org/project/views_autocomplete_filters",
"keywords": [
"Drupal",
"views_autocomplete_filters"
],
"support": {
"source": "https://git.drupalcode.org/project/views_autocomplete_filters"
"source": "https://git.drupalcode.org/project/views_autocomplete_filters",
"issues": "https://www.drupal.org/project/issues/views_autocomplete_filters"
}
},
{
......
......@@ -2595,45 +2595,43 @@
},
{
"name": "drupal/block_permissions",
"version": "1.0.0",
"version_normalized": "1.0.0.0",
"version": "1.1.0",
"version_normalized": "1.1.0.0",
"source": {
"type": "git",
"url": "https://git.drupalcode.org/project/block_permissions.git",
"reference": "8.x-1.0"
"reference": "8.x-1.1"
},
"dist": {
"type": "zip",
"url": "https://ftp.drupal.org/files/projects/block_permissions-8.x-1.0.zip",
"reference": "8.x-1.0",
"shasum": "3f1cb219379fc88a80445d494f66dd4fb2a5befa"
"url": "https://ftp.drupal.org/files/projects/block_permissions-8.x-1.1.zip",
"reference": "8.x-1.1",
"shasum": "734c00f78dfb674294b2d35bc87fcaed7ecf2042"
},
"require": {
"drupal/core": "~8.0"
"drupal/core": "^8 || ^9"
},
"type": "drupal-module",
"extra": {
"branch-alias": {
"dev-1.x": "1.x-dev"
},
"drupal": {
"version": "8.x-1.0",
"datestamp": "1478790983",
"version": "8.x-1.1",
"datestamp": "1592480089",
"security-coverage": {
"status": "covered",
"message": "Covered by Drupal's security advisory policy"
}
},
"patches_applied": {
"2962965": "https://www.drupal.org/files/issues/2018-09-01/block-permissions-2962965-4.patch"
}
},
"installation-source": "dist",
"notification-url": "https://packages.drupal.org/8/downloads",
"license": [
"GPL-2.0-or-later"
"GPL-2.0+"
],
"authors": [
{
"name": "Steven Buteneers",
"homepage": "https://www.drupal.org/user/3301055"
},
{
"name": "jefuri",
"homepage": "https://www.drupal.org/user/2733365"
......@@ -2646,38 +2644,36 @@
"description": "Adds specific permissions for administering blocks.",
"homepage": "https://www.drupal.org/project/block_permissions",
"support": {
"source": "http://cgit.drupalcode.org/block_permissions"
"source": "http://cgit.drupalcode.org/block_permissions",
"issues": "https://www.drupal.org/project/issues/block_permissions?version=8.x"
}
},
{
"name": "drupal/block_region_permissions",
"version": "1.2.0",
"version_normalized": "1.2.0.0",
"version": "1.3.0",
"version_normalized": "1.3.0.0",
"source": {
"type": "git",
"url": "https://git.drupalcode.org/project/block_region_permissions.git",
"reference": "8.x-1.2"
"reference": "8.x-1.3"
},
"dist": {
"type": "zip",
"url": "https://ftp.drupal.org/files/projects/block_region_permissions-8.x-1.2.zip",
"reference": "8.x-1.2",
"shasum": "9776b2be5af7b9ebe7777f17487ef31e48f76c78"
"url": "https://ftp.drupal.org/files/projects/block_region_permissions-8.x-1.3.zip",
"reference": "8.x-1.3",
"shasum": "ae52eaf8e4186aa68f8cc151770030addc4b8742"
},
"require": {
"drupal/core": "~8.0"
"drupal/core": "^8 || ^9"
},
"type": "drupal-module",
"extra": {
"branch-alias": {
"dev-1.x": "1.x-dev"
},
"drupal": {
"version": "8.x-1.2",
"datestamp": "1507771445",
"version": "8.x-1.3",
"datestamp": "1592351316",
"security-coverage": {
"status": "not-covered",
"message": "Project has not opted into security advisory coverage!"
"status": "covered",
"message": "Covered by Drupal's security advisory policy"
}
}
},
......@@ -2695,7 +2691,7 @@
"description": "Adds specific permissions for administering blocks for each theme's regions.",
"homepage": "https://www.drupal.org/project/block_region_permissions",
"support": {
"source": "http://cgit.drupalcode.org/block_region_permissions"
"source": "https://git.drupalcode.org/project/block_region_permissions"
}
},
{
......@@ -4955,30 +4951,30 @@
},
{
"name": "drupal/field_group",
"version": "3.0.0",
"version_normalized": "3.0.0.0",
"version": "3.1.0",
"version_normalized": "3.1.0.0",
"source": {
"type": "git",
"url": "https://git.drupalcode.org/project/field_group.git",
"reference": "8.x-3.0"
"reference": "8.x-3.1"
},
"dist": {
"type": "zip",
"url": "https://ftp.drupal.org/files/projects/field_group-8.x-3.0.zip",
"reference": "8.x-3.0",
"shasum": "8d87cdc4abc417aa4d411bffcaeb0a3ef1afa497"
"url": "https://ftp.drupal.org/files/projects/field_group-8.x-3.1.zip",
"reference": "8.x-3.1",
"shasum": "8a719eaea594f0ba874172831cb28da93c66b77a"
},
"require": {
"drupal/core": "^8 || ^9"
"drupal/core": "^8.8 || ^9"
},
"require-dev": {
"drupal/jquery_ui_accordion": "^1.0"
},
"type": "drupal-module",
"extra": {
"branch-alias": {
"dev-3.x": "3.x-dev"
},
"drupal": {
"version": "8.x-3.0",
"datestamp": "1580250787",
"version": "8.x-3.1",
"datestamp": "1591772567",
"security-coverage": {
"status": "covered",
"message": "Covered by Drupal's security advisory policy"
......@@ -4988,7 +4984,7 @@
"installation-source": "dist",
"notification-url": "https://packages.drupal.org/8/downloads",
"license": [
"GPL-2.0+"
"GPL-2.0-or-later"
],
"authors": [
{
......@@ -5015,7 +5011,8 @@
"description": "Provides the field_group module.",
"homepage": "https://www.drupal.org/project/field_group",
"support": {
"source": "https://git.drupalcode.org/project/field_group"
"source": "https://git.drupalcode.org/project/field_group",
"issues": "https://www.drupal.org/project/issues/field_group"
}
},
{
......@@ -8352,30 +8349,27 @@
},
{
"name": "drupal/views_autocomplete_filters",
"version": "1.2.0",
"version_normalized": "1.2.0.0",
"version": "1.3.0",
"version_normalized": "1.3.0.0",
"source": {
"type": "git",
"url": "https://git.drupalcode.org/project/views_autocomplete_filters.git",
"reference": "8.x-1.2"
"reference": "8.x-1.3"
},
"dist": {
"type": "zip",
"url": "https://ftp.drupal.org/files/projects/views_autocomplete_filters-8.x-1.2.zip",
"reference": "8.x-1.2",
"shasum": "bab27febe29aa69eff5c6b3ce3125e49685a6346"
"url": "https://ftp.drupal.org/files/projects/views_autocomplete_filters-8.x-1.3.zip",
"reference": "8.x-1.3",
"shasum": "55762182e55c70f117d5edb8692049e0881ec4ce"
},
"require": {
"drupal/core": "*"
"drupal/core": "^8 || ^9"
},
"type": "drupal-module",
"extra": {
"branch-alias": {
"dev-1.x": "1.x-dev"
},
"drupal": {
"version": "8.x-1.2",
"datestamp": "1500109743",
"version": "8.x-1.3",
"datestamp": "1587146330",
"security-coverage": {
"status": "covered",
"message": "Covered by Drupal's security advisory policy"
......@@ -8392,15 +8386,24 @@
"name": "RobLoach",
"homepage": "https://www.drupal.org/user/61114"
},
{
"name": "colan",
"homepage": "https://www.drupal.org/user/58704"
},
{
"name": "vasike",
"homepage": "https://www.drupal.org/user/156237"
}
],
"description": "Use Autocomplete for string field filters.",
"description": "Add autocomplete functionality to the views filter text fields.",
"homepage": "https://www.drupal.org/project/views_autocomplete_filters",
"keywords": [
"Drupal",
"views_autocomplete_filters"
],
"support": {
"source": "https://git.drupalcode.org/project/views_autocomplete_filters"
"source": "https://git.drupalcode.org/project/views_autocomplete_filters",
"issues": "https://www.drupal.org/project/issues/views_autocomplete_filters"
}
},
{
......
......@@ -2,10 +2,10 @@ name: 'Block permissions'
type: module
description: 'Adds specific permissions for administering blocks.'
package: Block
# core: '8.x'
# Information added by Drupal.org packaging script on 2016-11-10
version: '8.x-1.0'
core: '8.x'
core_version_requirement: ^8 || ^9
# Information added by Drupal.org packaging script on 2020-06-18
version: '8.x-1.1'
project: 'block_permissions'
datestamp: 1478790984
datestamp: 1592480090
{
"name": "drupal/block_permissions",
"type": "drupal-module",
"description": "Adds specific permissions for administering blocks.",
"homepage": "https://www.drupal.org/project/block_permissions",
"support": {
"issues": "https://www.drupal.org/project/issues/block_permissions?version=8.x",
"source": "http://cgit.drupalcode.org/block_permissions"
},
"license": "GPL-2.0+"
}
......@@ -63,10 +63,10 @@ public function permissions() {
// administration per theme.
$themes = $this->themeHandler->listInfo();
foreach ($themes as $key => $theme) {
if (isset($theme->info['hidden']) && $theme->status == 1 && $theme->info['hidden'] != 1) {
if ($theme->status == 1 && (!isset($theme->info['hidden']) || $theme->info['hidden'] != 1)) {
$permissions['administer block settings for theme ' . $key] = [
'title' => $this->t('Administer block settings for the theme @label', ['@label' => ucfirst($theme->getName())]),
'description' => $this->t('This permission s the administer blocks permission.'),
'description' => $this->t('This permission refines the administer blocks permission.'),
];
}
}
......
......@@ -2,10 +2,10 @@ name: Block Region Permissions
description: "Adds specific permissions for administering blocks for each theme's regions."
package: Block
type: module
# core: 8.x
core: 8.x
core_version_requirement: ^8 || ^9
# Information added by Drupal.org packaging script on 2017-10-12
version: '8.x-1.2'
core: '8.x'
# Information added by Drupal.org packaging script on 2020-06-16
version: '8.x-1.3'
project: 'block_region_permissions'
datestamp: 1507771447
datestamp: 1592351318
......@@ -2,9 +2,16 @@
"name": "drupal/field_group",
"description": "Provides the field_group module.",
"type": "drupal-module",
"license": "GPL-2.0+",
"license": "GPL-2.0-or-later",
"minimum-stability": "dev",
"require": {
"drupal/core": "^8 || ^9"
"drupal/core": "^8.8 || ^9"
},
"require-dev": {
"drupal/jquery_ui_accordion": "^1.0"
},
"support": {
"issues": "https://www.drupal.org/project/issues/field_group",
"source": "https://git.drupalcode.org/project/field_group"
}
}
......@@ -2,11 +2,11 @@ name: 'Field Group Migrate'
type: module
description: 'Provides the ability to migrate field groups from D6/D7 to D8.'
package: Migration
core: 8.x
core_version_requirement: ^8.8 || ^9
dependencies:
- field_group:field_group
# Information added by Drupal.org packaging script on 2020-01-28
version: '8.x-3.0'
# Information added by Drupal.org packaging script on 2020-06-10
version: '8.x-3.1'
project: 'field_group'
datestamp: 1580250789
datestamp: 1591772570
......@@ -88,8 +88,8 @@ public function fields(MigrationInterface $migration = NULL) {
* The entity display object.
*/
protected function getEntity($entity_type, $bundle, $mode, $type) {
$function = $type == 'entity_form_display' ? 'entity_get_form_display' : 'entity_get_display';
return $function($entity_type, $bundle, $mode);
$function = $type == 'entity_form_display' ? 'getFormDisplay' : 'getViewDisplay';
return \Drupal::service('entity_display.repository')->$function($entity_type, $bundle, $mode);
}
}
......@@ -2,12 +2,11 @@ name: 'Field Group'
type: module
description: 'Provides the ability to group your fields on both form and display.'
package : Fields
core: 8.x
core_version_requirement: ^8 || ^9
core_version_requirement: ^8.8 || ^9
dependencies:
- drupal:field
# Information added by Drupal.org packaging script on 2020-01-28
version: '8.x-3.0'
# Information added by Drupal.org packaging script on 2020-06-10
version: '8.x-3.1'
project: 'field_group'
datestamp: 1580250789
datestamp: 1591772570
......@@ -5,9 +5,59 @@
* Update hooks for the Field Group module.
*/
/**
* Implements hook_requirements().
*/
function field_group_requirements($phase) {
$requirements = [];
if ($phase == 'runtime') {
// Check jQuery UI Accordion module for D9.
if (version_compare(\Drupal::VERSION, 9) > 0) {
if (!\Drupal::moduleHandler()->moduleExists('jquery_ui_accordion')) {
$requirements['field_group_jquery_ui_accordion'] = [
'title' => t('Field Group'),
'value' => t('jQuery UI Accordion not enabled'),
'description' => t('If you want to use the Field Group accordion formatter, you will need to install the <a href=":link" target="_blank">jQuery UI Accordion</a> module.', [':link' => 'https://www.drupal.org/project/jquery_ui_accordion']),
'severity' => REQUIREMENT_WARNING,
];
}
else {
$requirements['field_group_jquery_ui_accordion'] = [
'title' => t('Field Group'),
'description' => t('The jQuery UI Accordion module is installed'),
'severity' => REQUIREMENT_INFO,
];
}
}
}
return $requirements;
}
/**
* Removed in favor of hook_post_update script.
*/
function field_group_update_8301() {
// @see field_group_post_update_0001().
}
/**
* Install the 'jquery_ui_accordion' module if it exists.
*/
function field_group_update_8302() {
try {
// Enables the jQuery UI accordion module if it exists.
if (\Drupal::service('extension.list.module')
->getName('jquery_ui_accordion')) {
\Drupal::service('module_installer')
->install(['jquery_ui_accordion'], FALSE);
return t('The "jquery_ui_accordion" module has been installed.');
}
}
catch (\Exception $e) {
return
t('If you want to use the Field Group accordion formatter, you will need to install the <a href=":link" target="_blank">jQuery UI Accordion</a> module.',
[':link' => 'https://www.drupal.org/project/jquery_ui_accordion']);
}
}
......@@ -16,6 +16,7 @@
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Render\Element;
use Drupal\field_group\Element\VerticalTabs;
use Drupal\field_group\FormatterHelper;
/**
* Implements hook_help().
......@@ -32,6 +33,24 @@ function field_group_help($route_name, RouteMatchInterface $route_match) {
}
}
/**
* Implements hook_library_info_alter().
*/
function field_group_library_info_alter(&$libraries, $extension) {
// Swap jQuery.ui library if available.
// See https://www.drupal.org/project/field_group/issues/3109552 for more
// background on the logic.
if (version_compare(\Drupal::VERSION, 9) > 0 && $extension == 'field_group') {
if (\Drupal::moduleHandler()->moduleExists('jquery_ui_accordion')) {
$libraries['formatter.accordion']['dependencies'] = ['jquery_ui_accordion/accordion'];
}
else {
$libraries['formatter.accordion']['js'] = [];
$libraries['formatter.accordion']['dependencies'] = [];
}
}
}
/**
* Implements hook_theme_registry_alter().
*/
......@@ -235,7 +254,7 @@ function field_group_form_alter(array &$form, FormStateInterface $form_state) {
];
field_group_attach_groups($form, $context);
$form['#process'][] = 'field_group_form_process';
$form['#process'][] = [FormatterHelper::class, 'formProcess'];
}
}
......@@ -256,7 +275,7 @@ function field_group_inline_entity_form_entity_form_alter(&$entity_form, FormSta
];
field_group_attach_groups($entity_form, $context);
field_group_form_process($entity_form);
FormatterHelper::formProcess($entity_form, $form_state);
}
/**
......@@ -277,7 +296,7 @@ function field_group_form_layout_builder_update_block_alter(&$form, FormStateInt
];
field_group_attach_groups($form['settings']['block_form'], $context);
$form['settings']['block_form']['#process'][] = 'field_group_form_process';
$form['settings']['block_form']['#process'][] = [FormatterHelper::class, 'formProcess'];
}
/**
......@@ -317,7 +336,7 @@ function field_group_entity_view_alter(&$build, EntityInterface $entity, EntityD
// If DS is enabled, no pre render is needed (DS adds fieldgroup preprocessing).
if (!$ds_enabled) {
$build['#pre_render'][] = 'field_group_entity_view_pre_render';
$build['#pre_render'][] = [FormatterHelper::class, 'entityViewPrender'];
}
}
}
......@@ -349,72 +368,7 @@ function field_group_form_pre_render(array $element) {
* @return array
*/
function field_group_form_process(array &$element, FormStateInterface $form_state = NULL, array &$form = []) {
if (empty($element['#field_group_form_process'])) {
$element['#field_group_form_process'] = TRUE;
if (empty($element['#fieldgroups'])) {
return $element;
}
// Create all groups and keep a flat list of references to these groups.
$group_references = [];
foreach ($element['#fieldgroups'] as $group_name => $group) {
if (!isset($element[$group_name])) {
$element[$group_name] = [];
}
$group_parents = $element['#array_parents'];
$group_parents[] = empty($group->parent_name) ? $group->region : $group->parent_name;
$group_references[$group_name] = &$element[$group_name];
$element[$group_name]['#group'] = implode('][', $group_parents);
// Use array parents to set the group name. This will cover multilevel forms (eg paragraphs).
$parents = $element['#array_parents'];
$parents[] = $group_name;
$element[$group_name]['#parents'] = $parents;
$group_children_parent_group = implode('][', $parents);
foreach ($group->children as $child) {
if (!empty($element[$child]['#field_group_ignore'])) {
continue;
}
$element[$child]['#group'] = $group_children_parent_group;
}
}
foreach ($element['#fieldgroups'] as $group_name => $group) {
$field_group_element = &$element[$group_name];
// Let modules define their wrapping element.
// Note that the group element has no properties, only elements.
foreach (Drupal::moduleHandler()->getImplementations('field_group_form_process') as $module) {
// The intention here is to have the opportunity to alter the
// elements, as defined in hook_field_group_formatter_info.
// Note, implement $element by reference!
$function = $module . '_field_group_form_process';
$function($field_group_element, $group, $element);
}
// Allow others to alter the pre_render.
Drupal::moduleHandler()->alter('field_group_form_process', $field_group_element, $group, $element);
}
// Allow others to alter the complete processed build.
Drupal::moduleHandler()->alter('field_group_form_process_build', $element, $form_state, $form);
}
return $element;
}
/**
* Pre render callback for rendering groups on entities without theme hook.
*
* @param array $element
* Entity being rendered.
*
* @return array
*/
function field_group_entity_view_pre_render(array $element) {
field_group_build_entity_groups($element, 'view');
return $element;
return FormatterHelper::formProcess($element, $form_state, $form);
}
/**
......
......@@ -31,6 +31,7 @@
padding: 0 1em;
border: 0;
background-color: unset;
box-shadow: unset;
}
.horizontal-tabs-pane > summary {
......
(function ($) {
(function ($, Drupal) {
'use strict';
......@@ -56,9 +56,9 @@
summaryElement = $this.find('> summary');
}
var summary = summaryElement.clone().children().remove().end().text();
var summaryText = summaryElement.clone().children().remove().end().text().trim() || summaryElement.find('> span:first-child').text().trim();
var horizontal_tab = new Drupal.horizontalTab({
title: $.trim(summary),
title: summaryText,
details: $this
});
horizontal_tab.item.addClass('horizontal-tab-button-' + i);
......@@ -178,7 +178,6 @@
// Display the tab.
this.item.removeClass('horizontal-tab-hidden');
this.item.show();
alert('show');
// Update .first marker for items. We need recurse from parent to retain the
// actual DOM element order as jQuery implements sortOrder, but not as public
......@@ -201,7 +200,6 @@
// Hide this tab.
this.item.addClass('horizontal-tab-hidden');
this.item.hide();
alert('hide');
// Update .first marker for items. We need recurse from parent to retain the
// actual DOM element order as jQuery implements sortOrder, but not as public
......@@ -253,4 +251,4 @@
return tab;
};
})(jQuery, Modernizr);
})(jQuery, Drupal);
......@@ -167,7 +167,6 @@ function field_group_field_ui_display_form_alter(&$form, FormStateInterface $for
$settings = field_group_format_settings_form($group, $form, $form_state);
$id = strtr($name, '_', '-');
$js_rows_data[$id] = ['type' => 'group', 'name' => $name];
// A group cannot be selected as its own parent.
$parent_options = $table['#parent_options'];
$region = isset($group->region) && in_array($group->region, $params->available_regions) ? $group->region : $params->default_region;
......
......@@ -4,11 +4,12 @@
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Render\Element;
use Drupal\Core\Render\Element\RenderCallbackInterface;
/**
* Provides extra processing and pre rendering on the vertical tabs.
*/
class VerticalTabs {
class VerticalTabs implements RenderCallbackInterface {
/**
* Pre render the group to support #group parameter.
......
......@@ -90,13 +90,13 @@ public function settingsForm() {
$form = [];
$form['label'] = [
'#type' => 'textfield',
'#title' => t('Field group label'),
'#title' => $this->t('Field group label'),
'#default_value' => $this->label,
'#weight' => -5,
];
$form['id'] = [
'#title' => t('ID'),
'#title' => $this->t('ID'),
'#type' => 'textfield',
'#default_value' => $this->getSetting('id'),
'#weight' => 10,
......@@ -104,7 +104,7 @@ public function settingsForm() {
];
$form['classes'] = [
'#title' => t('Extra CSS classes'),
'#title' => $this->t('Extra CSS classes'),
'#type' => 'textfield',
'#default_value' => $this->getSetting('classes'),
'#weight' => 11,
......
......@@ -212,7 +212,7 @@ public function buildConfigurationForm(array &$form, FormStateInterface $form_st
$group->bundle = $this->bundle;
$group->mode = $this->mode;
$manager = \Drupal::service('plugin.manager.field_group.formatters');
$manager = $this->fieldGroupFormatterPluginManager;
$plugin = $manager->getInstance([
'format_type' => $form_state->getValue('group_formatter'),
'configuration' => [
......@@ -285,7 +285,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
// Store new group information for any additional submit handlers.
$groups_added = $form_state->get('groups_added');
$groups_added['_add_new_group'] = $new_group->group_name;
$this->messenger->addMessage(t('New group %label successfully created.', ['%label' => $new_group->label]));
$this->messenger->addMessage($this->t('New group %label successfully created.', ['%label' => $new_group->label]));
$form_state->setRedirectUrl(FieldgroupUi::getFieldUiRoute($new_group));
\Drupal::cache()->invalidate('field_groups');
......
......@@ -82,7 +82,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
field_group_delete_field_group($this->fieldGroup);
$this->messenger->addMessage(t('The group %group has been deleted from the %type content type.', ['%group' => t($this->fieldGroup->label), '%type' => $bundle_label]));
$this->messenger->addMessage($this->t('The group %group has been deleted from the %type content type.', ['%group' => $this->fieldGroup->label, '%type' => $bundle_label]));
// Redirect.
$form_state->setRedirectUrl($this->getCancelUrl());
......@@ -93,7 +93,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
* {@inheritdoc}
*/
public function getQuestion() {
return $this->t('Are you sure you want to delete the group %group?', ['%group' => t($this->fieldGroup->label)]);
return $this->t('Are you sure you want to delete the group %group?', ['%group' => $this->fieldGroup->label]);
}
/**
......
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