remotestorage / remotestorage.js

⬡ JavaScript client library for integrating remoteStorage in apps
https://remotestoragejs.readthedocs.io
MIT License
2.31k stars 141 forks source link

wappblog example shows error alert "please define a method inside your command" #2

Closed canadaduane closed 13 years ago

canadaduane commented 13 years ago

After following all of the directions to begin the wappblog app, I have arrived at the point where there is a textbox where I can enter my "first blog post" (http://helloblog.com/unhosted/wappside/examples/wappblog/admin/editor.html).

When I press the "unhost this blogpost!" submit button, I get an alert box that says:

ERROR:
please define a method inside your command

What have I done wrong?

michielbdejong commented 13 years ago

hm, hard to tell from here. can you see what it is sending inside the POST? An easy way to see this is using Firefox -> FireBug -> "Net" tab, find the POST to unhosted.php, expand it, and check the "Post" tab. You could also try to find out using tcpdump or WireShark. Or in side unhosted.php put something like file_put_contents('/tmp/test.txt', var_export($_POST, true));

the error reporting could be more granular anyway, it's been on the tasks-list. sorry!

michielbdejong commented 13 years ago

ok, i found a user with the same problem, and was able to work out why this happened: magic quotes! :) if yours is the same problem, then it should work if you download the latest version of the v0.1 tarball

canadaduane commented 13 years ago

Hmm, no luck. I'm using the latest from github/master now. Here is the post data:

cmd {"method":"GET","chan":"7db31","keyPath":"myFirstUnhostedBlogPost"}
protocol    UJ/0.1
michielbdejong commented 13 years ago

can you join #unhosted on irc.freenode.net so we can debug it?

robotarmy commented 13 years ago

If you checked out the git repo - you need to use the v0.1 branch

git checkout v0.1

symroe commented 13 years ago

Checking out the correct branch (v0.1) fixed this for me too. Had to make a local branch from the origin though:

git checkout origin/v0.1 -b v0.1

michielbdejong commented 13 years ago

i merged v0.1 to master to hopefully fix this. Please note that this repository is now obsolete, and switch to https://github.com/DanielG/unhosted.js