Warning: Attempt to modify property of...

Kervala
2011-06-09
2013-06-06
  • Kervala
    Kervala
    2011-06-09

    When I enable warnings, I got a lot of :

    Warning: Attempt to modify property of non-object in /home/user/www/nusoap/nusoap.php on line 4845

    You just forgot to browse all items of $this->schemas array.

    It's patched against last CVS version.

    Here is a patch which fix them :

    --- D:/nusoap/nusoap.php    Thu Jun 09 16:30:30 2011
    +++ D:/nusoap/new/nusoap_fixed.php  Thu Jun 09 17:15:11 2011
    @@ -4837,7 +4837,9 @@
                        foreach ($xs->imports as $ns2 => $list2) {
                            for ($ii = 0; $ii < count($list2); $ii++) {
                                if (! $list2[$ii]['loaded']) {
    -                               $this->schemas[$ns]->imports[$ns2][$ii]['loaded'] = true;
    +                               for ($jj = 0; $jj < count($this->schemas[$ns]); $jj++) {
    +                                   $this->schemas[$ns][$jj]->imports[$ns2][$ii]['loaded'] = true;
    +                               }
                                    $url = $list2[$ii]['location'];
                                    if ($url != '') {
                                        $urlparts = parse_url($url);
    
     
  • Lorenzo Luengo
    Lorenzo Luengo
    2011-09-05

    This patch works great! Thanks! I was scared of this nusoap warning…

     
  • tofutim
    tofutim
    2011-09-06

    Thanks.  This thing really must be fixed. On the latest CVS, the error shows up at 4840. The patch definitely stops the warnings.

     

  • Anonymous
    2011-10-11

    You can fix the bug without a for loop, just add the index $ns2:**

    $this->schemas->imports = true;
    **

     

  • Anonymous
    2011-10-11

    I've found another bug. where can I report it? thanks in advance.