When #609772: Impossible to extend the FileTransfer class system in contrib moved hostname and port down into advanced, form_state['values'] structure changed. This changes it back. And, fixes a stupid braino in ssh.inc

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hgurol’s picture

I have tested the patch with ssh connection and it works without problems.
thanks...

andypost’s picture

This demonstrates the test coverage for this case. Test should be extended or fixed too

Status: Needs review » Needs work

The last submitted patch, parents_ouch.patch, failed testing.

chx’s picture

Status: Needs work » Needs review

I will get the bot recheck this, completley invalid failure. There is no test , there cant be, how would that work, we add an FTP and an SSH server to core??

chx’s picture

parents_ouch.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, parents_ouch.patch, failed testing.

chx’s picture

Status: Needs work » Needs review

parents_ouch.patch queued for re-testing.

dww’s picture

I think all this #parents stuff is ugly and madness. The thing chx was trying to avoid was having the FileTransfer::factory() methods know about the nested structure of the $settings array. However, a) we already handle that in _authorize_filetransfer_connection_settings_set_defaults() and b) each class is responsible for its own settings form, so it should know the structure of the values of that form and be able to deal with it. You could hypothetically imagine a case where you'd have form element name collisions if we just try to flatten everything into a single array. If the settings form is nested, let the $settings array remain nested and make the same class that gave us that form know how to find the values it needs. IMHO, the attached is a lot cleaner than the original patch.

Either way, this patch is touching the same code as #1009162: Can't use SSH connection method at all so I marked that duplicate with this.

chx’s picture

Status: Needs review » Reviewed & tested by the community

Works for me. The argument / approach is saner than me trying to keep a flat array.

dww’s picture

Title: Filetransfer is broken beyond recognition » FileTransfer doesn't properly handle any advanced settings nor the ssh username

More precise and helpful title. ;)

webchick’s picture

Status: Reviewed & tested by the community » Needs review

chx's rtbc doesn't sound like "I tested this in the following ways and it works for me."

I need one of those.

aspilicious’s picture

I just applied this and tried to install something.

Result: Installed google_analytics successfully.

Regular xampp stack...

bfroehle’s picture

The code looks correct to me, but I don't have a system set up to actually test installations via ftp or ssh.

bfroehle’s picture

Status: Needs review » Reviewed & tested by the community

Just set up a system to test with FTP on a non-standard port. Was able to install a module from d.o successfully with no warnings. (SSH untested, but a manual review of the code shows that changes made were identical to that for FTP).

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Awesome, thanks a lot for the testing. I will also give this another spin on DreamHost tomorrow or Tuesday, which will test the SSH side of things.

Committed to HEAD.

hgurol’s picture

SSH is also working, tested with the patch at #8.

thanks...

Status: Fixed » Closed (fixed)

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