Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Wiriing Editor Example Save Does Not Work

#21

I have created the mysql database 'wireit' and the table 'wirings.' I have configure the WiringEditor.php to use this database.

However, saves do nothing, and listWirings POST of:

{id

results in:

{

What have I done wrong? I am hesitant to move forward customizing things without getting the basic example working.

Reported by tacoman · July 7th, 2009 @ 10:13 AM

State: resolved
Milestone: 0.5.0

Activity

  1. tacoman
    tacoman

    Sorry:

    POST:

    {"id":1,"method":"listWirings","params":{"language":"jsBox"},"version":"json-rpc-2.0"}
    

    Reply:

    {"id":1,"result":null,"error":"unknown method 'listWirings' or incorrect parameters"}
    

    July 7th, 2009 @ 10:14 AM

  2. eric.abouaf (at gmail)
    eric.abouaf (at gmail)

    Hi,

    The sample php backend requires php 5.2. Could you give us your version ? (<?php phpinfo(); ?>)

    Did you change the database username/password in backend/php/WiringEditor.php ?

    July 7th, 2009 @ 11:11 AM

  3. tacoman
    tacoman

    First of all - thanks so much for the prompt reply :)

    my-macbook-pro:~ peyomp$ php --version
    PHP 5.2.8 (cli) (built: Feb 5 2009 21:21:13)

    I did edit the WiringEditor.php.

    July 7th, 2009 @ 11:16 AM

  4. eric.abouaf (at gmail)
    eric.abouaf (at gmail)

    quick again:

    Could you try the phpinfo() through your webserver ? The cli and cgi versions might be different...

    Anyway, the error only comes from the small backend/php/WiringEditor.php file, so you might try to debug it...

    Can you see if the databse is queried ?

    July 7th, 2009 @ 11:25 AM

  5. tacoman
    tacoman

    Eric, I got it working. Thanks!

    July 11th, 2009 @ 01:46 PM

  6. tacoman
    tacoman

    Eric, one issue I was having is that the header information is incorrect in the POSTs from WiringEditor. You need to set it to application/json in YUI with this line:

    YAHOO.util.Connect.setDefaultPostHeader('application/json');

    I put that at the top of WiringEditor.js just after you assign Yahoo.util, and now any framework can read your YUI JSONRPC, not just PHP.

    July 12th, 2009 @ 04:49 PM

  7. eric.abouaf (at gmail)
  8. eric.abouaf (at gmail)

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.