Loading js/linky-widget.js +2 −4 Original line number Diff line number Diff line Loading @@ -26,12 +26,10 @@ } Object.keys(drupalSettings.dynamic_entity_reference).forEach(function (field_class) { $(context) .find('.' + field_class) .once('linky') .find(once('linky', '.' + field_class, context)) .on('change', {select: field_class}, linkyWidget); $(context) .find('.' + field_class) .once('linky-title') .find(once('linky-title', '.' + field_class, context)) .each(function() { var $el = $(this); var $autocomplete = $el.parents('.container-inline').find('.form-autocomplete'); Loading src/Plugin/EntityReferenceSelection/LinkySelection.php +1 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ class LinkySelection extends DefaultSelection { $entity_type = $this->entityTypeManager->getDefinition($target_type); $query = $this->entityTypeManager->getStorage($target_type)->getQuery(); $query->accessCheck(TRUE); // If 'target_bundles' is NULL, all bundles are referenceable, no further // conditions are needed. Loading tests/src/Functional/LinkyFunctionalTest.php +7 −3 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ class LinkyFunctionalTest extends BrowserTestBase { /** * {@inheritdoc} */ public static $modules = [ protected static $modules = [ 'link', 'linky', 'user', Loading Loading @@ -64,7 +64,7 @@ class LinkyFunctionalTest extends BrowserTestBase { /** * Sets the test up. */ protected function setUp() { protected function setUp(): void { parent::setUp(); // Test admin user. $this->adminUser = $this->drupalCreateUser($this->permissions); Loading Loading @@ -126,7 +126,11 @@ class LinkyFunctionalTest extends BrowserTestBase { * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException */ protected function getMostRecentlyCreatedLinky() { $results = \Drupal::entityQuery('linky')->sort('id', 'DESC')->range(0, 1)->execute(); $results = \Drupal::entityQuery('linky') ->sort('id', 'DESC') ->range(0, 1) ->accessCheck(FALSE) ->execute(); $id = array_shift($results); return \Drupal::entityTypeManager()->getStorage('linky')->load($id); } Loading tests/src/Functional/Update/LinkyRevisionableUpdateTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ class LinkyRevisionableUpdateTest extends UpdatePathTestBase { */ public function setDatabaseDumpFiles() { $this->databaseDumpFiles = [ DRUPAL_ROOT . '/core/modules/system/tests/fixtures/update/drupal-8.8.0.bare.standard.php.gz', DRUPAL_ROOT . '/core/modules/system/tests/fixtures/update/drupal-9.4.0.bare.standard.php.gz', __DIR__ . '/../../../fixtures/update/linky-convert-linky-entity-to-revisionable-3052102.php', ]; } Loading tests/src/FunctionalJavascript/LinkyFunctionalTest.php +4 −7 Original line number Diff line number Diff line Loading @@ -53,7 +53,7 @@ class LinkyFunctionalTest extends WebDriverTestBase { /** * {@inheritdoc} */ public static $modules = [ protected static $modules = [ 'link', 'linky', 'user', Loading Loading @@ -88,7 +88,7 @@ class LinkyFunctionalTest extends WebDriverTestBase { /** * Sets the test up. */ protected function setUp() { protected function setUp(): void { parent::setUp(); // Test admin user. $this->adminUser = $this->drupalCreateUser($this->permissions); Loading Loading @@ -323,11 +323,8 @@ class LinkyFunctionalTest extends WebDriverTestBase { */ protected function performAutocompleteQuery($autocomplete_query, NodeElement $autocomplete_field) { $autocomplete_field->setValue($autocomplete_query); $this->getSession()->getDriver()->keyDown($autocomplete_field->getXpath(), ' '); // Wait for ajax. $this->assertJsCondition('(typeof(jQuery)=="undefined" || (0 === jQuery.active && 0 === jQuery(\'.ui-autocomplete-loading\').length))', 20000); // And autocomplete selection. $this->assertJsCondition('jQuery(".ui-autocomplete.ui-menu li.ui-menu-item:visible").length > 0', 5000); $autocomplete_field->keyDown(' '); $this->assertSession()->waitOnAutocomplete(); $this->screenshotOutput(); } Loading Loading
js/linky-widget.js +2 −4 Original line number Diff line number Diff line Loading @@ -26,12 +26,10 @@ } Object.keys(drupalSettings.dynamic_entity_reference).forEach(function (field_class) { $(context) .find('.' + field_class) .once('linky') .find(once('linky', '.' + field_class, context)) .on('change', {select: field_class}, linkyWidget); $(context) .find('.' + field_class) .once('linky-title') .find(once('linky-title', '.' + field_class, context)) .each(function() { var $el = $(this); var $autocomplete = $el.parents('.container-inline').find('.form-autocomplete'); Loading
src/Plugin/EntityReferenceSelection/LinkySelection.php +1 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ class LinkySelection extends DefaultSelection { $entity_type = $this->entityTypeManager->getDefinition($target_type); $query = $this->entityTypeManager->getStorage($target_type)->getQuery(); $query->accessCheck(TRUE); // If 'target_bundles' is NULL, all bundles are referenceable, no further // conditions are needed. Loading
tests/src/Functional/LinkyFunctionalTest.php +7 −3 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ class LinkyFunctionalTest extends BrowserTestBase { /** * {@inheritdoc} */ public static $modules = [ protected static $modules = [ 'link', 'linky', 'user', Loading Loading @@ -64,7 +64,7 @@ class LinkyFunctionalTest extends BrowserTestBase { /** * Sets the test up. */ protected function setUp() { protected function setUp(): void { parent::setUp(); // Test admin user. $this->adminUser = $this->drupalCreateUser($this->permissions); Loading Loading @@ -126,7 +126,11 @@ class LinkyFunctionalTest extends BrowserTestBase { * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException */ protected function getMostRecentlyCreatedLinky() { $results = \Drupal::entityQuery('linky')->sort('id', 'DESC')->range(0, 1)->execute(); $results = \Drupal::entityQuery('linky') ->sort('id', 'DESC') ->range(0, 1) ->accessCheck(FALSE) ->execute(); $id = array_shift($results); return \Drupal::entityTypeManager()->getStorage('linky')->load($id); } Loading
tests/src/Functional/Update/LinkyRevisionableUpdateTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ class LinkyRevisionableUpdateTest extends UpdatePathTestBase { */ public function setDatabaseDumpFiles() { $this->databaseDumpFiles = [ DRUPAL_ROOT . '/core/modules/system/tests/fixtures/update/drupal-8.8.0.bare.standard.php.gz', DRUPAL_ROOT . '/core/modules/system/tests/fixtures/update/drupal-9.4.0.bare.standard.php.gz', __DIR__ . '/../../../fixtures/update/linky-convert-linky-entity-to-revisionable-3052102.php', ]; } Loading
tests/src/FunctionalJavascript/LinkyFunctionalTest.php +4 −7 Original line number Diff line number Diff line Loading @@ -53,7 +53,7 @@ class LinkyFunctionalTest extends WebDriverTestBase { /** * {@inheritdoc} */ public static $modules = [ protected static $modules = [ 'link', 'linky', 'user', Loading Loading @@ -88,7 +88,7 @@ class LinkyFunctionalTest extends WebDriverTestBase { /** * Sets the test up. */ protected function setUp() { protected function setUp(): void { parent::setUp(); // Test admin user. $this->adminUser = $this->drupalCreateUser($this->permissions); Loading Loading @@ -323,11 +323,8 @@ class LinkyFunctionalTest extends WebDriverTestBase { */ protected function performAutocompleteQuery($autocomplete_query, NodeElement $autocomplete_field) { $autocomplete_field->setValue($autocomplete_query); $this->getSession()->getDriver()->keyDown($autocomplete_field->getXpath(), ' '); // Wait for ajax. $this->assertJsCondition('(typeof(jQuery)=="undefined" || (0 === jQuery.active && 0 === jQuery(\'.ui-autocomplete-loading\').length))', 20000); // And autocomplete selection. $this->assertJsCondition('jQuery(".ui-autocomplete.ui-menu li.ui-menu-item:visible").length > 0', 5000); $autocomplete_field->keyDown(' '); $this->assertSession()->waitOnAutocomplete(); $this->screenshotOutput(); } Loading