Skip to content

Fix directory type nav click scope#2865

Open
Arafat-plugins wants to merge 1 commit into
sovware:developmentfrom
Arafat-plugins:fix-type-nav-scope
Open

Fix directory type nav click scope#2865
Arafat-plugins wants to merge 1 commit into
sovware:developmentfrom
Arafat-plugins:fix-type-nav-scope

Conversation

@Arafat-plugins
Copy link
Copy Markdown
Contributor

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Security fix
  • Improvement
  • New Feature
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Text changes
  • Other... Please describe:

Description

How to reproduce the issue or how to test the changes

This fixes Directorist directory type navigation clicks being intercepted by the search form listing type AJAX handler.

The search form script was binding the atbdp_listing_types_form AJAX handler to both .search_listing_types and the global .directorist-type-nav__link selector. Category and location directory type navigation also use .directorist-type-nav__link, so clicking Buy/Rent on those taxonomy pages could be prevented from following the normal URL and instead trigger the search form AJAX request.

This change scopes the AJAX click handler to links inside .directorist-search-contents, keeping the search form type switcher behavior intact while allowing category and location nav links to follow their normal directory_type URLs.

  1. Go to the categories page, for example /categories/.
  2. Click Rent or another directory type nav item.
  3. Verify the browser navigates to /categories/?directory_type=rent instead of firing admin-ajax.php?action=atbdp_listing_types_form.
  4. Go to the locations page, for example /locations/.
  5. Click Rent or another directory type nav item.
  6. Verify the browser navigates to /locations/?directory_type=rent instead of firing admin-ajax.php?action=atbdp_listing_types_form.
  7. Verify the search form directory type switcher still sends the atbdp_listing_types_form AJAX request.

Any linked issues

Fixes # https://taiga-sovware-u10698.vm.elestio.app/project/directorist/issue/2940

Screenshot

  • N/A

Checklist

@iamibrahimriaz
Copy link
Copy Markdown
Collaborator

Looks Good @Arafat-plugins

Always try to add before-after screenshot in description, so that reviewer can easily visualize the changes at a glance.

@Arafat-plugins
Copy link
Copy Markdown
Contributor Author

Looks Good @Arafat-plugins

Always try to add before-after screenshot in description, so that reviewer can easily visualize the changes at a glance.

ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants