Problem/Motivation

Function generateResultsKey under Core/modules/views/src/Plugin/views/cache/CachePluginBase.php is not compatible with SelectExtender object.

instanceof Select is used instead of instanceof SelectInterface

Steps to reproduce

  • Create one custom Extender which extends SelectExtender
  • Use that newly created extender via hook_views_pre_execute
  • Enable tag based caching in view which is using that newly created Extender
  • generateResultsKey function is expecting Select object which is actually now the new extender object which extends SelectExtender

Proposed resolution

"instanceof Select" should be replaced with "instanceof SelectInterface"

Issue fork drupal-3299800

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

shubhamporwal14@gmail.com’s picture

Issue summary: View changes
shubhamporwal14@gmail.com’s picture

Component: cache system » views.module

immaculatexavier made their first commit to this issue’s fork.

immaculatexavier’s picture

Status: Active » Needs review

Committed and completed MR in accordance with the proposed resolution

Lendude’s picture

Priority: Major » Normal
Status: Needs review » Needs work

Sounds fair.

MR review: Should in not also update the use statement to use the Interface?

Munavijayalakshmi’s picture

Assigned: Unassigned » Munavijayalakshmi
Munavijayalakshmi’s picture

Assigned: Munavijayalakshmi » Unassigned
shubhamporwal14@gmail.com’s picture

Committed MR in as per the review comments. Adding patch also if need to be applied before it gets added to next release.

shubhamporwal14@gmail.com’s picture

Status: Needs work » Needs review
shubhamporwal14@gmail.com’s picture

Reapplying patch with trailing whitespace

shubhamporwal14@gmail.com’s picture

Patch re-roll - Update patch name for better reach to issue

Munavijayalakshmi’s picture

Assigned: Unassigned » Munavijayalakshmi
Munavijayalakshmi’s picture

Munavijayalakshmi’s picture

Assigned: Munavijayalakshmi » Unassigned

test passed.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Bug Smash Initiative

This may require it's own test but will let the committer decide that.

Looks like an enhancement more then anything. Comfortable marking RTBC

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Discussed with @catch and we agreed that a test here is unnecessary.

Committed and pushed c0d2542d45 to 10.1.x and 4060207549 to 10.0.x and 2e883f7a83 to 9.5.x. Thanks!

  • alexpott committed c0d2542 on 10.1.x
    Issue #3299800 by shubhamporwal14@gmail.com, immaculatexavier,...

  • alexpott committed 4060207 on 10.0.x
    Issue #3299800 by shubhamporwal14@gmail.com, immaculatexavier,...

  • alexpott committed 2e883f7 on 9.5.x
    Issue #3299800 by shubhamporwal14@gmail.com, immaculatexavier,...

Status: Fixed » Closed (fixed)

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