Title: Array to string conversion
Last modified: August 22, 2016

---

# Array to string conversion

 *  [mnukka](https://wordpress.org/support/users/mnukka/)
 * (@mnukka)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/array-to-string-conversion/)
 * I have debugging enabled from wp-config and get the following warnings:
 *     ```
       Notice: Array to string conversion in /var/www/html/wp-content/plugins/ssh-sftp-updater-support/class-wp-filesystem-ssh2.php on line 316
   
       Notice: Array to string conversion in /var/www/html/wp-content/plugins/ssh-sftp-updater-support/class-wp-filesystem-ssh2.php on line 317
       ```
   
 * Which I think are the following lines:
 *     ```
       $struc['owner']         = $this->owner($path.'/'.$entry, $entry['uid']);
                               $struc['group']         = $this->group($path.'/'.$entry, $entry['gid']);
       ```
   
 * [https://wordpress.org/plugins/ssh-sftp-updater-support/](https://wordpress.org/plugins/ssh-sftp-updater-support/)

Viewing 10 replies - 1 through 10 (of 10 total)

 *  [Michael Heuberger](https://wordpress.org/support/users/michaelheuberger/)
 * (@michaelheuberger)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/array-to-string-conversion/#post-5242325)
 * Yep, me too. Please fix it.
 * Also this one error:
 * `Strict Standards: Declaration of WP_Filesystem_SSH2::delete() should be compatible
   with WP_Filesystem_Base::delete($file, $recursive = false, $type = false) in /
   var/www/signdna/dev/wordpress/wp-content/plugins/ssh-sftp-updater-support/class-
   wp-filesystem-ssh2.php on line 25`
 * Thanks!
 *  [Emil Gustafsson](https://wordpress.org/support/users/gesen/)
 * (@gesen)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/array-to-string-conversion/#post-5242327)
 * I’ve got both of these problem too. It’s mainly a problem in test environments
   where we have WP DEBUG/error reporting on. Still, it should be fixed.
 *  [jeroenmsi](https://wordpress.org/support/users/jeroenmsi/)
 * (@jeroenmsi)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/array-to-string-conversion/#post-5242345)
 * Just in case:
    As is quickly visible, problem is (array) $entry. Change the code
   from the first post to this and it’s solved:
 *     ```
       $struc['owner']         = $this->owner($path, $entry['uid']);
                               $struc['group']         = $this->group($path, $entry['gid']);
       ```
   
 *  [jumbo](https://wordpress.org/support/users/jumbo/)
 * (@jumbo)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/array-to-string-conversion/#post-5242349)
 * I’ll chime in with one more:
 *     ```
       [08-Jan-2015 06:02:07 UTC] PHP Warning:  Invalid argument supplied for foreach() in /home/user/public_html/wp-content/plugins/ssh-sftp-updater-support/class-wp-filesystem-ssh2.php on line 300
       ```
   
 *  [brettv](https://wordpress.org/support/users/brettv/)
 * (@brettv)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/array-to-string-conversion/#post-5242361)
 * I believe this will fix the problems with these warnings.
 * I traced the calling process through the system, and the rawlist() call returns
   an array indexed using the name of the file. It seemed the author assumed that
   using the array name itself would return index sub “0”. The other problem seems
   that WP might have changed the function call for delete, and the method definition
   parameters need to match the calling parameters.
 * Here are the 2 simple adjustments that I do believe will fix the problems and
   make the warnings go away – they did for me.
 * Open the file:
 * /wp-content/plugins/ssh-sftp-updater-support/class-wp-filesystem-ssh2.php
 * Find this line (around 218):
    function delete($file, $recursive = false) {
 * And change it to this:
    function delete($file, $recursive = false, $type = false){
 * For the other error, find this block (at 316 and 317):
    $struc[‘owner’] = $this-
   >owner($path.’/’.$entry, $entry[‘uid’]); $struc[‘group’] = $this->group($path.’/’.
   $entry, $entry[‘gid’]);
 * and change it to this:
    $struc[‘owner’] = $this->owner($path . ‘/’ . key($entry),
   $entry[‘uid’]); $struc[‘group’] = $this->group($path . ‘/’ . key($entry), $entry[‘
   gid’]);
 *  [gr0g](https://wordpress.org/support/users/gr0g/)
 * (@gr0g)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/array-to-string-conversion/#post-5242365)
 * Any plans on integrating this into a fix and releasing?
 * Thanks
 *  [gr0g](https://wordpress.org/support/users/gr0g/)
 * (@gr0g)
 * [11 years ago](https://wordpress.org/support/topic/array-to-string-conversion/#post-5242377)
 * [@terrafrost](https://wordpress.org/support/users/terrafrost/) any reason you
   don’t include this in? don’t you see these warnings on your side?
 *  Plugin Author [TerraFrost](https://wordpress.org/support/users/terrafrost/)
 * (@terrafrost)
 * [11 years ago](https://wordpress.org/support/topic/array-to-string-conversion/#post-5242378)
 * [@gr0g](https://wordpress.org/support/users/gr0g/) – I’ll try to look into this
   this week.
 * I have not seen this error before but the server I develop this on probably does
   not have error_reporting set in a way that’ll make this error display.
 * As for why I haven’t addressed this earlier… this plugin isn’t my main focus 
   in life. I only have so much time in the day and I have to prioritize how I spend
   it and sadly this plugin gets prioritized considerably farther down than a lot
   of other stuff. And unless this plugin starts making me a ton of money I don’t
   really see that changing.
 * I mean, I’m checking up on support topics right now but I’ll stop at some point.
   I am not going to let this plugin take away from other activities that I either
   enjoy more or that pay the bills. At least not on a long term basis.
 * Anyway, that’s why it hasn’t been addressed earlier. None-the-less, now that 
   I am aware of this issue, I’ll try to address it this week as time permits.
 * Thank you for your patience.
 *  [gr0g](https://wordpress.org/support/users/gr0g/)
 * (@gr0g)
 * [11 years ago](https://wordpress.org/support/topic/array-to-string-conversion/#post-5242380)
 * [@terrafrost](https://wordpress.org/support/users/terrafrost/), thank you for
   your reply!
 * I totally understand – just a note to tell you know that there are other developers
   around – so feel free to indicate if there’s any task you’d want help with /etc..(
   even e.g. using github) since we can also pitch in!
 * i.e. I’m sure many of us are willing to help stabilize it – the thing would be
   to just get some merges back into master from your side.
 * Thanks again,
 *  Plugin Author [TerraFrost](https://wordpress.org/support/users/terrafrost/)
 * (@terrafrost)
 * [11 years ago](https://wordpress.org/support/topic/array-to-string-conversion/#post-5242381)
 * The latest commit to trunk should fix these errors:
 * [https://plugins.trac.wordpress.org/changeset?sfp_email=&sfph_mail=&reponame=&old=1158434%40ssh-sftp-updater-support%2Ftrunk&new=1158434%40ssh-sftp-updater-support%2Ftrunk&sfp_email=&sfph_mail=](https://plugins.trac.wordpress.org/changeset?sfp_email=&sfph_mail=&reponame=&old=1158434%40ssh-sftp-updater-support%2Ftrunk&new=1158434%40ssh-sftp-updater-support%2Ftrunk&sfp_email=&sfph_mail=)

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Array to string conversion’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/ssh-sftp-updater-support.svg)
 * [SSH SFTP Updater Support](https://wordpress.org/plugins/ssh-sftp-updater-support/)
 * [Support Threads](https://wordpress.org/support/plugin/ssh-sftp-updater-support/)
 * [Active Topics](https://wordpress.org/support/plugin/ssh-sftp-updater-support/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ssh-sftp-updater-support/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ssh-sftp-updater-support/reviews/)

 * 10 replies
 * 8 participants
 * Last reply from: [TerraFrost](https://wordpress.org/support/users/terrafrost/)
 * Last activity: [11 years ago](https://wordpress.org/support/topic/array-to-string-conversion/#post-5242381)
 * Status: not resolved