mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-19 07:53:14 +00:00
Fix substitute
This commit is contained in:
@@ -1063,6 +1063,9 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
$appbox = \appbox::get_instance();
|
||||||
|
$session = $appbox->get_session();
|
||||||
|
|
||||||
$connbas = connection::getPDOConnection($this->get_sbas_id());
|
$connbas = connection::getPDOConnection($this->get_sbas_id());
|
||||||
|
|
||||||
$sql = 'DELETE FROM subdef WHERE record_id= :record_id AND name=:name';
|
$sql = 'DELETE FROM subdef WHERE record_id= :record_id AND name=:name';
|
||||||
@@ -1083,7 +1086,6 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
|||||||
(:record_id, :name, :baseurl, :filename,
|
(:record_id, :name, :baseurl, :filename,
|
||||||
:width, :height, :mime, :path, :filesize, "1")';
|
:width, :height, :mime, :path, :filesize, "1")';
|
||||||
|
|
||||||
echo "substitute subdef $name with $base_url ".$system_file->getPath()." ".$system_file->getFilename()."<br>";
|
|
||||||
$stmt = $connbas->prepare($sql);
|
$stmt = $connbas->prepare($sql);
|
||||||
|
|
||||||
$stmt->execute(array(
|
$stmt->execute(array(
|
||||||
@@ -1101,11 +1103,10 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
|||||||
$sql = 'UPDATE record SET moddate=NOW() WHERE record_id=:record_id';
|
$sql = 'UPDATE record SET moddate=NOW() WHERE record_id=:record_id';
|
||||||
$stmt = $connbas->prepare($sql);
|
$stmt = $connbas->prepare($sql);
|
||||||
$stmt->execute(array(':record_id' => $this->get_record_id()));
|
$stmt->execute(array(':record_id' => $this->get_record_id()));
|
||||||
$stmt->execute();
|
$stmt->closeCursor();
|
||||||
|
|
||||||
$this->delete_data_from_cache(self::CACHE_SUBDEFS);
|
$this->delete_data_from_cache(self::CACHE_SUBDEFS);
|
||||||
|
|
||||||
|
|
||||||
if ($meta_writable)
|
if ($meta_writable)
|
||||||
{
|
{
|
||||||
$this->write_metas();
|
$this->write_metas();
|
||||||
@@ -1117,15 +1118,14 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
|||||||
|
|
||||||
$type = $name == 'document' ? 'HD' : $name;
|
$type = $name == 'document' ? 'HD' : $name;
|
||||||
|
|
||||||
$session->get_logger($record->get_databox())
|
$session->get_logger($this->get_databox())
|
||||||
->log($record, Session_Logger::EVENT_SUBSTITUTE, $type, '');
|
->log($this, Session_Logger::EVENT_SUBSTITUTE, $type, '');
|
||||||
}
|
}
|
||||||
catch (Exception $e)
|
catch (Exception $e)
|
||||||
{
|
{
|
||||||
unset($e);
|
unset($e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user