Created on 8 May 2023, over 1 year ago
Updated 9 July 2024, 6 months ago

Problem/Motivation

The code specifies that the block is not cached so as not to mix configurations, but the problem with Drupal's cache is that when a page element is cached, the whole page is cached. With a max-age cache of 0, each page reload involves a calculation of all the elements and in some views it can be a heavy task.

Steps to reproduce

-

Proposed resolution

Document this behavior or propose a solution that works.

Remaining tasks

Discuss steps to take.

User interface changes

-

API changes

-

Data model changes

-

🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

🇪🇸Spain enchufe Spain

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @enchufe
  • 🇪🇸Spain enchufe Spain

    PHP 8.2 and Drupal 9.5.x. Added tags and cache contexts to the block, tested with two blocks on views on different pages, and two blocks on views on the same page.

  • Merge request !6Issue #3358885: Apply caches → (Open) created by enchufe
  • Assigned to enchufe
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • 🇧🇪Belgium tim-diels Belgium 🇧🇪

    When providing a patch, you should put the status in "Needs review" so anyone looking at the issue queue knows this can be reviewed. And also un-assigning as someone can pick it up.

  • Status changed to Needs work 6 months ago
  • 🇧🇪Belgium tim-diels Belgium 🇧🇪

    There are issues with PHPCS that needs work.

    FILE: ...custom/views_exposed_sort_block/src/Plugin/Block/ViewsExposedSortBlock.php
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     6 | ERROR | [x] Use statements should be sorted alphabetically. The first
       |       |     wrong one is Drupal\Core\Cache\Cache.
       |       |     (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    Time: 139ms; Memory: 6MB
    PHP CODE SNIFFER REPORT SUMMARY
    --------------------------------------------------------------------------------
    FILE                                                            ERRORS  WARNINGS
    --------------------------------------------------------------------------------
    ...posed_sort_block/src/Plugin/Block/ViewsExposedSortBlock.php  1       0
    --------------------------------------------------------------------------------
    A TOTAL OF 1 ERROR AND 0 WARNINGS WERE FOUND IN 5 FILES
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX 1 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    PHP CODE SNIFFER VIOLATION SOURCE SUMMARY
    --------------------------------------------------------------------------------
        SOURCE                                                                 COUNT
    --------------------------------------------------------------------------------
    [x] SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.Incorrectl  1
    --------------------------------------------------------------------------------
    A TOTAL OF 1 SNIFF VIOLATION WERE FOUND IN 1 SOURCE
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SOURCES AUTOMATICALLY (1 VIOLATIONS IN TOTAL)
    --------------------------------------------------------------------------------
    
  • Assigned to dtfabio
  • Status changed to Active 6 months ago
  • 🇧🇪Belgium dtfabio Ninove

    Hi Tim,

    I have resolved the PHPCS issue locally, will push this change on the branch immediately.

    Greetings,

    Fabio

  • Pipeline finished with Success
    6 months ago
    Total: 138s
    #219445
  • 🇧🇪Belgium dtfabio Ninove

    Hi Tim,

    Sorry for the delay, the commit has been pushed to the branch and the pipline for PHPCS is green again.

    https://git.drupalcode.org/issue/views_exposed_sort_block-3358885/-/jobs...

    Greetings,

    Fabio

  • Issue was unassigned.
  • Status changed to Needs review 6 months ago
  • 🇧🇪Belgium dtfabio Ninove
Production build 0.71.5 2024