use getByID (also bad variable reference)
This commit is contained in:
parent
107f612384
commit
c48508d590
|
@ -173,12 +173,11 @@ class File_redirection extends Managed_DataObject
|
||||||
try {
|
try {
|
||||||
$r = File_redirection::getByUrl($in_url);
|
$r = File_redirection::getByUrl($in_url);
|
||||||
|
|
||||||
$f = File::getKV('id',$r->file_id);
|
try {
|
||||||
|
$f = File::getByID($r->file_id);
|
||||||
if($file instanceof File) {
|
|
||||||
$r->file = $f;
|
$r->file = $f;
|
||||||
$r->redir_url = $f->url;
|
$r->redir_url = $f->url;
|
||||||
} else {
|
} catch (NoResultException $e) {
|
||||||
// Invalid entry, delete and run again
|
// Invalid entry, delete and run again
|
||||||
common_log(LOG_ERR, "Could not find File with id=".$r->file_id." referenced in File_redirection, deleting File redirection entry and and trying again...");
|
common_log(LOG_ERR, "Could not find File with id=".$r->file_id." referenced in File_redirection, deleting File redirection entry and and trying again...");
|
||||||
$r->delete();
|
$r->delete();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user