diff --git a/administrator/components/com_tags/tables/tag.php b/administrator/components/com_tags/tables/tag.php index 966838b71856b..8d0a86cdf17ab 100644 --- a/administrator/components/com_tags/tables/tag.php +++ b/administrator/components/com_tags/tables/tag.php @@ -144,6 +144,52 @@ public function check() $bad_characters = array("\"", "<", ">"); $this->metadesc = JString::str_ireplace($bad_characters, "", $this->metadesc); } + // Not Null sanity check + $date = JFactory::getDate(); + if (empty($this->params)) + { + $this->params = '{}'; + } + if (empty($this->metadesc)) + { + $this->metadesc = ' '; + } + if (empty($this->metakey)) + { + $this->metakey = ' '; + } + if (empty($this->metadata)) + { + $this->metadata = '{}'; + } + if (empty($this->urls)) + { + $this->urls = '{}'; + } + if (empty($this->images)) + { + $this->images = '{}'; + } + if (!(int) $this->checked_out_time) + { + $this->checked_out_time = $date->toSql(); + } + if (!(int) $this->modified_time) + { + $this->modified_time = $date->toSql(); + } + if (!(int) $this->modified_time) + { + $this->modified_time = $date->toSql(); + } + if (!(int) $this->publish_up) + { + $this->publish_up = $date->toSql(); + } + if (!(int) $this->publish_down) + { + $this->publish_down = $date->toSql(); + } return true; } diff --git a/libraries/joomla/database/driver/postgresql.php b/libraries/joomla/database/driver/postgresql.php index 67bc47b6076d2..959d0878b6416 100644 --- a/libraries/joomla/database/driver/postgresql.php +++ b/libraries/joomla/database/driver/postgresql.php @@ -393,6 +393,14 @@ public function getTableColumns($table, $typeOnly = true) { foreach ($fields as $field) { + if (stristr(strtolower($field->type), "character varying")) + { + $field->Default = ""; + } + if (stristr(strtolower($field->type), "text")) + { + $field->Default = ""; + } // Do some dirty translation to MySQL output. // TODO: Come up with and implement a standard across databases. $result[$field->column_name] = (object) array( diff --git a/libraries/joomla/database/driver/sqlsrv.php b/libraries/joomla/database/driver/sqlsrv.php index 4a6664726b65d..f49ae89dc3a0e 100644 --- a/libraries/joomla/database/driver/sqlsrv.php +++ b/libraries/joomla/database/driver/sqlsrv.php @@ -362,6 +362,10 @@ public function getTableColumns($table, $typeOnly = true) { foreach ($fields as $field) { + if (stristr(strtolower($field->type), "nvarchar")) + { + $field->Default = ""; + } $result[$field->Field] = $field; } }