fix: persist directory for untranslated listings - #14
Open
syedgalib wants to merge 68 commits into
Open
Conversation
fixed email translation issues
removed unwanted codes
Fix/email translation support
Fix: Resolve WPML "Undefined array key attr" warnings in Gutenberg and blocks elementor config
Fix WPML string translation issues in Directorist integration
wpml-integration issue fix
…tegration into fix/3137-admin-listing-directory-sync
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Root cause
Directorist WPML Integration disables Directorist core's directory taxonomy update through
directorist_should_update_directory_type. Its replacementpost_updatedhandler only wrote directory relationships while iterating WPML listing translations. For new or untranslated listings, that collection can be empty, leaving_directory_typemeta populated while theatbdp_listing_typesrelationship 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.phpcomposer validate --no-check-publishgit diff --checkTicket
#3137