Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#8 | 1010506-8.filetransfer-factory-settings.patch | 4.34 KB | dww |
parents_ouch.patch | 4.81 KB | chx | |
Comments
Comment #1
hgurol CreditAttribution: hgurol commentedI have tested the patch with ssh connection and it works without problems.
thanks...
Comment #2
andypostThis demonstrates the test coverage for this case. Test should be extended or fixed too
Comment #4
chx CreditAttribution: chx commentedI 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??
Comment #5
chx CreditAttribution: chx commentedparents_ouch.patch queued for re-testing.
Comment #7
chx CreditAttribution: chx commentedparents_ouch.patch queued for re-testing.
Comment #8
dwwI 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.
Comment #9
chx CreditAttribution: chx commentedWorks for me. The argument / approach is saner than me trying to keep a flat array.
Comment #10
dwwMore precise and helpful title. ;)
Comment #11
webchickchx's rtbc doesn't sound like "I tested this in the following ways and it works for me."
I need one of those.
Comment #12
aspilicious CreditAttribution: aspilicious commentedI just applied this and tried to install something.
Result: Installed google_analytics successfully.
Regular xampp stack...
Comment #13
bfroehle CreditAttribution: bfroehle commentedThe code looks correct to me, but I don't have a system set up to actually test installations via ftp or ssh.
Comment #14
bfroehle CreditAttribution: bfroehle commentedJust 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).
Comment #15
webchickAwesome, 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.
Comment #16
hgurol CreditAttribution: hgurol commentedSSH is also working, tested with the patch at #8.
thanks...