Neither includes/file.inc nor modules/system/system.install define a $file->filepath property.

includes/file.inc
 * Fields on the file object:
 * - fid: File ID
 * - uid: The {users}.uid of the user who is associated with the file.
 * - filename: Name of the file with no path components. This may differ from
 *   the basename of the filepath if the file is renamed to avoid overwriting
 *   an existing file.
 * - uri: URI of the file.
 * - filemime: The file's MIME type.
 * - filesize: The size of the file in bytes.
 * - status: A bitmapped field indicating the status of the file. The first 8
 *   bits are reserved for Drupal core. The least significant bit indicates
 *   temporary (0) or permanent (1). Temporary files older than
 *   DRUPAL_MAXIMUM_TEMP_FILE_AGE will be removed during cron runs.
 * - timestamp: UNIX timestamp for the date the file was added to the database.
modules/system/system.install
  $schema['file_managed'] = array(
    'description' => 'Stores information for uploaded files.',
    'fields' => array(
      'fid' => array(

...

      'uid' => array(

...

      'filename' => array(

...

      'uri' => array(

...

      'filemime' => array(

...

      'filesize' => array(

...

      'status' => array(

...

      'timestamp' => array(
#517814 by jmstacey, justinrandell, pwolanin, drewish, Jody Lynn, aaron, dopry, and c960657: Converted File API to stream wrappers, for enhanced private/public file handling, and the ability to reference other storage mechanisms such as s3:// and flicker://.

@@ -696,7 +702,7 @@ function system_schema() {
         'not null' => TRUE,
         'default' => '',
       ),
-      'filepath' => array(
+      'uri' => array(
         'description' => 'Path of the file relative to Drupal root.',
         'type' => 'varchar',
         'length' => 255,

It appears that the 'filepath' property in the D6 files table was renamed to 'uri' for D7, but the mimedetect module was never updated to reflect that change. It doesn't help that the change is not mentioned anywhere in Converting 6.x modules to 7.x.

Comments

pillarsdotnet’s picture

Status: Active » Needs review
StatusFileSize
new1.4 KB

Patch.

drewish’s picture

Status: Needs review » Fixed

Thanks, committed to master.

Status: Fixed » Closed (fixed)

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