map coordinates had stopped being extracted

map coordinates had stopped being extracted
geeklover 2016-09-23 13:48
Hi, we have configured the wp-autopost so properties from here http://realbg.gr/ to automatically get posted here http://www.yper-aggelies.gr/ . The connection was not perfect but was working (see http://wp-autopost.net/support/?topic=447 ) until some days ago the connection for the map coordinates custom fields stop working. In particular, we have these 2 matching rules (see attachment rules.png) to the article Extraction settings one for latitude custom field and the other for longitude custom field.

We didn't change anything, suddenly these 2 custom field stopped getting their values.

Why is that? Please advise, thanks.


Attachment: rules.png
  
WP-AutoPost 2016-09-25 13:46
we check the one source page
http://realbg.gr/property/%ce%ba%cf%84%ce%ae%cf%81%ce%b9%ce%bf-800-%cf%84-%ce%bc/

the rule fetch this page should be right.

google.maps.LatLng(
,


google.maps.LatLng((*),
)

  
WP-AutoPost 2016-09-25 13:47
we just test it, it is works on this page
http://realbg.gr/property/%ce%ba%cf%84%ce%ae%cf%81%ce%b9%ce%bf-800-%cf%84-%ce%bc/

In Test
  
geeklover 2016-09-26 08:22
Well yes as we notice it's coming right but because slider images doesn't come right we had found the solution to go edit the post and just click "update" and then post showed fine (see http://wp-autopost.net/support/?topic=447 ) . But now although coordinates come right when go to just click update coordinates are lost. So in your test above it showed right but with no images as you probably see. We had to go to edit and click "update" , then images showed but coordinates disappeared and we had to enable them manually again.
  
geeklover 2016-09-28 07:35
Hi, any answer to my problem???
  
WP-AutoPost 2016-09-29 14:20
we are no idea about this, when you click the "update" in wordpress the coordinates will disappeared, that sounds strange. are you check on your database table, the coordinates should saved in wp_postmeta table.
  
WP-AutoPost 2016-09-29 14:22
check your wp_postmeta table before and after your click "update", find out is it some change in coordinates data after your click the “update”
  
geeklover 2016-09-30 12:35
i checked and before clicking "update" the coordinates are there, after clicking update the coordinates are gone and then after i manually inputted them there here again, that's weird
  
geeklover 2016-09-30 12:35
Any ideas???
  
geeklover 2016-10-04 08:22
Anyone??
  
geeklover 2016-10-11 07:27
Can i have an answer please???
  
WP-AutoPost 2016-10-19 03:10
Sorry, we think about this problem long time, we can find what problem, when you click the update in wordpress, this plugin will not works in this process.

we can help you write this code try save the two value again. if this can not work in you, we turely have no idea.

Try add those code to your theme's function files ( functions.php )
And replace the YOUR_CUSTOMER_FILED_1 and YOUR_CUSTOMER_FILED_2 to your customer filed name that you used.
Code: Select All

$customer_filed_1 = 'YOUR_CUSTOMER_FILED_1';
$customer_filed_2 = 'YOUR_CUSTOMER_FILED_2';

$customer_filed_1_value;
$customer_filed_2_value;

function post_updated_before($post_ID){
global $wpdb;
global $customer_filed_1,$customer_filed_2;
global $customer_filed_1_value,$customer_filed_2_value;

$querystr = "SELECT meta_value FROM ".$wpdb->postmeta." WHERE post_id = ".$post_ID." AND meta_key='".$customer_filed_1."'";
$customer_filed_1_value = $wpdb->get_var($querystr);

$querystr = "SELECT meta_value FROM ".$wpdb->postmeta." WHERE post_id = ".$post_ID." AND meta_key='".$customer_filed_2."'";
$customer_filed_2_value = $wpdb->get_var($querystr);

}
add_filter( 'post_updated', 'post_updated_before', 10, 3 );


function post_updated_after($post_ID){
global $wpdb;
global $customer_filed_1,$customer_filed_2;
global $customer_filed_1_value,$customer_filed_2_value;

$customer_filed_1_value .= 'aaa';
$customer_filed_2_value .= 'bbb';

update_post_meta( $post_ID, $customer_filed_1,$customer_filed_1_value);
update_post_meta( $post_ID, $customer_filed_2,$customer_filed_2_value);


}
add_action( 'post_updated', 'post_updated_after', 10, 3 );
  
geeklover 2016-10-20 09:37
I put the code below to theme's function files ( functions.php )

$customer_filed_1 = 'dynamic_post_location_latitude';
$customer_filed_2 = 'dynamic_post_location_longitude';

$customer_filed_1_value;
$customer_filed_2_value;

function post_updated_before($post_ID){
global $wpdb;
global $customer_filed_1,$customer_filed_2;
global $customer_filed_1_value,$customer_filed_2_value;

$querystr = "SELECT meta_value FROM ".$wpdb->postmeta." WHERE post_id = ".$post_ID." AND meta_key='".$customer_filed_1."'";
$customer_filed_1_value = $wpdb->get_var($querystr);

$querystr = "SELECT meta_value FROM ".$wpdb->postmeta." WHERE post_id = ".$post_ID." AND meta_key='".$customer_filed_2."'";
$customer_filed_2_value = $wpdb->get_var($querystr);

}
add_filter( 'post_updated', 'post_updated_before', 10, 3 );


function post_updated_after($post_ID){
global $wpdb;
global $customer_filed_1,$customer_filed_2;
global $customer_filed_1_value,$customer_filed_2_value;

$customer_filed_1_value .= 'aaa';
$customer_filed_2_value .= 'bbb';

update_post_meta( $post_ID, $customer_filed_1,$customer_filed_1_value);
update_post_meta( $post_ID, $customer_filed_2,$customer_filed_2_value);


}
add_action( 'post_updated', 'post_updated_after', 10, 3 );


it didnt worked, is the above code right or did i have to replace the YOUR_CUSTOMER_FILED_1 and YOUR_CUSTOMER_FILED_2 with something else?
  
WP-AutoPost 2016-10-21 03:20
and delete those two line code

$customer_filed_1_value .= 'aaa';
$customer_filed_2_value .= 'bbb';

this is for out test, we forget delete it.

Are you check your database wp_postmeta table ?
  
geeklover 2016-10-21 08:43
I deleted those two line of code and test again. Still same problem . Checked my wp_postmeta table. It seems now that before and after "update" coordinates are there but they are the wrong coordinates.
Actually before and after "update" the values remain the same
dynamic_post_location_latitude 40.8380938
dynamic_post_location_longitude 24.303267199999937

Now these coordinates are the default for the site in case there are no coordinates inputted.
  
WP-AutoPost 2016-10-21 15:43
Sorry, We truely have no idear about this. those codes is our last way that we can think about how to fixed this.