Commit 14370dfd authored by kroky6's avatar kroky6

[bp/r65985] [ENH] trigger error when indexing possibly incorrect tracker datetime field values

parent 043c17b3
......@@ -169,6 +169,9 @@ class Tracker_Field_DateTime extends Tracker_Field_Abstract implements Tracker_F
function getDocumentPart(Search_Type_Factory_Interface $typeFactory)
if ($this->getValue() && (strlen($this->getValue()) > 10 || intval($this->getValue()) <= 0)) {
trigger_error("Possibly incorrect timestamp value found when trying to send to search index. Tracker item ".$this->getItemId().", field ".$this->getConfiguration('permName').", value ".$this->getValue(), E_USER_WARNING);
$baseKey = $this->getBaseKey();
return [
$baseKey => $typeFactory->timestamp($this->getValue(), $this->getOption('datetime') == 'd'),
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment