Skip to content

Commit

Permalink
Merge branch '16457-updatepatch-entity_browser-module'
Browse files Browse the repository at this point in the history
  • Loading branch information
Edmund Dunn committed Jan 5, 2024
2 parents a38353e + aef0c13 commit 3955cf7
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 46 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,8 @@
"3191302 - Make modal iframe tab accessible": "https://www.drupal.org/files/issues/2021-01-07/3191302-3.patch"
},
"drupal/entity_browser_table": {
"3194622 - Custom field validation should not be applied to remove button": "https://www.drupal.org/files/issues/2021-01-25/limit-remove-button-validators.patch"
"3194622 - Custom field validation should not be applied to remove button": "https://www.drupal.org/files/issues/2021-01-25/limit-remove-button-validators.patch",
"3408217 - Error: Call to a member function getStorage() on null": "https://www.drupal.org/files/issues/2023-12-21/3408217-error-call-to-member-function-getstorage-on-null.patch"
},
"drupal/entity_clone": {
"3112577 - Cloning child references to nodes has potential to cause memory resource issues": "https://www.drupal.org/files/issues/2020-02-10/entity_clone-child-node-system-drain-3112577-1.patch"
Expand Down
55 changes: 28 additions & 27 deletions composer.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2241,10 +2241,6 @@
"name": "dww",
"homepage": "https://www.drupal.org/user/46549"
},
{
"name": "googletorp",
"homepage": "https://www.drupal.org/user/386230"
},
{
"name": "jsacksick",
"homepage": "https://www.drupal.org/user/972218"
Expand Down Expand Up @@ -4973,6 +4969,10 @@
"homepage": "https://www.drupal.org/u/greg-boggs",
"role": "Maintainer"
},
{
"name": "Greg Boggs",
"homepage": "https://www.drupal.org/user/153069"
},
{
"name": "hmartens",
"homepage": "https://www.drupal.org/user/622826"
Expand Down Expand Up @@ -5138,35 +5138,39 @@
},
{
"name": "drupal/entity_browser",
"version": "2.9.0",
"version": "2.10.0",
"source": {
"type": "git",
"url": "https://git.drupalcode.org/project/entity_browser.git",
"reference": "8.x-2.9"
"reference": "8.x-2.10"
},
"dist": {
"type": "zip",
"url": "https://ftp.drupal.org/files/projects/entity_browser-8.x-2.9.zip",
"reference": "8.x-2.9",
"shasum": "251afad80cde9fa547501a8d9de5d94b9f5bacff"
"url": "https://ftp.drupal.org/files/projects/entity_browser-8.x-2.10.zip",
"reference": "8.x-2.10",
"shasum": "d52548ea66dc56108c2e211aeaff6e1cc0522e85"
},
"require": {
"drupal/core": "^9.2 || ^10"
"drupal/core": "^9.5 || ^10"
},
"conflict": {
"drupal/media_entity": "1.*"
},
"require-dev": {
"drupal/embed": "~1.0",
"drupal/entity_embed": "1.x-dev",
"drupal/entity_reference_revisions": "1.x-dev",
"drupal/entityqueue": "1.x-dev",
"drupal/inline_entity_form": "1.x-dev",
"drupal/paragraphs": "1.x-dev",
"drupal/token": "1.x-dev"
"drupal/ckeditor": "^1.0",
"drupal/embed": "^1.0",
"drupal/entity_embed": "^1.0",
"drupal/entity_reference_revisions": "^1.0",
"drupal/entityqueue": "^1.0",
"drupal/inline_entity_form": "^1.0@rc",
"drupal/paragraphs": "^1.0",
"drupal/token": "^1.0"
},
"type": "drupal-module",
"extra": {
"drupal": {
"version": "8.x-2.9",
"datestamp": "1674070933",
"version": "8.x-2.10",
"datestamp": "1702325310",
"security-coverage": {
"status": "covered",
"message": "Covered by Drupal's security advisory policy"
Expand Down Expand Up @@ -5219,7 +5223,7 @@
}
],
"description": "Entity browsing and selecting component.",
"homepage": "http://drupal.org/project/entity_browser",
"homepage": "https://drupal.org/project/entity_browser",
"support": {
"source": "https://git.drupalcode.org/project/entity_browser",
"issues": "https://www.drupal.org/project/issues/entity_browser",
Expand Down Expand Up @@ -14372,12 +14376,9 @@
},
"require": {
"php": "^8.0",
"php-http/client-implementation": "^1.0",
"php-http/discovery": "^1.6",
"php-http/httplug": "^1.0 || ^2.0",
"php-http/message-factory": "^1.0.2",
"psr/http-message": "^1.0 || ^2.0",
"psr/http-message-implementation": "^1.0",
"php-http/discovery": "^1.17",
"psr/http-client-implementation": "^1.0",
"psr/http-factory-implementation": "^1.0",
"willdurand/geocoder": "^4.0"
},
"require-dev": {
Expand Down Expand Up @@ -14418,7 +14419,7 @@
"http geocoder"
],
"support": {
"source": "https://github.com/geocoder-php/php-common-http/tree/master"
"source": "https://github.com/geocoder-php/php-common-http/tree/4.6.0"
},
"time": "2023-07-31T20:07:24+00:00"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
diff --git a/src/Plugin/Field/FieldWidget/EntityReferenceBrowserTableWidget.php b/src/Plugin/Field/FieldWidget/EntityReferenceBrowserTableWidget.php
index 177fda745f27e21d6377025e50b2caee9f28894a..af1f8b00834c9d9fadf9314a26c67769732d1694 100644
--- a/src/Plugin/Field/FieldWidget/EntityReferenceBrowserTableWidget.php
+++ b/src/Plugin/Field/FieldWidget/EntityReferenceBrowserTableWidget.php
@@ -4,19 +4,10 @@ namespace Drupal\entity_browser_table\Plugin\Field\FieldWidget;

use Drupal\Component\Plugin\Exception\PluginException;
use Drupal\Component\Utility\Html;
-use Drupal\content_moderation\ModerationInformation;
use Drupal\Core\Entity\EntityInterface;
-use Drupal\Core\Entity\EntityTypeBundleInfo;
-use Drupal\Core\Entity\EntityTypeManagerInterface;
-use Drupal\Core\Extension\ModuleHandlerInterface;
-use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Form\FormStateInterface;
-use Drupal\Core\Language\LanguageManagerInterface;
-use Drupal\Core\Messenger\MessengerInterface;
-use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Url;
-use Drupal\entity_browser\FieldWidgetDisplayManager;
use Drupal\entity_browser\Plugin\Field\FieldWidget\EntityReferenceBrowserWidget;
use Symfony\Component\DependencyInjection\ContainerInterface;

@@ -47,55 +38,13 @@ class EntityReferenceBrowserTableWidget extends EntityReferenceBrowserWidget {
protected $moderationInfo;

public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
-
- return new static(
- $plugin_id,
- $plugin_definition,
- $configuration['field_definition'],
- $configuration['settings'],
- $configuration['third_party_settings'],
- $container->get('entity_type.manager'),
- $container->get('plugin.manager.entity_browser.field_widget_display'),
- $container->get('module_handler'),
- $container->get('current_user'),
- $container->get('messenger'),
- $container->get('language_manager'),
- $container->get('entity_type.bundle.info'),
- $container->has('content_moderation.moderation_information')
- ? $container->get('content_moderation.moderation_information')
- : NULL
- );
- }
-
- public function __construct(
- $plugin_id,
- array $plugin_definition,
- FieldDefinitionInterface $field_definition,
- array $settings,
- array $third_party_settings,
- EntityTypeManagerInterface $entity_type_manager,
- FieldWidgetDisplayManager $field_display_manager,
- ModuleHandlerInterface $module_handler,
- AccountInterface $current_user,
- MessengerInterface $messenger,
- LanguageManagerInterface $languageManager,
- EntityTypeBundleInfo $bundleInfo,
- ModerationInformation $moderationInformation = NULL) {
- parent::__construct(
- $plugin_id,
- $plugin_definition,
- $field_definition,
- $settings,
- $third_party_settings,
- $entity_type_manager,
- $field_display_manager,
- $module_handler,
- $current_user,
- $messenger
- );
- $this->currentLanguage = $languageManager->getCurrentLanguage()->getId();
- $this->entityBundleInfo = $bundleInfo;
- $this->moderationInfo = $moderationInformation;
+ $instance = parent::create($container, $configuration, $plugin_id, $plugin_definition);
+ $instance->currentLanguage = $container->get('language_manager')->getCurrentLanguage()->getId();
+ $instance->entityBundleInfo = $container->get('entity_type.bundle.info');
+ $instance->moderationInfo = $container->has('content_moderation.moderation_information')
+ ? $container->get('content_moderation.moderation_information')
+ : NULL;
+ return $instance;
}

/**

This file was deleted.

0 comments on commit 3955cf7

Please sign in to comment.