Download & Extend

drupal_ftp_connect() not checking connections correctly

Project:Backup and Migrate
Version:7.x-2.3
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (won't fix)

Issue Summary

- see next message, ignore this patch.

AttachmentSize
backup-migrate-722-ftp-empy-connection.patch673 bytes

Comments

#1

Problem

Hi there,

I'm trying to use the sandbox module feeds_ftp_fetcher with drupal 7.
I fixed some issues in the sandbox but also ran into a problem with destnation.ftp.inc

I kept getting 'unable to connect'errors and tracked it down to this (line 120):

if (!ftp->__conn && !drupal_ftp_connected($ftp)) {

Proposed solution

Connection is empty so remove the ! before first condition.
Use empty() to check for connection:

if (empty(ftp->__conn) && !drupal_ftp_connected($ftp)) {

Patch

I attached a patch for this minor fix.

AttachmentSize
backup-migrate-722-ftp-empy-connection.patch 670 bytes

#2

Status:active» fixed

Looks good. Committed to dev.

Thanks

#3

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

#4

Version:7.x-2.2» 7.x-2.3
Status:closed (fixed)» active

Reopening this issue because I am still getting these 'unable to connect' errors although the ftp transfer works well (Version 7.x-2.3):

Example:

05.06.2012 - 10:42 FTP Error: Couldn't connect to server MyFTPServer
05.06.2012 - 10:42 Default Database backed up successfully to MyDB-2012-06-05T10-42-27 in destination MyFTPServer in 2884.25 ms.
05.06.2012 - 10:42 Public Files Directory backed up successfully to MyFiles-2012-06-05T10-43-28 in destination MyFTPServer in 495.48 ms.

The files are saved properly on MyFTPServer.
So I think there must be an additional reason causing this error.

#5

Status:active» closed (won't fix)

I'm not able to reproduce this, but if your backups are still working, then I'm not sure how much I'd worry about it. Reopen if you have more info.