Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
system.module
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
20 Feb 2018 at 10:15 UTC
Updated:
24 Oct 2018 at 14:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
aprogs commentedComment #3
torgormack commentedI have just come across this issue on a recently update website of mine.
How do I fix it? - do I need to wait for a core update?
Comment #4
David_Rothstein commentedIs this reproducible in Drupal 8 also? It looks like the same code: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Archiver%...
It may be very simple to patch (see https://github.com/pear/Archive_Tar/pull/18), and then upgrading to a newer version of Archive_Tar could be discussed in a separate followup issue.
Comment #5
soyjaz commentedHad this problem while trying to backup and migrate using the eponymous module.
Modified the system.tar.inc file accordingly to the new version 1.4.3.
This solved the issue for me, as I hope it does for you.
Comment #6
göran commentedalso get error when try to update Modules:
This error is fully related to PHP 7.2 -
I will not patch my core! I will use php 7.1 instead, waiting for a ordinary fix. (Also Rules need to be updated for php 7.2 and probably more modules ?)
It would be grate if this could be fixed in next Core 7.59 version
We probably need a list on all modules who needs to be updated to be compatible with PHP 7.2. That's why I will use php 7.1 until right time comes.
Comment #7
nicorac commentedHere's the very simple patch to fix this deprecation, based on upstream commit
Comment #8
nicorac commentedFixed patch line endings
Comment #9
sjerdo@David_Rothstein (comment #4)
I have tried to reproduce this issue in Drupal 8 (using PHP 7.2). This fatal error does not occur in Drupal 8.
Somehow the fatal error only occurs when the result of a built-in function is referenced when not in a namespace.
Did some tests:
no namespace, Fatal error occurs in PHP 7.2: (test result at https://3v4l.org/XopHJ)
code in namespace, No fatal error occurs in PHP 7.2: (testresult at https://3v4l.org/W16mN)
So I suppose this could be fixed by wrapping the code in a namespace or update the Archive_Tar class to the newest version (1.4.3). Since we do not use namespaces in Drupal 7, we should do the latter.
Just manually tested the updated class and the fatal error no longer occurs in PHP 7.2
Comment #10
sjerdoAdded patch which contains updates of PEAR.php (1.9.5 -> 1.10.5) and Archive Tar class (1.4.0 -> 1.4.3).
Comment #11
joseph.olstadaside from minor code style, this is RTBC
we've combined this latest patch above with the two other patches for php 7.2
all passing, 100% pass for php 7.2 on D7 core, WOOT
#2947772: Fully support PHP 7.2 in Drupal 7
Comment #12
fabianx commentedLooks good to me and I think it is okay to upgrade the version directly as the code is simple enough: This is pending commit.
Comment #13
srikanth.g commentedtar module installation gives the error "Fatal error: Cannot use result of built-in function in write context in \modules\system\system.tar.inc on line 717 drupal"
but zip format modules install fine in my drupal 7.59
Comment #14
fabianx commentedCommitted and pushed to 7.x. Thanks all!
Comment #17
dimante commentedThanks! This was really helpful and allowed the system to work properly.
Comment #18
Anonymous (not verified) commentedI still was getting this error (php7.2) in 7.60. Changes from #8 fixed the issue.
Comment #19
myDrupal2014_846824658246 commentedI'm running on drupal 7.6 and getting this error as well when upgrading to php 7.2
The patch on #8 fixed the issue
Comment #20
joseph.olstadshort term you can upgrade to 7.x dev release , no need for patching on 7.x dev.