I can confirm this. Nice work Chris!
Tommie
Chris Chabot wrote:
Ok fix is in SVN now, decided to go for the quick hack solution and go
with :
$contents = preg_replace('/[^http:\/\/|^https:\/\/]\/\/.*$/m', '',
preg_replace('@/\\*(?:.|[\\n\\r])*?\\*/@', '', $contents));
svn update and you should be up and running again with the default
config.
-- Chris
On Jun 11, 2008, at 2:29 PM, Chris Chabot wrote:
Correct it's the JSON decoding of the container.js configuration
that is failing.
It's not related to REST or anything though it's much simpler then
that (please stop pointing at that Ram, because it usually has
nothing to do with anything and it confuses people, and such pre-
dispositions often get in the way of finding and fixing the actual
issue)
What happens is that the PHP implementation strips all comments from
the container.js file since comments crash the json decoder, as you
can see in ContainerConfig.php:54
// remove all comments (both /* */ and // style) because this
confuses the json parser
// note: the json parser also crashes on trailing ,'s in records so
please don't use them
$contents = preg_replace('/\/\/.*$/m', '', preg_replace('@/\\*(?:.|[\
\n\\r])*?\\*/@', '', $contents));
The problem with this regex is that it removes everything after a //
and http:// .... has a //
So it replaces "urlTemplate" : "http://localhost/gadgets/profile?
{var}", with "urlTemplate" : "http:/
which is broken JSON ... so the decoding fails, and without a
configuration shindig fails too..
the quick fix for now is to remove those 2 lines ("urlTemplate" : "http://localhost/gadgets/profile?
{var}", from your container.js (those values aren't used atm
anyhow), and i'll see if i can't think of a smarter regex that
doesn't break on res:// type notations (any suggestions are welcome)
-- Chris
On Jun 11, 2008, at 2:21 PM, Tommie Podzemski wrote:
Correct, i thank thee!
Are there some steps i can take to fix to this on "my" side, or is
it a case of sit back and wait for the Restful API to implemented
completely?
Regards,
Tommie
Ram Sharma wrote:
if you comment this line then it will start working
"urlTemplate" :
"http://192.168.41.115/gadgets/profile?{var}<http://192.168.41.115/gadgets/profile?%7Bvar%7D
",
Because of this line it is thrwoing an exception from
src/gadget/containerconfig.php in json decode line. It is not
decoding it
from json object to array just because this line.
On Wed, Jun 11, 2008 at 5:40 PM, Ram Sharma
<[EMAIL PROTECTED]> wrote:
HI Tommie ,
it is coming because the new line added in config/container.js. I
think it
is meant for Restfull API but Restful API is not implemented
completely till
now as per my knowladge
.
"urlTemplate" : "http://192.168.41.115/gadgets/profile?{var}<http://192.168.41.115/gadgets/profile?%7Bvar%7D
",
On Wed, Jun 11, 2008 at 5:34 PM, Tommie Podzemski
<[EMAIL PROTECTED]> wrote:
Hiya,
Anyone else ending up with this error (No gadgets.container
value set for)
after todays checkout from trunk?
It was working fine before that. I'm still learning in terms of
usage with
this, so i'd just like to confirm if this is a bug or feature :)
My request URL looks like this:
http://xxx/gadgets/ifr?container=default&mid=2&country=ALL&lang=ALL&view=canvas&parent=http%3A%2F%2Fxxx&up_username=xxx&url=http%3A%2F%2Fxxx%2Fmodname%2Findex.xml#rpctoken
=511432611
I still haven read up properly on the security-token generation
yet, but i
don't think that the problem here as it was working fine before
this update.
Am i'm missing something obvious here?
Thanks in advance,
Tommie
--
Ram Sharma
Software Engineer
Impetus Infotech (India) Pvt Ltd
Indore