Skip to content

🐞 Bug: "Go to Settings" button redirects to General Settings instead of All Listings (Subdirectory Issue) #2665

@RabbiIslamRony

Description

@RabbiIslamRony

Directorist version

Latest

Environment

Latest

Description

When clicking the "Go to Settings" button from Builder β†’ All Listing Layout (used to enable/disable Grid, List, or Map views), the button redirects to General Settings instead of the All Listings settings page.

As a result, users cannot manage Grid, List, and Map view options from the intended settings screen.

Additionally, this issue causes a 404 or Invalid Redirect on websites installed in a subdirectory, as the generated URL strips the subdirectory path.


Expected Behavior

The button should redirect directly to the All Listings settings page inside the correct WordPress installation path.

Expected URL Pattern:
https://your-site.com/wp-admin/edit.php?post_type=at_biz_dir&page=atbdp-settings#listing_settings__listings_page


Actual Behavior

1. Wrong Settings Page

The button redirects to the generic General Settings page rather than the specific All Listings configuration tab.

2. Subdirectory Stripping

The button generates a URL that ignores the subdirectory, leading to a broken link or the root site's admin panel.

Example Setup:
https://sovqa.site/directorist-development/

Correct Settings URL (Target):
https://sovqa.site/directorist-development/wp-admin/edit.php?post_type=at_biz_dir&page=atbdp-directory-types&listing_type_id=3&action=edit

Current Incorrect URL (Generated by Button):
https://sovqa.site/wp-admin/edit.php?post_type=at_biz_dir&page=atbdp-settings

(Note: The /directorist-development/ segment is completely missing).


Possible Root Cause

The button appears to be using a hard-coded or incorrectly generated absolute URL mechanism, failing to utilize WordPress dynamic path functions.

Suggested Fix

  1. Dynamic Generation: Use admin_url('edit.php?post_type=at_biz_dir&page=atbdp-settings...') to automatically handle subdirectories/subdomains.
  2. Targeting: Ensure the link includes the correct anchor or query parameter to land specifically on the All Listings tab.

Steps to Reproduce

  1. Go to Builder.
  2. Open All Listing Layout.
  3. Click "Go to Settings".

Isolating the problem

  • I have reproduced this bug in localhost.
  • This bug happens with a default WordPress theme active (eg. 2021, 2022 etc).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions