This update has caused the AJAX calls to stop working when letters are clicked in glossary attachments. Previous to this update, clicking on an item in a glossary (in the default Glossary view) would result in an AJAX call so that the page reloads without a URL change. But, now the links act like normal links and take me to a new page, which is not what is expected. I have verified that this is the case in a base Drupal install with Views 7.x-3.23 against Views 7.x-3.22. It works fine in 7.x-3.22, but the AJAX calls are no longer working in 7.x-3.23.

EDIT: Upon further investigation, this problem is being caused by the update referenced by issue #1877446, "Fix Ajax pager in nested views." The problem is that attachments like the glossary are nested within the view, so this breaks the ajax call to nested attachments.

Comments

paramnida created an issue. See original summary.

paramnida’s picture

Component: Miscellaneous » Code
paramnida’s picture

Issue summary: View changes
Related issues: +#1877446: Fix Ajax pager in nested views
paramnida’s picture

Here is a patch that fixes the problem for me. Please test.

brankoc’s picture

Status: Active » Needs review
brankoc’s picture

I don't know how the glossary view is supposed to work, as I have never had a need to use it and I do not appear to be able to find a description of it within the module.

I am able to confirm, however, that in Views 7.x-3.22, the glossary view works different from the one in Views 7.x-3.23.

What presumably should happen (and does in 7.22):

  • Create a few nodes.
  • Enable the glossary view.
  • Clear caches.
  • Go to /glossary.
  • Click on a letter.
  • Without changing the URL, a table is shown which contains a list of all nodes of which the title starts with the letter you clicked on.

What happens in Views 7.x-3.23:

  • Create a few nodes.
  • Enable the glossary view.
  • Clear caches.
  • Go to /glossary.
  • Click on a letter.
  • A new page is loaded with path glossary/X, where X is the letter you clicked on, and a table is shown which contains a list of all nodes of which the title starts with the letter you clicked on.
brankoc’s picture

I can confirm that the patch fixes the problem as described.

I have two small issues with the coding style of the patch:

  • The patch uses double quotes to enclose a jQuery selector; the rest of the script uses single quotes, and I believe it makes more sense to keep that style consistent. (The Drupal coding standards don't mention such a guideline for Javascript, only for PHP, but I believe such consistency also makes sense in Javascript).
  • The patch compares the outcome of the hasClass() method with false using ==, which is a truthy comparison. I believe that unless you are comparing truthy values, one should use ===. The method hasClass() returns a boolean value, so the patch should use === in my opinion.
paramnida’s picture

Thanks for the feedback BrankoC! I have re-rolled the patch with your suggestions.

brankoc’s picture

Version: 7.x-3.23 » 7.x-3.x-dev
brankoc’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

j_s’s picture

The patch in #8 also works for me. Thanks!

aubjr_drupal’s picture

Belated, but the patch from comment #8 also worked across a couple of different sites for me.

damienmckenna’s picture

Status: Reviewed & tested by the community » Fixed
Parent issue: » #3054023: Plan for Views 7.x-3.24 release

Committed. Thank you all.

Status: Fixed » Closed (fixed)

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