One thing that should be noted is that a crucial fatal flaw in adding media via the upload section.
It turns out that the section of code that tries to find a HASH value is incorrect.

  // find a unique hash for the media.
  do {
    $hash = md5($media->path . chr(rand()));
    $result = db_query("SELECT hash FROM {media} WHERE hash='%s'", $hash);
    $obj = db_fetch_object($result);
  } while ($obj);

should be:

  // find a unique hash for the media.
  $count = 1;
  $test = serialize($media);
  do {
    $hash = md5($test . $count++);
    $result = db_result(db_query("SELECT hash FROM {media} WHERE hash='%s'", $hash));
  } while ($result);

This should solve potential problems with not being able to upload media correctly, once a large enough set of media exist.
This is being updated in the versions I'll be uploading fairly soon.

Comments

rhys’s picture

Version: 5.x-5.x-dev » 5.x-0.x-dev
Status: Active » Fixed

Fixes already exist in the d6, head cvs versions, d5 will be backported from d6 soon.

Status: Fixed » Closed (fixed)

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