Skip to content

fix: correct popular category membership and zero-coordinate directions - #3020

Merged
Armanul46 merged 1 commit into
sovware:developmentfrom
RabbiIslamRony:fix/popular-categories-zero-coordinates
Sep 14, 2026
Merged

Armanul46 merged 1 commit into
sovware:developmentfrom
RabbiIslamRony:fix/popular-categories-zero-coordinates

Conversation

@RabbiIslamRony

@RabbiIslamRony RabbiIslamRony commented Sep 14, 2026

Copy link
Copy Markdown
Member

PR Type

  • Bugfix

Description

Fixes two regressions found while reviewing #3018:

  • Popular Categories now matches serialized directory values, including legacy numeric strings, without matching array indexes. Directory filtering still runs before count ordering and the result limit, and the indexed metadata fast path remains available.
  • Google Maps and OpenStreetMap listing cards accept numeric zero coordinates for both link visibility and destination selection. Empty or nonnumeric coordinates use the address fallback; disabling directions still hides the link.

How to test

  1. Create populated root categories with legacy _directory_type values [3], ["3"], and [1000,1001,1002,1003], without directory marker metadata. Select directory 3: only the first two should appear. Set the popular-category limit to verify filtering happens before limiting.
  2. Render both map cards with latitude 0, longitude 32.5, an empty address, and directions enabled. Get Directions should point to 0,32.5. Also check zero longitude, both zeros, address fallback, and directions disabled.
  3. On a disposable WordPress site, run wp eval-file wp-content/plugins/directorist/tests/wp-cli/popular-categories-map-directions.php. The test creates and cleans up its fixtures.

Validation

  • New regression suite: 13 failing checks before the fix; all 25 pass after.
  • Existing taxonomy subterm and modal block smoke tests pass.
  • PHP syntax checks pass for all four changed files.
  • PHPCS passes with the repository CI setting --warning-severity=0. SearchForm has the same 133 pre-existing warnings before and after; no errors.
  • Before/after screenshots captured from an isolated local WordPress reproduction using actual query/template output; attachments will be added manually.

Related: #3018

Before - https://prnt.sc/mF7i36DOOw0X

After - https://prnt.sc/LsTe1jqTEcRB

Checklist

  • Changed PHP files pass the repository's configured CI coding-standard check.

GitHub check status

The current PHPCS Action failed at checkout, before PHPCS ran: the base repository's pull_request_target workflow refuses to check out fork code in its privileged context. See failed checkout. Local PHPCS verification above passed; GitHub PHPCS has not executed for this head.

@RabbiIslamRony RabbiIslamRony added this to the v8.9.5 milestone Sep 14, 2026
@Armanul46
Armanul46 merged commit 4f09cda into sovware:development Sep 14, 2026
0 of 2 checks passed
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