Forums › Forums › Search & Filter Pro › How can I get titles from ACF post object field? (instead of IDs)
Tagged: V3
- This topic has 46 replies, 3 voices, and was last updated 4 years, 7 months ago by
Ross.
-
Anonymous(Private) July 21, 2020 at 9:34 pm #253492
Hi Ross, Thanks so much for your detective work! I need just a bit more guidance.
In your recent message you say:
You’ll have to go through and find all the post IDs, and save them, to be sure that this error won’t pop back up again…Find all the post IDs – with what common characteristic, exactly?
Is this something that can be done in WP, or is it better done in the DB?
Thanks for your help!
Ross Moderator(Private) July 22, 2020 at 9:06 am #253525Hi again
So to answer:
You’ll have to go through and find all the post IDs, and save them, to be sure that this error won’t pop back up again…
Find all the post IDs – with what common characteristic, exactly?
So, the scenario is something like this:
1) You had an ACF field, set the wrong way (for S&F to use) at some point
2) You made some posts, added values for the ACF fields, and saved them (these posts have the bad, serialised, data)
3) You then changed the format of an ACF field, to a format that works with S&F (great)
4) You updated some of your posts (these have good data, any old posts, that you didn’t “resave” yet, will still have bad data)
5) When building a S&F field, it takes a post (fairly randomised), and calculates the optionsSo while you have posts that still have bad data, you run the risk of S&F randomly picking it (in step 5) and causing the field not to pick up the labels properly.
Sooo…
To find the bad data is tricky, but we did it before, we looked in the S&F
search_filter_term_results
and we found some entries that had for thefield_value
column, some values like:{i:0;s:4"1154...
You can look through all the records in this table, looking for bad data like this, then you will see in the
result_ids
column, the IDs of all the posts associated with that bad data.So you then need to edit these posts (via wp-admin), and click “update” – this should resave the post, and remove the bad data.
You should also see the bad data dissapear from our tables too!
I hope that explains things clearly.
Best
-
AuthorPosts