diff options
Diffstat (limited to 'core/modules')
-rw-r--r-- | core/modules/datetime/datetime.module | 6 | ||||
-rw-r--r-- | core/modules/node/src/Form/NodeForm.php | 2 | ||||
-rw-r--r-- | core/modules/node/tests/src/Functional/NodeCreationTest.php | 5 |
3 files changed, 7 insertions, 6 deletions
diff --git a/core/modules/datetime/datetime.module b/core/modules/datetime/datetime.module index b5ff7ffa23cb..55a65f84dae7 100644 --- a/core/modules/datetime/datetime.module +++ b/core/modules/datetime/datetime.module @@ -31,10 +31,10 @@ use Drupal\field\FieldStorageConfigInterface; * * @deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. Use * \Drupal::service('datetime.views_helper') - * ->fieldViewsDataHelper($field_storage, $data, $column_name); instead. + * ->buildViewsData($field_storage, $data, $column_name); instead. * @see https://www.drupal.org/node/3489502 */ function datetime_type_field_views_data_helper(FieldStorageConfigInterface $field_storage, array $data, $column_name) { - @trigger_error('datetime_type_field_views_data_helper() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. Use \Drupal::service(\'datetime.views_helper\')->fieldViewsDataHelper($field_storage, $data, $column_name). See https://www.drupal.org/node/3489502', E_USER_DEPRECATED); - return \Drupal::service('datetime.views_helper')->fieldViewsDataHelper($field_storage, $data, $column_name); + @trigger_error('datetime_type_field_views_data_helper() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. Use \Drupal::service(\'datetime.views_helper\')->buildViewsData($field_storage, $data, $column_name). See https://www.drupal.org/node/3489502', E_USER_DEPRECATED); + return \Drupal::service('datetime.views_helper')->buildViewsData($field_storage, $data, $column_name); } diff --git a/core/modules/node/src/Form/NodeForm.php b/core/modules/node/src/Form/NodeForm.php index d5afa396568c..d739aa7de8fc 100644 --- a/core/modules/node/src/Form/NodeForm.php +++ b/core/modules/node/src/Form/NodeForm.php @@ -281,7 +281,7 @@ class NodeForm extends ContentEntityForm { $node->save(); $node_link = $node->toLink($this->t('View'))->toString(); $context = ['@type' => $node->getType(), '%title' => $node->label(), 'link' => $node_link]; - $t_args = ['@type' => node_get_type_label($node), '%title' => $node->toLink()->toString()]; + $t_args = ['@type' => node_get_type_label($node), '%title' => $node->access('view') ? $node->toLink()->toString() : $node->label()]; if ($insert) { $this->logger('content')->info('@type: added %title.', $context); diff --git a/core/modules/node/tests/src/Functional/NodeCreationTest.php b/core/modules/node/tests/src/Functional/NodeCreationTest.php index f0192966a1b5..6930bb86f96f 100644 --- a/core/modules/node/tests/src/Functional/NodeCreationTest.php +++ b/core/modules/node/tests/src/Functional/NodeCreationTest.php @@ -183,8 +183,9 @@ class NodeCreationTest extends NodeTestBase { // Confirm that the node was created. $this->assertSession()->pageTextContains('Basic page ' . $edit['title[0][value]'] . ' has been created.'); - // Verify that the creation message contains a link to a node. - $this->assertSession()->elementExists('xpath', '//div[@data-drupal-messages]//a[contains(@href, "node/")]'); + // Verify that the creation message doesn't contain a link to a node since + // the user cannot view unpublished nodes. + $this->assertSession()->elementNotExists('xpath', '//div[@data-drupal-messages]//a[contains(@href, "node/")]'); } /** |