MeisterGit / wordpress-java

Automatically exported from code.google.com/p/wordpress-java
Other
0 stars 0 forks source link

newpage error #21

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
./jwordpress --newpage FILENAME --publish publish --url XMLRPC.PHP_PATH --user 
USER --pass PASSWORD

What is the expected output? What do you see instead?
expected: new page published
actual:

org.json.JSONException: JSONArray[0] not found.
    at org.json.JSONArray.get(JSONArray.java:203)
    at net.bican.wordpress.FileParser.putVal(FileParser.java:95)
    at net.bican.wordpress.FileParser.parseFile(FileParser.java:62)
    at net.bican.wordpress.Page.fromFile(Page.java:49)
    at net.bican.wordpress.Main.main(Main.java:152)
org.json.JSONException: Expected a ',' or '}' at 67 [character 68 line 1]
    at org.json.JSONTokener.syntaxError(JSONTokener.java:428)
    at org.json.JSONObject.<init>(JSONObject.java:233)
    at org.json.JSONTokener.nextValue(JSONTokener.java:357)
    at org.json.JSONArray.<init>(JSONArray.java:123)
    at org.json.JSONArray.<init>(JSONArray.java:155)
    at net.bican.wordpress.FileParser.putVal(FileParser.java:94)
    at net.bican.wordpress.FileParser.parseFile(FileParser.java:62)
    at net.bican.wordpress.Page.fromFile(Page.java:49)
    at net.bican.wordpress.Main.main(Main.java:152)
38

What version of the product are you using? On what operating system?
.4 on MacOS 10.6.6

Please provide any additional information below.

Original issue reported on code.google.com by fannybuc...@gmail.com on 27 Feb 2011 at 5:11

GoogleCodeExporter commented 9 years ago
Can you please include the file too?

Original comment by can.bican@gmail.com on 27 Feb 2011 at 9:28

GoogleCodeExporter commented 9 years ago
sure.

Original comment by fannybuc...@gmail.com on 28 Feb 2011 at 8:14

Attachments:

GoogleCodeExporter commented 9 years ago
Getting an existing page and resubmitting back as a new one doesn't always make 
sense, as some fields are auto-generated. I'd skip empty and null fields.

Specifically, the error you are getting is about the categories field. I admit 
it's a bug, and I'll fix it, but meanwhile there is a workaround: Since 
categories are empty, just delete the line that starts with categories and 
retry. Let me know if it works that way.

Original comment by can.bican@gmail.com on 28 Feb 2011 at 9:03

GoogleCodeExporter commented 9 years ago
It turns out that the error mentioned in this issue doesn't stop further 
execution, hence a warning. I made sure that the warning which is raised when 
the array is empty, is not raised.

Original comment by can.bican@gmail.com on 16 Aug 2011 at 12:13