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: 0.7.9.3, action, cn_address_cached, cn_date_cached, cn_email_cached, cn_link_cached, cn_messenger_cached, cn_phone_cached, cn_save-entry, cn_social_network_cached, cn_update-entry, filter
- This topic has 10 replies, 2 voices, and was last updated 8 years, 7 months ago by
Steven Zahm.
-
AuthorPosts
-
01/10/2014 at 5:34 am #276811
Paul Chitson
ParticipantSteven
I have to update the “line_1” field in the wp_connections_address table to a new address. That part was easy however the changes aren’t being reflected when I do a search on a contact from the frontend. Looking at the wp_connections table I can see that the “addresses” field appears to be dynamically created and still contains the old information. Is there a way to get this to update (I’ve noticed if I edit the entry in WP it will update the information.
Thanks for any pointers.
01/10/2014 at 9:17 am #276842Paul Chitson
ParticipantI need to use the search button better, I found this topic that seems to give me a work around. http://connections-pro.com/support/topic/database-updates-not-showing/
If you get around to doing a extension to flush the caches that would be fantastic.
01/10/2014 at 10:07 am #276844Paul Chitson
ParticipantAh, I have found an issue. I’ve added the PHP code as per that thread but only the line that relates to the address. Now when I amend a contact the changes aren’t being saved? If I edit the wp_connections_address table directly the change shows so it looks like when I am hitting update from the Connection Manager the changes aren’t being submitted.
01/10/2014 at 5:25 pm #276862Steven Zahm
Keymaster@ Paul
Hmmm, try this:
function cn_disable_output_cache( $cached ) { if ( ! is_admin() ) return FALSE; } 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' );
That should only affect the display on the frontend while allowing the update to work. The downside is the manage page in the admin will not show the change.
So maybe if you do this instead…
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');
That should remove the filters right before a save or update is done to an entry
01/13/2014 at 4:09 am #276954Paul Chitson
ParticipantHi Steven
Sorry to report neither of those options worked :(
The first gave the following error –
Fatal error: Cannot redeclare cn_disable_output_cache() (previously declared in <PATH>\<THEME>\functions.php:196) in <PATH>\<THEME>\functions.php on line 204
The second still didn’t update the database.
If there was a bit of PHP that could be run to update the cache this would be the ultimate result.
Thanks for your help on this.
01/15/2014 at 11:22 am #277166Paul Chitson
ParticipantHi Steven,
Have you had any time to look into this one for me?
Thanks
01/16/2014 at 3:32 pm #277279Steven Zahm
Keymaster@ Paul
You received the error because you had the
cn_disable_output_cache
twice. The second piece of code I gave was to replace the first I gave you.I tested it and it did work.
Lets try this. Remove all the code I gave from where you added it. Install the Code Snippets plugin. After is is installed and activated import the attached snippet. To access the import page, visit the Tools > Import admin page in the WordPress admin and click on the Code Snippets link.
After you have imported it, activate the snippet.
-
This reply was modified 8 years, 7 months ago by
Steven Zahm. Reason: Add snippet
Attachments:
You must be logged in to view attached files.01/17/2014 at 6:23 am #277309Paul Chitson
ParticipantHi Steven
Thank you for your continued help on this.
I’ve restored the Functions.php file back to its original state. Installed Code Snippets and imported the XML file. All good so far. On testing I am still not getting the result I am looking for, which is shame.
If I update the Line_1 from the Connections Manager screen. The change is saved into the wp_connections table in “addresses”. However the wp_connections_address table remains unaltered. Thus when looking at the persons contact details it isn’t showing the update because its now looking at the wp_connections_address table and not wp_connections. I hope that makes sense.
While you are working on this I am also trying to create a SQL query to extract all the user information so I can do a re-import. That is providing it’s own challenges but it will give us a second option.
Thanks again.
01/17/2014 at 11:20 am #277339Steven Zahm
Keymaster@ Paul
Did you activate the snippet after you imported it? Keep in mind, the snippet will have to forever be activated because now the cache and the table will be out of sync until the entry is manually updated on the Connections : Manage Edit admin page.
Are you, by chance, running a caching plugin like WP Super Cache or W3TC? If you are, make sure you flush the page cache.
I’ve tested and retested the snippet. With it activated, I could update
line_1
in thewp_connections_address
table directly and it would show correctly on the frontend. If I edited the same entry that I edited directly in thewp_connections_address
table, using the Connections : Manage Edit admin page, both thewp_connections_address
table and thewp_connections
table :addresses
column would be updated accordingly which in turn would show the update correctly on the frontend correctly.01/20/2014 at 5:26 am #277518Paul Chitson
ParticipantHi Steven
I am running this site on IIS and there is caching enabled there. However I don’t have any additional caching enabled on the WP side. I will do some more experiments on the dev system to see if I can work out what is going on. It looks like from your trails it should work.
In the meantime I have successfully pulled all the data out via a query and imported them back in so they are correct on the live system now.
Again thanks for your support on this.
-
This reply was modified 8 years, 7 months ago by
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.