Fix PHP 8 type error in search category location filter when directory type is string#2763
Open
Arafat-plugins wants to merge 2 commits intosovware:trunkfrom
Open
Fix PHP 8 type error in search category location filter when directory type is string#2763Arafat-plugins wants to merge 2 commits intosovware:trunkfrom
Arafat-plugins wants to merge 2 commits intosovware:trunkfrom
Conversation
Fix TypeError when _directory_type term meta is stored as string
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.
PR Type
What kind of change does this PR introduce?
This PR fixes a PHP 8+
TypeErrorthat occurs when the_directory_typeterm meta is stored as a scalar string and used insearch_category_location_filter().Currently,
get_term_meta( $term->term_id, '_directory_type', true )can return a string like'191', but later is passed directly to: in_array( $settings['listing_type'], $directory_type );Description
How to reproduce the issue or how to test the changes
Any linked issues
Fixes #
https://taiga-sovware-u10698.vm.elestio.app/project/directorist/issue/2735
Checklist