Using Flash I can connect to D7 using system.connect and get session ID back as expected. But when I click anything within Drupal the next time I get 3 error messages:
•Notice: Undefined index: args in AmfServerServiceProxy->execute() (line 89 of C:\Program Files\xampp\htdocs\drupal-7.0-flash\sites\default\modules\services\servers\amfserver\amfserver.resources.inc).
•Notice: Undefined index: args in AmfServerServiceProxy->execute() (line 99 of C:\Program Files\xampp\htdocs\drupal-7.0-flash\sites\default\modules\services\servers\amfserver\amfserver.resources.inc).
•Warning: Invalid argument supplied for foreach() in AmfServerServiceProxy->execute() (line 99 of C:\Program Files\xampp\htdocs\drupal-7.0-flash\sites\default\modules\services\servers\amfserver\amfserver.resources.inc).
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | Error message.JPG | 102.63 KB | BeyersdorferTJ |
Comments
Comment #1
marcingy commentedMoving project given nature of errors.
Comment #2
rolf vreijdenberger commentedHi beyersdoferTJ.
what do you mean by 'when I click anything within drupal'?
Are you doing flash only and can you give a little more context as to when this error happens?
Where do you get the error? It seems like it's html output.
Do you run a flash app inside your drupal html output?
Can you provide a screenshot?
what are the steps to reproduce?
etc.
thanks for pointing it out!
Comment #3
BeyersdorferTJ commentedThe Flash app starts from within Drupal and works fine consuming 100% of the screen. However, when I close it and come back to the "normal" Drupal page I get the error messages. As far as I've looked into it the error messages are produced when you use system.connect from Flash. (other don't produce more messages- for example system.get_variable works.)
If I have my Drupal page open and connect from outside with my Flash, than I get exaclty the same error massages as soon as I load any new page within Drupal as attached. If my Flash would connect n times from outside I would get n multipied by 3 error messages. If I reload the same page all the messages are gone (till next system.connect). So it seems to me that the error messages are queued anywhere and the queue is handled when I load a normal page.
Comment #4
rolf vreijdenberger commentedThanks,
on a different note, I don't think that you'd need to use system.connect anymore, since you'll have no need of the session Id since in D7, session handling is fundamentally changed for services and is working differently on a low level actionscript/browser/services implementation.
Could you try doing things without system.connect? My guess is everything would work fine.
the message seems to come from a call to the Zend AMF server handled via the amfserver where no arguments are given. But going throught the stack this seems to be 'not possible'.
I can fix this by checking the 'args' but it should not happen at all. It would greatly help if you check working without system.connect and posting feedback.
Comment #5
BeyersdorferTJ commentedIt worked fine without system.connect !!! Seems I've used an old docu.
Thanks
:-)
Comment #6
rolf vreijdenberger commentedand thank you my friend :-)
Comment #7
giorgio79 commentedHello Guys,
I just encountered this issue with system connect:
"Warning: Invalid argument supplied for foreach() in AmfServerServiceProxy->execute() (line 99 of... "
The error does not crash the site though.
system.connect is ideal if I login the user through Drupal, and just get the session with system connect for Flash.
If we should not use it, how could we get the currently logged in user data from the browser easily without having to relogin?
Comment #8
giorgio79 commentedMore accurate title for searchers
Also, I notice I only get the
The undefined args seem to be gone.
Comment #9
giorgio79 commentedHope you dont mind if I set it back to active. system.connect is essential I believe.
Comment #10
rolf vreijdenberger commentedHi Giorgio,
can you give me a step by step explanation of what you mean?
Is this the same for every browser, I can remember (from way back) that IE reused the session from the browser in flash but not firefox (long time ago with afmphp)?
so like:
1. user visits drupal site without flash
2. user logs in
3. user visits page with flash element.
4. flash element tries system connect?
etc
thanks
Comment #11
giorgio79 commentedHey Rolf,
Yes, those are the exact steps. I am using Firefox.
1. user visits drupal site without flash
2. user logs in
3. user visits page with flash element.
4. flash element performs system connect
5. browse to another page, or do a page refresh for the error to appear.
This does not break anything it seems so far but it still shows as a warning.
Comment #12
rolf vreijdenberger commentedGiorgio,
I believe the error is because the services module itself does not enforce any argument checking on the passed arguments to a remote method call. Instead, services thinks the responsibility should rest on the server implementation itself
Since the amfserver does handle this (because I saw this as a shortcoming of services) and checks for optional and mandatory arguments, providing sensible defaults, this bug was introduced.
in the services module in system_resource.inc, there is no 'args' defined for system.connect, hence the validation code chocked on system.connect.
I made a fix and will put it in the next release.
thanks for your help
Comment #13
rolf vreijdenberger commentedComment #14
giorgio79 commentedLovely, appreciated.