Problem/Motivation

DisplayPluginBase::applyDisplayCachablityMetadata() method has a typo in word Cachablity. The correct name of the method should be applyDisplayCacheabilityMetadata().

Proposed resolution

Rename all references to applyDisplayCachablityMetadata() to correctly spelled applyDisplayCacheabilityMetadata().

Remaining tasks

Create a patch.

User interface changes

None.

API changes

Minimal, as DisplayPluginBase::applyDisplayCachablityMetadata() method is protected. Contrib modules that override classes might need to change the name of the method.

Data model changes

None.

CommentFileSizeAuthor
#18 interdiff-15-18.txt1.18 KBAnonymous (not verified)
#18 2580935-18.patch7.49 KBAnonymous (not verified)
#15 2580935-15.patch7.27 KBAnonymous (not verified)
#13 interdiff-10-13.txt1.03 KBAnonymous (not verified)
#13 2580935-13.patch7.25 KBAnonymous (not verified)
#10 interdiff-7-10.txt5.77 KBAnonymous (not verified)
#10 2580935-10.patch7.27 KBAnonymous (not verified)
#7 2580935-7.patch5.63 KBAnonymous (not verified)
#2 apply_display_cachablity_metadata_typo-2580935-1.patch3.46 KBmaijs

Comments

maijs created an issue. See original summary.

maijs’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new3.46 KB
dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Ha, good catch! Its an internal method so renaming should be fine.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 2: apply_display_cachablity_metadata_typo-2580935-1.patch, failed testing.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Anonymous’s picture

Status: Needs work » Needs review
StatusFileSize
new5.63 KB

reroll for 8.2.x + add deprecated applyDisplayCachablityMetadata() for BC, because it can be used in extended classes of contrib modules (eg. recipe, wechat) and may be some custom modules.

berdir’s picture

Component: cache system » views.module
Status: Needs review » Reviewed & tested by the community

Adding the BC method makes sense to me. Also moving to views module.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
@@ -2150,6 +2150,19 @@ protected function applyDisplayCachablityMetadata(array &$element) {
+   * @deprecated in Drupal 8.2.x-dev, will be removed before Drupal 8.4.0. Use
+   *   ::applyDisplayCacheablityMetadata() instead.

8.3.0 and removed in Drupal 9.0.

Also just for lolz the new name still has a typo :)

Should be applyDisplayCacheabilityMetadata

Plus the reference here should be DisplayPluginBase::applyDisplayCacheabilityMetadata and an @see \Drupal\views\Plugin\views\display\DisplayPluginBase::applyDisplayCacheabilityMetadata() should be added.

Anonymous’s picture

Status: Needs work » Needs review
StatusFileSize
new7.27 KB
new5.77 KB

Oops! I feel extremely uncomfortable for it. Sorry! This patch fixed #9 (i hope) + replace all cases with 'cacheblity' in core.

dawehner’s picture

Version: 8.2.x-dev » 8.3.x-dev
Status: Needs review » Reviewed & tested by the community

I fear I might not be irresponsible for that particular typo :(

IMHO this should really just be fixed in 8.3.x

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
@@ -2138,6 +2138,21 @@ protected function applyDisplayCachablityMetadata(array &$element) {
+    DisplayPluginBase::applyDisplayCacheabilityMetadata($element);

I think this needs to be $this->applyDisplayCacheabilityMetadata($element);. BC layers with no tests :( I'm sorry that my comment might have lead to this unnecessary change.

The rest looks good.

Anonymous’s picture

Status: Needs work » Needs review
StatusFileSize
new7.25 KB
new1.03 KB

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Anonymous’s picture

StatusFileSize
new7.27 KB

#13 patch need re-roll after #2815845: Importing (deploying) REST resource config entities should automatically do the necessary route rebuilding. Because one line was changed:

- $this->assertCacheTags(array_merge($block->getCacheTags(), ['block_view', 'config:block_list', 'config:views.view.test_view_block' , 'rendered']));
+ $this->assertCacheTags(array_merge($block->getCacheTags(), ['block_view', 'config:block_list', 'config:views.view.test_view_block' , 'http_response', 'rendered']));

After this patch I was searching by applyDisplayCachablityMetadata, cacha and blity and not found (only in deprecated part).

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Works for me. I am not sure whether its worth to test this BC layer. There is just one possible implementation of it.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
  1. +++ b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
    @@ -2138,6 +2138,21 @@ protected function applyDisplayCachablityMetadata(array &$element) {
    +   * @deprecated in Drupal 8.3.0, will be removed before Drupal 9.0. Use
    +   *   DisplayPluginBase::applyDisplayCacheabilityMetadata instead.
    

    This will be deprecated in 8.4.0 - it has missed the boat for 8.3.0.

  2. +++ b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
    @@ -2138,6 +2138,21 @@ protected function applyDisplayCachablityMetadata(array &$element) {
    +   * @deprecated in Drupal 8.3.0, will be removed before Drupal 9.0. Use
    +   *   DisplayPluginBase::applyDisplayCacheabilityMetadata instead.
    ...
    +    $this->applyDisplayCacheabilityMetadata($element);
    

    let's use the @trigger_error pattern here. Whilst it is not policy yet it will be 8.4.0.

    @trigger_error('The DisplayPluginBase::applyDisplayCacheablityMetadata method is deprecated since version 8.4 and will be removed in 9.0. Use DisplayPluginBase::applyDisplayCacheabilityMetadata instead.', E_USER_DEPRECATED);

Anonymous’s picture

Status: Needs work » Needs review
StatusFileSize
new7.49 KB
new1.18 KB
dawehner’s picture

Status: Needs review » Reviewed & tested by the community

let's use the @trigger_error pattern here. Whilst it is not policy yet it will be 8.4.0.

Interesting!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 9f2371f and pushed to 8.4.x. Thanks!

diff --git a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
index f450a23..1a0741d 100644
--- a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
+++ b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
@@ -2149,7 +2149,7 @@ protected function applyDisplayCacheabilityMetadata(array &$element) {
    * @see \Drupal\views\Plugin\views\display\DisplayPluginBase::applyDisplayCacheabilityMetadata()
    */
   protected function applyDisplayCachablityMetadata(array &$element) {
-    @trigger_error('The DisplayPluginBase::applyDisplayCacheablityMetadata method is deprecated since version 8.4 and will be removed in 9.0. Use DisplayPluginBase::applyDisplayCacheabilityMetadata instead.', E_USER_DEPRECATED);
+    @trigger_error('The DisplayPluginBase::applyDisplayCachablityMetadata method is deprecated since version 8.4 and will be removed in 9.0. Use DisplayPluginBase::applyDisplayCacheabilityMetadata instead.', E_USER_DEPRECATED);
     $this->applyDisplayCacheabilityMetadata($element);
   }
 

Lol in #17 I spelt the deprecated method name correctly and therefore wrong. Fixed on commit.

  • alexpott committed 9f2371f on 8.4.x
    Issue #2580935 by vaplas, maijs: DisplayPluginBase::...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.