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).

Files: 
CommentFileSizeAuthor
#1 1206916-by-bfroehle-Fixed-Notice-Use-of-undefined-co.patch1.01 KBbfroehle
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 1206916-by-bfroehle-Fixed-Notice-Use-of-undefined-co.patch. This may be a -p0 (old style) patch, which is no longer supported by the testbots.
[ View ]

Comments

Component:file.module» file system
Status:Active» Needs review
Issue tags:+Novice
StatusFileSize
new1.01 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 1206916-by-bfroehle-Fixed-Notice-Use-of-undefined-co.patch. This may be a -p0 (old style) patch, which is no longer supported by the testbots.
[ View ]

Attached 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.

Version:7.x-dev» 8.x-dev

Applied and tested. Looks good. Needs one more review.

Status:Needs review» Reviewed & tested by the community

Not much to see in here. Plain and simple.

Status:Reviewed & tested by the community» Needs work
Issue tags:+Needs tests, +needs backport to D7

Well that's a stupid bug.

But moreover, we have no tests for file_unmanaged_copy()?? Why is this not being caught?

Status:Needs work» Reviewed & tested by the community
Issue tags:-Needs tests, -Novice

How 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:

  1. Copy to a non-existing directory. (Actually the directory will be created)
  2. Copy to a directory which we don't have write privileges.
  3. Copy destination is a read-only file which already exists.

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).

Status:Reviewed & tested by the community» Fixed

Ok, fair enough. :)

Committed and pushed to 8.x. Apparently 7.x already had this fix applied.

I just got this in 7.7...

stevepurkiss: 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.

bfroehle: ah ok thanks!

I 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.

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.

The correct error message is "The specified file %file could not be copied to %destination." (with file and destination replaced appropriately).

Status:Fixed» Needs review
Issue tags:-needs backport to D7

not working

Status:Fixed» Needs work

The last submitted patch, 1206916-by-bfroehle-Fixed-Notice-Use-of-undefined-co.patch, failed testing.

Status:Needs work» Fixed

Status:Needs review» Closed (fixed)
Issue tags:+needs backport to D7

Version:8.x-dev» 7.x-dev
Status:Closed (fixed)» Active

So if this is fixed can it be backported to 7?

Status:Active» Closed (fixed)

Please read comment #11

Version:7.x-dev» 8.x-dev

Version:8.x-dev» 7.7

#11 fixed my issue while upgrading from D 6.22 to D 7.7.
Thanks.

Version:7.7» 8.x-dev

This issue was about fixing for 8.x

I 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:

  Notice: Use of undefined constant WATCHDOG_ERR - assumed 'WATCHDOG_ERR' w file_unmanaged_copy() (linia 909 z /var/customers/pawi.pl/includes/file.inc).
    PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'WATCHDOG_ERR' for column 'severity' at row 1: INSERT INTO {watchdog} (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9); Array ( [:db_insert_placeholder_0] => 1 [:db_insert_placeholder_1] => file [:db_insert_placeholder_2] => The specified file %file could not be copied to %destination. [:db_insert_placeholder_3] => a:2:{s:5:"%file";s:22:"temporary://filelnhPek";s:12:"%destination";s:68:"public://languages/pl_XrWf5aj9dzKeVWHAAvikUPjIqcDzl2cPaK1pik9M3mk.js";} [:db_insert_placeholder_4] => WATCHDOG_ERR [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => http://pawi.pl/update.php?op=info [:db_insert_placeholder_7] => [:db_insert_placeholder_8] => 95.49.211.161 [:db_insert_placeholder_9] => 1313665004 ) w dblog_watchdog() (linia 157 z /var/customers/pawi.pl/modules/dblog/dblog.module).

Sorry i didn't see

http://drupal.org/node/1206916#comment-4802328 fixed it :)

I wanted to post a Thank You also. This fix allowed my upgrade from Drupal 6.22 to Drupal 7.7 to continue.

I got error in d7.7

nikkubhai: read #11, and look for it next time.