diff -u b/core/modules/media_entity/media_entity.tokens.inc b/core/modules/media_entity/media_entity.tokens.inc --- b/core/modules/media_entity/media_entity.tokens.inc +++ b/core/modules/media_entity/media_entity.tokens.inc @@ -141,7 +141,7 @@ // Default values for the chained tokens handled below. case 'author': /** @var \Drupal\user\UserInterface $account */ - $account = $media->getPublisher(); + $account = $media->getOwner(); $bubbleable_metadata->addCacheableDependency($account); $replacements[$original] = $account->label(); break; diff -u b/core/modules/media_entity/src/Entity/Media.php b/core/modules/media_entity/src/Entity/Media.php --- b/core/modules/media_entity/src/Entity/Media.php +++ b/core/modules/media_entity/src/Entity/Media.php @@ -109,7 +109,7 @@ * {@inheritdoc} */ public function getOwner() { - $this->get('uid')->entity; + return $this->get('uid')->entity; } /** @@ -124,35 +124,13 @@ * {@inheritdoc} */ public function getOwnerId() { - $this->get('uid')->target_id; - } - - /** - * {@inheritdoc} - */ - public function setOwnerId($uid) { - $this->set('uid', $uid); - return $this; - } - - /** - * {@inheritdoc} - */ - public function getPublisher() { - return $this->get('uid')->entity; - } - - /** - * {@inheritdoc} - */ - public function getPublisherId() { return $this->get('uid')->target_id; } /** * {@inheritdoc} */ - public function setPublisherId($uid) { + public function setOwnerId($uid) { $this->set('uid', $uid); return $this; } diff -u b/core/modules/media_entity/src/MediaAccessController.php b/core/modules/media_entity/src/MediaAccessController.php --- b/core/modules/media_entity/src/MediaAccessController.php +++ b/core/modules/media_entity/src/MediaAccessController.php @@ -20,10 +20,10 @@ return AccessResult::allowed()->cachePerPermissions(); } - $is_owner = ($account->id() && $account->id() == $entity->getPublisherId()) ? TRUE : FALSE; + $is_owner = ($account->id() && $account->id() == $entity->getOwnerId()) ? TRUE : FALSE; switch ($operation) { case 'view': - return AccessResult::allowedIf($account->hasPermission('view media') && $entity->status->value); + return AccessResult::allowedIf($account->hasPermission('view media') && $entity->status->value)->cachePerPermissions()->addCacheableDependency($entity); case 'update': return AccessResult::allowedIf(($account->hasPermission('update media') && $is_owner) || $account->hasPermission('update any media'))->cachePerPermissions()->cachePerUser()->addCacheableDependency($entity); diff -u b/core/modules/media_entity/src/MediaForm.php b/core/modules/media_entity/src/MediaForm.php --- b/core/modules/media_entity/src/MediaForm.php +++ b/core/modules/media_entity/src/MediaForm.php @@ -33,7 +33,7 @@ // Set up default values, if required. if (!$this->entity->isNew()) { $this->entity->setRevisionLogMessage(NULL); - $this->entity->setPublisherId($this->currentUser()->id()); + $this->entity->setOwnerId($this->currentUser()->id()); $this->entity->setCreatedTime(\Drupal::time()->getRequestTime()); } } diff -u b/core/modules/media_entity/src/MediaInterface.php b/core/modules/media_entity/src/MediaInterface.php --- b/core/modules/media_entity/src/MediaInterface.php +++ b/core/modules/media_entity/src/MediaInterface.php @@ -32,42 +32,6 @@ public function setCreatedTime($timestamp); /** - * Returns the media publisher user entity. - * - * @return \Drupal\user\UserInterface - * The author user entity. - * - * @deprecated in Drupal 8.3.0, will be removed before Drupal 9.0.0. Use - * \Drupal\user\EntityOwnerInterface::getOwner() instead. - */ - public function getPublisher(); - - /** - * Returns the media publisher user ID. - * - * @return int - * The author user ID. - * - * @deprecated in Drupal 8.3.0, will be removed before Drupal 9.0.0. Use - * \Drupal\user\EntityOwnerInterface::getOwnerId() instead. - */ - public function getPublisherId(); - - /** - * Sets the media publisher user ID. - * - * @param int $uid - * The author user id. - * - * @return \Drupal\media_entity\MediaInterface - * The called media entity. - * - * @deprecated in Drupal 8.3.0, will be removed before Drupal 9.0.0. Use - * \Drupal\user\EntityOwnerInterface::setOwnerId() instead. - */ - public function setPublisherId($uid); - - /** * Returns the media published status indicator. * * Unpublished media are only visible to their authors and to administrators. diff -u b/core/modules/media_entity/tests/src/FunctionalJavascript/MediaViewsWizardTest.php b/core/modules/media_entity/tests/src/FunctionalJavascript/MediaViewsWizardTest.php --- b/core/modules/media_entity/tests/src/FunctionalJavascript/MediaViewsWizardTest.php +++ b/core/modules/media_entity/tests/src/FunctionalJavascript/MediaViewsWizardTest.php @@ -25,7 +25,7 @@ $view_id = strtolower($this->randomMachineName(16)); $this->drupalGet('admin/structure/views/add'); $page->fillField('label', $view_id); - $session->wait(2000); + $this->waitUntilVisible('.machine-name-value'); $page->selectFieldOption('show[wizard_key]', 'media'); $assert_session->assertWaitOnAjaxRequest(); $page->checkField('page[create]'); @@ -59,7 +59,7 @@ $view_id = strtolower($this->randomMachineName(16)); $this->drupalGet('admin/structure/views/add'); $page->fillField('label', $view_id); - $session->wait(2000); + $this->waitUntilVisible('.machine-name-value'); $page->selectFieldOption('show[wizard_key]', 'media_revision'); $assert_session->assertWaitOnAjaxRequest(); $page->checkField('page[create]');