With php7.0, there is this message:
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP for backup_file class.

The simple solution is to rename backup_file() method to __construct()

Comments

SylvainM created an issue. See original summary.

sylvainm’s picture

sylvainm’s picture

Status: Active » Needs review
rocketeerbkw’s picture

Version: 7.x-3.1 » 7.x-3.x-dev
Status: Needs review » Reviewed & tested by the community

Patch applies cleanly to 7.x-3.x-dev. This is PHP4 code!

joelstein’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new883 bytes

Here's an updated patch which catches another constructor.

rocketeerbkw’s picture

Status: Needs review » Reviewed & tested by the community
sylvainm’s picture

Issue summary: View changes
Issue tags: +PHP 7.0 (duplicate)

Thx for catching another one.

ckng’s picture

Tested #5 working as expected.

frank hh-germany’s picture

#5
Thanks for the Patch.
Works fine...

anybody’s picture

I can confirm RTBC. This should be a hot candidate for a new stable release. PHP7 is quite common. :)

heddn’s picture

+1 on RTBC

heddn’s picture

BTW, I ran this through php7cc and the only places where this deprecated format is used are fixed in the patch above.

bogdog400’s picture

This is a good excuse for a new stable release. It will make updating easier for everyone. 7.0 is a pretty nice version of PHP and we want to encourage it.

anybody’s picture

+1 for #13 :)

nerdoc’s picture

#13++ ;-)
Using auto backups under cron/PHP7 causes cron to vomit this deprecation warning message into my mailbox 12x each day :-( So it's not just on the screen - please merge the fix into stable!

nagy.balint’s picture

+1 RTBC

anybody’s picture

+1 for a new release. PHP7 is important :)

bogdog400’s picture

Thanks to the committers for getting these fixes in to version 7.10.

--- Oh wait. They rolled the fixes in CTools. My mistake. But please fix them here too. Thanks.

culfin’s picture

+1 on RTBC ... is there anything you're waiting for?

nagy.balint’s picture

I start to think that the 7.x branch is not maintained anymore :(

garphy’s picture

Well... maybe this issue it's a hidden request for co-maintainership ? :)

kevin morse’s picture

Just moved a bunch of my sites over to PHP7 and confirmed the patch in #5 fixes both the warnings I am seeing.

Would be great to see this released.

alan d.’s picture

Nice to have this in dev irrespective if there are going to be no more D7 releases

Saves having to track mods / patches :)

jaypan’s picture

I confirm #5 fixes the issue.

3dnathaniel’s picture

confirm #5 fixes issue for me as well

anybody’s picture

There seems to be no active maintainer?
I tried to contact, but no reply yet.

xtaz’s picture

#5 works for me too.
Thanks.

+1 for a new release

wylbur’s picture

The patch in #5 also worked for me when applied to the latest dev version of the module.

anybody’s picture

Still no reply from the maintainer... how shell we proceed?

nagy.balint’s picture

I guess we will have no choice than to use https://www.drupal.org/node/251466

  • ronan committed bcb594f on 7.x-3.x authored by joelstein
    Issue #2623598 by SylvainM, joelstein: Deprecated: Methods with the same...
ronan’s picture

Status: Reviewed & tested by the community » Fixed

Patch applied. Thanks

nagy.balint’s picture

Thank you!

xtaz’s picture

Thanks

anybody’s picture

Thank you very much! That's great!
Would you be so nice to create a new D7 stable release containing this patch?

wizonesolutions’s picture

howdytom’s picture

Yeah. Patch #5 works for me, too

Thank you joelstein!

Status: Fixed » Closed (fixed)

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

shahidbscs’s picture

yeah #5 worked

alh’s picture

+1 for a new release. Just upgraded to php 7 and warnings popping up on all sites. Am applying the patch now.

3cwebdev’s picture

Patch in #5 works. Have applied to many sites that I've upgraded to PHP7.0x - hopefully this patch gets applied to the module.

Anonymous’s picture

Confirmed that patch in #5 works like a dream. I had the same issue on all servers using PHP 7.
Thanks a million, joelstein!

nancydru’s picture

I am using the latest Dev version (backup_migrate 7.x-3.1+11-dev 2016/12/31) and this patch does not seem to be there.

wOOge’s picture

Patch from #5 works for me as well.

selinav’s picture

#5 works for me, thanks.

gchalker@princeton.edu’s picture

Can someone help me with file.inc? I am still getting this syntax error after the patch:

ParseError: syntax error, unexpected 'if' (T_IF), expecting ';' or '{' in backup_migrate_include() (line 133 of /public_html/sites/all/modules/backup_migrate/includes/files.inc)

Here is the patch:

/**
* Construct a file object given a file path, or create a temp file for writing.
*/
function __construct($params = array())
if (isset($params['filepath'])) && file_exists($params['filepath'])) {
$this->set_filepath($params['filepath']);
}
else {
$this->set_file_info($params);
$this->temporary_file();
}
}

jaypan’s picture

This:

 function __construct($params = array())

Should be this:

 function __construct($params = array()) {
damienmckenna’s picture

Please just update to 7.x-3.6 and open a new issue if you're still running into problems. Thank you.

gchalker@princeton.edu’s picture

Thanks @DamienMcKenna. Updating to Backup and Migrate 7.x-3.6 alleviated all my issues. Good advice. Thank you.

damienmckenna’s picture

@geogeektress: that's awesome, thanks for letting me know.

vincent wasswa’s picture

thanks, #5 worked.