You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem description & how to reproduce it :
1. Create a post that has the tag "geo_mashup_save_location". The issue can
be reproduced when using the XML-RPC interface, but not from a browser. I
use WordMobi (mobile based wordpress blogging software @
http://code.google.com/p/wordmobi/) to create & publish this post.
2. The post gets saved, without the (lat, lon) information. However, the
tag(shortcode) is removed from the post.
3. Net result : WordPress post has been saved, but without the (lat,lon)
information.
Expected output : Post should have been saved with (lat,lon) information.
---
Software versions
Geo Mashup Plugin : 1.2.7
WordPress : 2.8.4
---
I have looked into the problem, and here is my analysis:
The cause of the problem seems to be in file geo-mashup.php, function
load_hooks():
"save_post" is added as a filter only if is_admin() returns true.
is_admin() returns true only when the person posting is using a browser
interface (plus is logged in properly).
When the post (with the tag) is created using XML-RPC, the
'content_save_pre' hook gets invoked. The tag gets parsed, the geo
information is obtained, and the tag gets removed from the content.
However, the hook for 'save_post' does not get invoked in this scenario.
Due to this, the geo location does not get saved.
A possible fix : Add the 'save_post' hook irrespective of "is_admin()". I
have made this modification in the attached file. I'm no wordpress guru, so
I am not sure if this is completely correct. However, this change works for
me at the moment.
I'm not familiar with the functionality enabled by 'wp_handle_upload', but
please have a look at that too.
Original issue reported on code.google.com by shree.sh...@gmail.com on 24 Sep 2009 at 12:04
Good analysis - thank you. I had actually found and addressed this problem in
1.3alpha1 when I tried to use a mobile client - but I was on a trip and forgot
about
it when I returned :). I appreciate the reminder - I'll try to get this into
1.2.8.
Original comment by dylankk...@gmail.com on 24 Sep 2009 at 1:22
Yes, that should do. The 'save_post' part works for me. Thank you.
I couldn't test the 'wp_handle_upload' part, but that's because I'm not
uploading any
KML files.
Original comment by shree.sh...@gmail.com on 24 Sep 2009 at 5:37
Original issue reported on code.google.com by
shree.sh...@gmail.com
on 24 Sep 2009 at 12:04Attachments:
The text was updated successfully, but these errors were encountered: