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.
As reported in #1205948: Installing new modules fails after update from 7.2 -> 7.4:
Notice: Use of undefined constant WATCHDOG_ERR - assumed 'WATCHDOG_ERR' in file_unmanaged_copy() (line 909 of /var/www/vhosts/schoolenberg.info/httpdocs/includes/file.inc).
Comment | File | Size | Author |
---|---|---|---|
#1 | 1206916-by-bfroehle-Fixed-Notice-Use-of-undefined-co.patch | 1.01 KB | bfroehle |
Comments
Comment #1
bfroehle CreditAttribution: bfroehle commentedAttached patch renames WATCHDOG_ERR to the (correct) WATCHDOG_ERROR.
This bug is not relevant to D8, since WATCHDOG_* was renamed to use the builtin PHP constants.
Comment #2
bfroehle CreditAttribution: bfroehle commentedSince #1136130: Regression: Reinstate WATCHDOG_* constants and document why they are necessary. was committed, this now DOES apply to D8.
Comment #3
bfroehle CreditAttribution: bfroehle commented#1: 1206916-by-bfroehle-Fixed-Notice-Use-of-undefined-co.patch queued for re-testing.
Comment #4
James_Stallings CreditAttribution: James_Stallings commentedApplied and tested. Looks good. Needs one more review.
Comment #5
franzNot much to see in here. Plain and simple.
Comment #6
teot CreditAttribution: teot commented#1: 1206916-by-bfroehle-Fixed-Notice-Use-of-undefined-co.patch queued for re-testing.
Comment #7
webchickWell that's a stupid bug.
But moreover, we have no tests for file_unmanaged_copy()?? Why is this not being caught?
Comment #8
bfroehle CreditAttribution: bfroehle commentedHow are you supposed to write a test for a failing copy() command, without tripping any of the previous checks in file_unmanaged_copy()? These ideas will not work since they'll be caught by another check:
I think we should just fix this and move on. The only way I've seen this caused in the wild is in odd PHP configurations with safe mode enabled (which is not an option for the test bot).
Comment #9
webchickOk, fair enough. :)
Committed and pushed to 8.x. Apparently 7.x already had this fix applied.
Comment #10
Anonymous (not verified) CreditAttribution: Anonymous commentedI just got this in 7.7...
Comment #11
bfroehle CreditAttribution: bfroehle commentedstevepurkiss: This was fixed in 3ed6929 in Drupal 7, which came after the release of 7.7. It's fixed in the dev release and in the next stable release.
Comment #12
Anonymous (not verified) CreditAttribution: Anonymous commentedbfroehle: ah ok thanks!
Comment #13
Jens Peter CreditAttribution: Jens Peter commentedI just got this error in 7.7 too. Fresh download of Drupal install and running the update with no errors.
When I move to front page after update it gave this error.
Use the link in #11 and corrected the file.inc like I would do as a patch.
All seem to work now.
Just wanted to write in case someone other than me was looking and couldn't find a solution.
Comment #14
bfroehle CreditAttribution: bfroehle commentedThe correct error message is "The specified file %file could not be copied to %destination." (with file and destination replaced appropriately).
Comment #15
Ionut Adrian Luchian CreditAttribution: Ionut Adrian Luchian commentednot working
Comment #17
Eric_A CreditAttribution: Eric_A commentedComment #18
bfroehle CreditAttribution: bfroehle commentedComment #19
Josh Waihi CreditAttribution: Josh Waihi commentedSo if this is fixed can it be backported to 7?
Comment #20
franzPlease read comment #11
Comment #21
Eric_A CreditAttribution: Eric_A commentedComment #22
deajan CreditAttribution: deajan commented#11 fixed my issue while upgrading from D 6.22 to D 7.7.
Thanks.
Comment #23
franzThis issue was about fixing for 8.x
Comment #24
pawi81 CreditAttribution: pawi81 commentedI have same issue
I was trying to upgrade from 7.4 to 7.7, there was no errors imho
and after i refreshed page i have:
Sorry i didn't see
http://drupal.org/node/1206916#comment-4802328 fixed it :)
Comment #25
rickumali CreditAttribution: rickumali commentedI wanted to post a Thank You also. This fix allowed my upgrade from Drupal 6.22 to Drupal 7.7 to continue.
Comment #26
nikkubhai CreditAttribution: nikkubhai commentedI got error in d7.7
Comment #27
franznikkubhai: read #11, and look for it next time.