mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-06-18 02:59:27 +00:00
catch exeption if 'created' is not set
This commit is contained in:
parent
0cd9910c25
commit
80f712e716
|
@ -123,14 +123,14 @@ class SeedDMS_SQLiteFTS_Indexer {
|
||||||
if(!$this->_conn)
|
if(!$this->_conn)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
foreach(array('comment', 'keywords', 'category', 'content', 'mimetype', 'origfilename', 'status') as $kk) {
|
foreach(array('comment', 'keywords', 'category', 'content', 'mimetype', 'origfilename', 'status', 'created') as $kk) {
|
||||||
try {
|
try {
|
||||||
${$kk} = $doc->getFieldValue($kk);
|
${$kk} = $doc->getFieldValue($kk);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
${$kk} = '';
|
${$kk} = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$sql = "INSERT INTO docs (documentid, title, comment, keywords, category, owner, content, mimetype, origfilename, created, users, status, path) VALUES (".$this->_conn->quote($doc->getFieldValue('document_id')).", ".$this->_conn->quote($doc->getFieldValue('title')).", ".$this->_conn->quote($comment).", ".$this->_conn->quote($keywords).", ".$this->_conn->quote($category).", ".$this->_conn->quote($doc->getFieldValue('owner')).", ".$this->_conn->quote($content).", ".$this->_conn->quote($mimetype).", ".$this->_conn->quote($origfilename).", ".(int)$doc->getFieldValue('created').", ".$this->_conn->quote($doc->getFieldValue('users')).", ".$this->_conn->quote($status).", ".$this->_conn->quote($doc->getFieldValue('path'))/*time()*/.")";
|
$sql = "INSERT INTO docs (documentid, title, comment, keywords, category, owner, content, mimetype, origfilename, created, users, status, path) VALUES (".$this->_conn->quote($doc->getFieldValue('document_id')).", ".$this->_conn->quote($doc->getFieldValue('title')).", ".$this->_conn->quote($comment).", ".$this->_conn->quote($keywords).", ".$this->_conn->quote($category).", ".$this->_conn->quote($doc->getFieldValue('owner')).", ".$this->_conn->quote($content).", ".$this->_conn->quote($mimetype).", ".$this->_conn->quote($origfilename).", ".(int)$created.", ".$this->_conn->quote($doc->getFieldValue('users')).", ".$this->_conn->quote($status).", ".$this->_conn->quote($doc->getFieldValue('path'))/*time()*/.")";
|
||||||
$res = $this->_conn->exec($sql);
|
$res = $this->_conn->exec($sql);
|
||||||
if($res === false) {
|
if($res === false) {
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user