Skip to content

fix: recover malformed archive card layouts - #3033

Open
RabbiIslamRony wants to merge 3 commits into
sovware:trunkfrom
RabbiIslamRony:fix/6893-search-result-list-view
Open

RabbiIslamRony wants to merge 3 commits into
sovware:trunkfrom
RabbiIslamRony:fix/6893-search-result-list-view

Conversation

@RabbiIslamRony

@RabbiIslamRony RabbiIslamRony commented Sep 21, 2026

Copy link
Copy Markdown
Member

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

  1. Save a directory type's listings_card_list_view term meta in a malformed shape such as [null].
  2. Open the search results page and switch that directory to list view. Directorist finds the listings but renders empty card shells and emits undefined layout warnings.
  3. Apply this change and repeat the same request. Directorist validates the saved grid/list layout independently and falls back only the malformed view to the standard renderable layout.

The valid sibling layout remains unchanged.

Before — live reproduction

The Accommodation directory reports results but its list view contains empty card shells.

Before: empty Accommodation list cards

After — local reproduction with the fix

The same malformed list-layout shape falls back to populated cards without PHP warnings.

After: populated list cards

Verification

  • PHP lint passed for the changed file.
  • Focused PHPCS: 0 errors and 0 new warnings; the helper file retained the same 370 pre-existing warnings as the base version.
  • WP-CLI red/green check with disposable malformed term meta; the original metadata was restored afterward.
  • Agent Browser: before = 6 card shells, 0 titles, warnings present; after = 6 cards, 6 titles, no warnings.
  • git diff --check

Any linked issues

Ticket: https://secure.helpscout.net/conversation/3456725671/6893

Checklist

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.

1 participant