Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

geo_mashup_save_location tag does not work from WordPress XML-RPC interface #271

Closed
GoogleCodeExporter opened this issue Apr 4, 2015 · 4 comments

Comments

@GoogleCodeExporter
Copy link


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

Attachments:

@GoogleCodeExporter
Copy link
Author

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

  • Changed state: Accepted
  • Added labels: Milestone-1.2.8

@GoogleCodeExporter
Copy link
Author

This issue was updated by revision r555.

I think this will do it - if you can test this version, all the better (Issue 
229 has instructions).

Original comment by dylankk...@gmail.com on 24 Sep 2009 at 3:25

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

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

@GoogleCodeExporter
Copy link
Author

Thanks for the test!

Original comment by dylankk...@gmail.com on 24 Sep 2009 at 5:53

  • Changed state: Verified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant