Skip to content

fix: persist directory for untranslated listings - #14

Open
syedgalib wants to merge 68 commits into
sovware:developmentfrom
syedgalib:fix/3137-admin-listing-directory-sync
Open

fix: persist directory for untranslated listings#14
syedgalib wants to merge 68 commits into
sovware:developmentfrom
syedgalib:fix/3137-admin-listing-directory-sync

Conversation

@syedgalib

Copy link
Copy Markdown
Collaborator

Summary

  • persist the current listing's directory meta and taxonomy relationship even when WPML returns no listing translation group
  • continue syncing language-specific directory terms to translated listings
  • preserve translated listing assignments when a matching translated directory is unavailable

Root cause

Directorist WPML Integration disables Directorist core's directory taxonomy update through directorist_should_update_directory_type. Its replacement post_updated handler only wrote directory relationships while iterating WPML listing translations. For new or untranslated listings, that collection can be empty, leaving _directory_type meta populated while the atbdp_listing_types relationship is missing.

This was reproduced read-only on the ticket's production site with listings 5705 and 5706: the edit form resolved the saved directory from meta, while the All Listings Directory column was empty because it reads the taxonomy relationship.

Fix

The update handler now persists the current listing before translation lookup. Existing inconsistent listings repair on resave. Translated listings are still mapped to language-specific directory terms, while missing mappings are skipped instead of clearing assignments.

Verification

  • php -l app/Controller/Hook/Listings_Actions.php
  • composer validate --no-check-publish
  • git diff --check
  • isolated behavioral harness covering:
    • untranslated listing save
    • translated directory synchronization
    • missing translation preservation
    • repair from stored meta on resave
    • unrelated post-type guard

Ticket

#3137

HeyMehedi and others added 30 commits June 9, 2025 16:07
Fix: Resolve WPML "Undefined array key attr" warnings in Gutenberg and  blocks elementor config
Fix WPML string translation issues in Directorist integration
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.

8 participants