I have identified an issue with the way views generates the unique dom_id and a CDN is sitting in front of Drupal being used as a full page cache. The problem arises because the dom_id is too unique (currently a hash of the view name, REQUEST_TIME constant and PHP's rand) and the page caching being served gets out of sync with what the views cache is expecting so the AJAX replacement for the exposed filter doesn't complete the replacement as the selector is not found.

To fix this, I have altered what is used to build the hash of the dom_id making it more predictable but kept the ability to use multiple views on a single page by wrapping it in drupal_html_id.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jacobbednarz’s picture

jacobbednarz’s picture

Component: Miscellaneous » exposed filters
jacobbednarz’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 1: views-prevent-dom_id-being-too-unique-2372897-1.patch, failed testing.

Status: Needs work » Needs review
jacobbednarz’s picture

Status: Needs review » Needs work
jacobbednarz’s picture

Status: Needs work » Needs review
jacobbednarz’s picture

Branch Views - 7.x-3.x is failing tests so this is pending those fixes (From what I can see anyway)

jacobbednarz’s picture

Status: Needs review » Active
jacobbednarz’s picture

Status: Active » Needs review
Chris Matthews’s picture

Status: Needs review » Needs work
Issue tags: -caching, -dom_id +Needs reroll

The 4 year old patch in #1 to view.inc does not apply to the latest views 7.x-3.x-dev and if still relevant needs to be rerolled.

Checking patch includes/view.inc...
error: while searching for:
    }

    // Allow hook_views_pre_view() to set the dom_id, then ensure it is set.
    $this->dom_id = !empty($this->dom_id) ? $this->dom_id : md5($this->name . REQUEST_TIME . rand());

    // Allow the display handler to set up for execution
    $this->display_handler->pre_execute();

error: patch failed: includes/view.inc:1393
error: includes/view.inc: patch does not apply
jacobbednarz’s picture

Thanks for the poke Chris2. This isn't something that I need any longer since moving on from the company where this patch was required however I could see this being useful for others. If you or anyone else would like to pick this up and run with it, you're more than welcome but I won't be re-patching this for the latest release.

Andrew Answer’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
651 bytes

Patch rerolled.