- π«π·France quimic Paris
I confirm the exact same problem. All interaction with FTP (including backups) generate that same error.
- π³π±Netherlands BrankoC
The PHP manual says about ftp_systype():
Changelog:
PHP 8.1.0. The ftp parameter expects an FTP\Connection instance now; previously, a resource was expected. - π³π±Netherlands BrankoC
I can confirm this error.
How to reproduce:
- Create an FTP destination.
- Go to admin/config/system/backup_migrate/backups.
What happens in includes/destinations.ftp.inc is that the function responsible for creating a connection first tests if a connection already exists.
It does this by calling drupal_ftp_connected() with an incomplete $ftp object.
When that happened in PHP 7, PHP's ftp_systype() function was perfectly happy to test a non-existent resource, but in PHP 8, the same function does not like it when it receives a non-existent FTP\Connection instance.
When I change line 200 (inside the drupal_ftp_connected() method) from
if (!@ftp_systype($ftp->__conn)) {
to
if (isset($ftp->__conn) && !ftp_systype($ftp->__conn)) {
(inserted: isset($ftp->__conn) &&), this particular problem goes away, but a host of new ones pop up.
Unfortunately I do not have the time right now to look at this further. It looks like the whole include needs to be looked at to get FTP working again.
- Status changed to Needs review
6 months ago 3:27pm 28 December 2023 - last update
6 months ago 26 pass - π³π±Netherlands BrankoC
Turns out I had some time after all. This patch implements the suggestion of #5 and a small fix for a trivial problem where an error message wasn't shown.
The "host of [problems]" I was talking about in #5 were caused by me not having a proper FTP server to connect to. Those error messages went away when I introduced a working FTP destination. I will address them in a separate issue.
- π©πͺGermany thor10
Re: #7
Hello BrankoC,
first of all, many thanks for your persistent commitment.
Unfortunately, I do not know where the file backup-migrate-3305432-07.patch has to be installed.
I am confident that I can do this with the right file via FTP, but I would be very happy if you could tell me which file* and how/where it has to be changed.
Best regards, thor10
* It could perhaps be with me: sites/all/modules/backup_migrate/includes/destinations.ftp.inc
Drupal 7.100
Backup and Migrate 7.x-3.10
PHP 8.1.15Translated with DeepL.com
- π³π±Netherlands BrankoC
A patch needs to be applied, not installed.
Patches are a way for developers to publish code changes for review. When applied they change the files of the module. Here is the official documentation on how to apply patches β and here is a Stackoverflow question on how to apply patches.
Patching is not for the faint of heart but with a little technical knowledge, courage and perseverance it is doable. :-)
If things go wrong, just replace the files from a fresh module download.
The code in the patch is work in progress, so it may not work or may have adverse effects. Ideally you test the patch on a copy of your site. Please report any things that go wrong (assuming you have successfully applied the patch) in this issue.
If the patch works for you, you may wish to apply it to your production environment. Any updates to the module will overwrite the patch. If those updates do not (yet) contain the changes from the patch, you may need to re-apply the patch.
- π©πͺGermany thor10
Thanks BrankoC for the information and the links!
I'll see if I can perhaps work it out and then report back here.
As a layman, I would of course be very happy if your tests and results were incorporated into an update of the module by the responsible developers.
- Status changed to RTBC
2 months ago 10:45am 14 April 2024 -
DamienMcKenna β
committed 64b652ee on 7.x-3.x
Issue #3305432 by BrankoC, quimic, thor10, DamienMcKenna: FTP error with...
-
DamienMcKenna β
committed 64b652ee on 7.x-3.x
- Status changed to Fixed
2 months ago 10:47am 14 April 2024 Automatically closed - issue fixed for 2 weeks with no activity.