diff --git a/src/DisplayBase.php b/src/DisplayBase.php index 81ae755..f2c2569 100644 --- a/src/DisplayBase.php +++ b/src/DisplayBase.php @@ -44,7 +44,7 @@ abstract class DisplayBase extends PluginBase implements DisplayInterface, Conta protected $uuidGenerator; /** - * Instance UIID string. + * Instance UUID string. * * @var string */ diff --git a/src/Form/EntityBrowserForm.php b/src/Form/EntityBrowserForm.php index b7a86a9..a13d11d 100644 --- a/src/Form/EntityBrowserForm.php +++ b/src/Form/EntityBrowserForm.php @@ -7,6 +7,8 @@ use Drupal\Core\Form\FormStateInterface; use Drupal\entity_browser\DisplayAjaxInterface; use Drupal\entity_browser\EntityBrowserFormInterface; use Drupal\entity_browser\EntityBrowserInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\HttpFoundation\Request; /** * The entity browser form. @@ -14,13 +16,6 @@ use Drupal\entity_browser\EntityBrowserInterface; class EntityBrowserForm extends FormBase implements EntityBrowserFormInterface { /** - * The entity browser object. - * - * @var \Drupal\entity_browser\EntityBrowserInterface - */ - protected $entity_browser; - - /** * {@inheritdoc} */ public function getFormId() { @@ -43,11 +38,11 @@ class EntityBrowserForm extends FormBase implements EntityBrowserFormInterface { protected function init(FormStateInterface $form_state) { // Flag that this form has been initialized. $form_state->set('entity_form_initialized', TRUE); - if (empty($_GET['uuid'])) { - $form_state->set(['entity_browser', 'instance_uuid'], \Drupal::service('uuid')->generate()); + if (\Drupal::request()->query->has('uuid')) { + $form_state->set(['entity_browser', 'instance_uuid'], \Drupal::request()->query->get('uuid')); } else { - $form_state->set(['entity_browser', 'instance_uuid'], $_GET['uuid']); + $form_state->set(['entity_browser', 'instance_uuid'], \Drupal::service('uuid')->generate()); } $form_state->set(['entity_browser', 'selected_entities'], []); $form_state->set(['entity_browser', 'selection_completed'], FALSE); diff --git a/src/Plugin/EntityBrowser/Display/Standalone.php b/src/Plugin/EntityBrowser/Display/Standalone.php index 848894f..9b8fbc6 100644 --- a/src/Plugin/EntityBrowser/Display/Standalone.php +++ b/src/Plugin/EntityBrowser/Display/Standalone.php @@ -1,9 +1,5 @@