Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
Tagged: 8.5.4
- This topic has 11 replies, 3 voices, and was last updated 10 years, 8 months ago by
Steven Zahm.
-
AuthorPosts
-
12/01/2015 at 2:01 pm #356738
Dwight Bailey
ParticipantHi again, Steve.
Zip codes I updated in the WordPress database are not showing up on the web pages where we are displaying Connections listings.Here is what I did:
After successfully uploading all our data using a CSV file per your instructions (a couple of months ago), I noticed that I had used the wrong zip code for all our faculty.So I connected to the database and edited the zipcode field in the connections_addresses table (for the specific site in question), and changed all the zip codes from 32601 to 32611.
When I look at the page, https://www.chem.ufl.edu/faculty-and-research/ for example, I still see the old zip codes.
BUT…when I go to edit them individually, they already DO have the new/correct zip code, and when I just save that profile (without making any changes), these zip codes do change to this correct one on the above web page.
So, it looks to me like I have successfully updated the zip codes in the database, but the “old” zip codes are saved in some kind of cache that gets updated one at a time for individual Connections listings as I edit each listing.
So now to my question (finally)…if this is so, how can I clear this “cache” so that all the zip codes display properly?
Whew! A long explanation for a simple idea. I hope it isn’t confusing. If so, please let me know, and thanks again for all your help!!
Steve K. (communicating on Dwight’s account, as always:)
12/01/2015 at 7:46 pm #356775Steven Zahm
Keymaster@ Steve
re: Whew! A long explanation for a simple idea. I hope it isn’t confusing.
Nope, not confusing. I know exactly what you are talking about. Unfortunately there is not a way to manually update the entry’s object caches from data changed directly in the db. I use object caches (my term for it) to keep the db queries to a minimum for performance reason. These object caches are only refreshed when adding/editing an entry.
The only solution I can offer is a method to disable the entry object caches when displaying entries. But that has the performance penalty of adding 7 additional db queries per entry.
12/02/2015 at 9:04 am #356837Dwight Bailey
ParticipantAh, I see. As usual, you know exactly what is happening!
What if we disable these caches, refresh the pages in a browser, then re-enable them? Would that reset the cache to the latest version? Updating the DB directly is a rare occurrence (hopefully we won’t need to do it again LOL).
If that would work, please provide instructions for disabling the entry object caches.
Thanks again!
Steve K.12/02/2015 at 10:05 am #356840Steven Zahm
Keymaster@ Steve
re: What if we disable these caches, refresh the pages in a browser, then re-enable them? Would that reset the cache to the latest version?
Sorry, no. The caches are only updated on write events (add/edit) not read events (showing in the browser). I do plan on releasing a new tool based on the new CSV export code to do cache refreshing but this will not be done in any timeframe that will do you any good.
There just is no easy way to deal with “force refreshing” the caches at this time, sorry.
12/02/2015 at 10:15 am #356844Steve K.
GuestThis reply has been marked as private.12/02/2015 at 10:46 am #356850Steven Zahm
Keymaster@ Steve
re: Perhaps you wouldn’t want to make this info public
Nope, no harm in this being public. The caches are stored in the main
{wpdb_prefix}_connectionstable as serialized arrays.re: So now you are saying we CAN’T disable it? Or are you saying that even if we disable it now, if we re-enable it later the old cached items will re-appear?
Below is the code that will disable the caches. Like I said, disabling the cache will have a performance impact due to the increased number of db queries that will be required.
Using this code you will bypass the caches… as soon as you remove the code, the caches will be used which means the old data be shown. NOTE: Even with the caches disabled, when you add/edit an entry the caches will be kept in sync. This only disable the caches when displaying the entries.
function cn_disable_output_cache( $cached ) { return FALSE; } function cn_enable_output_cache() { remove_filter( 'cn_address_cached', 'cn_disable_output_cache' ); remove_filter( 'cn_phone_cached', 'cn_disable_output_cache' ); remove_filter( 'cn_email_cached', 'cn_disable_output_cache' ); remove_filter( 'cn_messenger_cached', 'cn_disable_output_cache' ); remove_filter( 'cn_social_network_cached', 'cn_disable_output_cache' ); remove_filter( 'cn_link_cached', 'cn_disable_output_cache' ); remove_filter( 'cn_date_cached', 'cn_disable_output_cache' ); } add_filter( 'cn_address_cached', 'cn_disable_output_cache' ); add_filter( 'cn_phone_cached', 'cn_disable_output_cache' ); add_filter( 'cn_email_cached', 'cn_disable_output_cache' ); add_filter( 'cn_messenger_cached', 'cn_disable_output_cache' ); add_filter( 'cn_social_network_cached', 'cn_disable_output_cache' ); add_filter( 'cn_link_cached', 'cn_disable_output_cache' ); add_filter( 'cn_date_cached', 'cn_disable_output_cache' ); add_action( 'cn_update-entry', 'cn_enable_output_cache'); add_action( 'cn_save-entry', 'cn_enable_output_cache');TIP: you can use the Code Snippets plugin to add this code to your site having the ability to turn it on and off as needed with a click of a link. It is a plugin I highly recommend.
Hope this clears up a bit of the confusion!
12/02/2015 at 12:47 pm #356877Dwight Bailey
ParticipantSo if there is no way for me to actually delete/remove/empty that cache (only temporarily disable it), then I’ll just have to edit/save them all one at a time so they update.
If the old data will “come back” when you re-enable the caching, then I agree with you, that it would be a bad idea to reduce performance by disabling the cache.
That sort of defeats the CSV upload feature, I imagine, since editing existing records that way would not change the “old” cached values. I look forward to seeing that update (whenever that happens:).
Thanks again for all your help,
Steve K.12/02/2015 at 1:51 pm #356888Steven Zahm
Keymaster@ Steve
re: That sort of defeats the CSV upload feature, I imagine, since editing existing records that way would not change the “old” cached values.
Nope, because the CSV Import add/edits an entry the exact same way as when you add/edit an entry in the admin. So the caches will be refreshed.
12/03/2015 at 9:29 am #356937Dwight Bailey
ParticipantAh, I misunderstood. Thanks for clarifying that for me!
Then I’ll just make a CSV file and re-update my zip codes that way!
Problem solved (as always:).Thanks,
Steve K.12/03/2015 at 9:51 am #356938Steven Zahm
Keymaster@ Steve
No problem!
-
AuthorPosts
- You must be logged in to reply to this topic.
