From: Markus W. <wo...@21...> - 2005-09-07 21:04:40
|
Hey there, imagine the following PHP code in the server-side: function doSomething($param) { if (!is_array($param)) { return false; } $sql = "SELECT foo FROM bar WHERE baz IN (".implode(',',$param).")"; return true; } I have several methods like the one above. Most of them work. But when I call some of them via JPSpan, a popup shows up (no exception, not catchable), stating: [Server error] Error while calling server.dosomething(): Array to string conversion. That error message actually is a PHP notice, so it seems as if the code threw a notice which is intercepted and displayed on the client by JPSpan, but when I call the method from the server-side (not using JPSpan), no notice will ever show up. Thus, it is my suspicion that somehow the error is within JPSpan, but without more information on the origin of the error, I don't even know where to start looking... does anyone have any ideas? CU Markus |
From: Harry F. <hf...@gm...> - 2005-09-07 21:37:23
|
That's a result of JPSpan's ErrorHandler.php script - basically it's seeing= =20 E_NOTICE errors whether you disable them or not. The error handler should= =20 probably be updated to check your current setting (personally always have= =20 E_NOTICE on). A simple hack would be comment out the following in=20 ErrorHandler.php case E_USER_NOTICE: $code =3D 2001; break; On 9/7/05, Markus Wolff <wo...@21...> wrote: >=20 > Hey there, >=20 > imagine the following PHP code in the server-side: >=20 > function doSomething($param) > { > if (!is_array($param)) { > return false; > } >=20 > $sql =3D "SELECT foo FROM bar WHERE baz IN (".implode(',',$param).")"; > return true; > } >=20 > I have several methods like the one above. Most of them work. But when I > call some of them via JPSpan, a popup shows up (no exception, not > catchable), stating: >=20 > [Server error] Error while calling server.dosomething(): Array to string > conversion. >=20 > That error message actually is a PHP notice, so it seems as if the code > threw a notice which is intercepted and displayed on the client by > JPSpan, but when I call the method from the server-side (not using > JPSpan), no notice will ever show up. >=20 > Thus, it is my suspicion that somehow the error is within JPSpan, but > without more information on the origin of the error, I don't even know > where to start looking... does anyone have any ideas? >=20 > CU > Markus >=20 >=20 > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development Lifecycle=20 > Practices > Agile & Plan-Driven Development * Managing Projects & Teams * Testing & Q= A > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf > _______________________________________________ > Jpspan-discuss mailing list > Jps...@li... > https://lists.sourceforge.net/lists/listinfo/jpspan-discuss > |
From: Markus W. <wo...@21...> - 2005-09-08 09:16:40
|
Hi Harry, nope, this doesn't do the trick. Although looking at the PHP sources, this message is considered a notice, it doesn't seem to be transferred to the error handler as such. I've logged the error within the error handler and this is what it gets: [08-Sep-2005 11:09:38] [JPSpan] Server_Error: Array to string conversion in /home/mwolff/public_html/mediadb/xul_server.php (line:325) - code: 2000, orig. level: 8 I have no idea to what E_* constant the level 8 corresponds, but then again I have no idea why the hell such a simple piece of code would ever throw any error in the first place. CU Markus Harry Fuecks wrote: > That's a result of JPSpan's ErrorHandler.php script - basically it's > seeing E_NOTICE errors whether you disable them or not. The error > handler should probably be updated to check your current setting > (personally always have E_NOTICE on). A simple hack would be comment out > the following in ErrorHandler.php > > case E_USER_NOTICE: > $code = 2001; > break; > > > > On 9/7/05, *Markus Wolff* <wo...@21... <mailto:wo...@21...>> wrote: > > Hey there, > > imagine the following PHP code in the server-side: > > function doSomething($param) > { > if (!is_array($param)) { > return false; > } > > $sql = "SELECT foo FROM bar WHERE baz IN > (".implode(',',$param).")"; > return true; > } > > I have several methods like the one above. Most of them work. But when I > call some of them via JPSpan, a popup shows up (no exception, not > catchable), stating: > > [Server error] Error while calling server.dosomething(): Array to string > conversion. > > That error message actually is a PHP notice, so it seems as if the code > threw a notice which is intercepted and displayed on the client by > JPSpan, but when I call the method from the server-side (not using > JPSpan), no notice will ever show up. > > Thus, it is my suspicion that somehow the error is within JPSpan, but > without more information on the origin of the error, I don't even know > where to start looking... does anyone have any ideas? > > CU > Markus |