diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-08-01.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-08-01.sql new file mode 100644 index 0000000000000..72a50731c9444 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-08-01.sql @@ -0,0 +1,8 @@ +ALTER TABLE `#__ucm_content` MODIFY `core_created_time` datetime NOT NULL; +ALTER TABLE `#__ucm_content` MODIFY `core_modified_time` datetime NOT NULL; + +ALTER TABLE `#__ucm_content` MODIFY `core_publish_up` datetime NULL DEFAULT NULL; +ALTER TABLE `#__ucm_content` MODIFY `core_publish_down` datetime NULL DEFAULT NULL; +ALTER TABLE `#__ucm_content` MODIFY `core_checked_out_time` datetime NULL DEFAULT NULL; + +ALTER TABLE `#__ucm_history` MODIFY `save_date` datetime NOT NULL; diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-08-29.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-08-29.sql index 3786f39217d21..210f1dc1d55eb 100644 --- a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-08-29.sql +++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-08-29.sql @@ -3,7 +3,6 @@ ALTER TABLE `#__modules` MODIFY `publish_down` datetime NULL DEFAULT NULL; ALTER TABLE `#__modules` MODIFY `checked_out_time` datetime NULL DEFAULT NULL; -- Use 0 instead of '0000-00-00 00:00:00' if you get 'Invalid default value for ...' -UPDATE `#__modules` SET - `publish_up` = CASE WHEN `publish_up` IN ('0000-00-00 00:00:00', '1000-01-01 00:00:00') THEN NULL ELSE `publish_up` END, - `publish_down` = CASE WHEN `publish_down` IN ('0000-00-00 00:00:00', '1000-01-01 00:00:00') THEN NULL ELSE `publish_down` END, - `checked_out_time` = CASE WHEN `checked_out_time` IN ('0000-00-00 00:00:00', '1000-01-01 00:00:00') THEN NULL ELSE `checked_out_time` END; +UPDATE `#__modules` SET `publish_up` = NULL WHERE `publish_up` = '0000-00-00 00:00:00'; +UPDATE `#__modules` SET `publish_down` = NULL WHERE `publish_down` = '0000-00-00 00:00:00'; +UPDATE `#__modules` SET `checked_out_time` = NULL WHERE `checked_out_time` = '0000-00-00 00:00:00'; diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-04-22.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-04-22.sql index 9459c3d8abaaa..ec3bc4dd67fd4 100644 --- a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-04-22.sql +++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-04-22.sql @@ -2,7 +2,6 @@ ALTER TABLE `#__contact_details` MODIFY `publish_up` datetime NULL DEFAULT NULL; ALTER TABLE `#__contact_details` MODIFY `publish_down` datetime NULL DEFAULT NULL; ALTER TABLE `#__contact_details` MODIFY `checked_out_time` datetime NULL DEFAULT NULL; -UPDATE `#__contact_details` SET - `publish_up` = CASE WHEN `publish_up` IN ('0000-00-00 00:00:00', '1000-01-01 00:00:00') THEN NULL ELSE `publish_up` END, - `publish_down` = CASE WHEN `publish_down` IN ('0000-00-00 00:00:00', '1000-01-01 00:00:00') THEN NULL ELSE `publish_down` END, - `checked_out_time` = CASE WHEN `checked_out_time` IN ('0000-00-00 00:00:00', '1000-01-01 00:00:00') THEN NULL ELSE `checked_out_time` END; +UPDATE `#__contact_details` SET `publish_up` = NULL WHERE `publish_up` = '0000-00-00 00:00:00'; +UPDATE `#__contact_details` SET `publish_down` = NULL WHERE `publish_down` = '0000-00-00 00:00:00'; +UPDATE `#__contact_details` SET `checked_out_time` = NULL WHERE `checked_out_time` = '0000-00-00 00:00:00'; diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-06-28.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-06-28.sql index d100360692c15..16585d1e3c0c6 100644 --- a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-06-28.sql +++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-06-28.sql @@ -2,7 +2,6 @@ ALTER TABLE `#__banners` MODIFY `publish_up` datetime NULL DEFAULT NULL; ALTER TABLE `#__banners` MODIFY `publish_down` datetime NULL DEFAULT NULL; ALTER TABLE `#__banners` MODIFY `checked_out_time` datetime NULL DEFAULT NULL; - UPDATE `#__banners` SET - `publish_up` = CASE WHEN `publish_up` IN ('0000-00-00 00:00:00', '1000-01-01 00:00:00') THEN NULL ELSE `publish_up` END, - `publish_down` = CASE WHEN `publish_down` IN ('0000-00-00 00:00:00', '1000-01-01 00:00:00') THEN NULL ELSE `publish_down` END, - `checked_out_time` = CASE WHEN `checked_out_time` IN ('0000-00-00 00:00:00', '1000-01-01 00:00:00') THEN NULL ELSE `checked_out_time` END; \ No newline at end of file +UPDATE `#__banners` SET `publish_up` = NULL WHERE `publish_up` = '0000-00-00 00:00:00'; +UPDATE `#__banners` SET `publish_down` = NULL WHERE `publish_down` = '0000-00-00 00:00:00'; +UPDATE `#__banners` SET `checked_out_time` = NULL WHERE `checked_out_time` = '0000-00-00 00:00:00'; diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-06-29.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-06-29.sql index 02424cf0e2376..36a43fcb382c1 100644 --- a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-06-29.sql +++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-06-29.sql @@ -2,7 +2,6 @@ ALTER TABLE `#__newsfeeds` MODIFY `publish_up` datetime NULL DEFAULT NULL; ALTER TABLE `#__newsfeeds` MODIFY `publish_down` datetime NULL DEFAULT NULL; ALTER TABLE `#__newsfeeds` MODIFY `checked_out_time` datetime NULL DEFAULT NULL; -UPDATE `#__newsfeeds` SET - `publish_up` = CASE WHEN `publish_up` IN ('0000-00-00 00:00:00', '1000-01-01 00:00:00') THEN NULL ELSE `publish_up` END, - `publish_down` = CASE WHEN `publish_down` IN ('0000-00-00 00:00:00', '1000-01-01 00:00:00') THEN NULL ELSE `publish_down` END, - `checked_out_time` = CASE WHEN `checked_out_time` IN ('0000-00-00 00:00:00', '1000-01-01 00:00:00') THEN NULL ELSE `checked_out_time` END; \ No newline at end of file +UPDATE `#__newsfeeds` SET `publish_up` = NULL WHERE `publish_up` = '0000-00-00 00:00:00'; +UPDATE `#__newsfeeds` SET `publish_down` = NULL WHERE `publish_down` = '0000-00-00 00:00:00'; +UPDATE `#__newsfeeds` SET `checked_out_time` = NULL WHERE `checked_out_time` = '0000-00-00 00:00:00'; diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-09-14.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-09-14.sql new file mode 100644 index 0000000000000..655d9ac166366 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-09-14.sql @@ -0,0 +1,26 @@ +ALTER TABLE `#__content` MODIFY `created` datetime NOT NULL; +ALTER TABLE `#__content` MODIFY `modified` datetime NOT NULL; + +ALTER TABLE `#__content` MODIFY `publish_up` datetime NULL DEFAULT NULL; +ALTER TABLE `#__content` MODIFY `publish_down` datetime NULL DEFAULT NULL; +ALTER TABLE `#__content` MODIFY `checked_out_time` datetime NULL DEFAULT NULL; + +UPDATE `#__content` SET `modified` = `created` WHERE `modified` = '0000-00-00 00:00:00'; + +UPDATE `#__content` SET `publish_up` = NULL WHERE `publish_up` = '0000-00-00 00:00:00'; +UPDATE `#__content` SET `publish_down` = NULL WHERE `publish_down` = '0000-00-00 00:00:00'; +UPDATE `#__content` SET `checked_out_time` = NULL WHERE `checked_out_time` = '0000-00-00 00:00:00'; + +UPDATE `#__ucm_content` SET `core_modified_time` = `core_created_time` + WHERE `core_type_alias` = 'com_content.article' + AND `core_modified_time` = '0000-00-00 00:00:00'; + +UPDATE `#__ucm_content` SET `core_publish_up` = NULL + WHERE `core_type_alias` = 'com_content.article' + AND `core_publish_up` = '0000-00-00 00:00:00'; +UPDATE `#__ucm_content` SET `core_publish_down` = NULL + WHERE `core_type_alias` = 'com_content.article' + AND `core_publish_down` = '0000-00-00 00:00:00'; +UPDATE `#__ucm_content` SET `core_checked_out_time` = NULL + WHERE `core_type_alias` = 'com_content.article' + AND `core_checked_out_time` = '0000-00-00 00:00:00'; diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-08-01.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-08-01.sql new file mode 100644 index 0000000000000..e0958379aa79f --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-08-01.sql @@ -0,0 +1,14 @@ +ALTER TABLE "#__ucm_content" ALTER COLUMN "core_created_time" DROP DEFAULT; + +ALTER TABLE "#__ucm_content" ALTER COLUMN "core_modified_time" DROP DEFAULT; + +ALTER TABLE "#__ucm_content" ALTER COLUMN "core_publish_up" DROP NOT NULL; +ALTER TABLE "#__ucm_content" ALTER COLUMN "core_publish_up" DROP DEFAULT; + +ALTER TABLE "#__ucm_content" ALTER COLUMN "core_publish_down" DROP NOT NULL; +ALTER TABLE "#__ucm_content" ALTER COLUMN "core_publish_down" DROP DEFAULT; + +ALTER TABLE "#__ucm_content" ALTER COLUMN "core_checked_out_time" DROP NOT NULL; +ALTER TABLE "#__ucm_content" ALTER COLUMN "core_checked_out_time" DROP DEFAULT; + +ALTER TABLE "#__ucm_history" ALTER COLUMN "save_date" DROP DEFAULT; diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-08-29.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-08-29.sql index 723794f171d25..80c8a1b3f7349 100644 --- a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-08-29.sql +++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-08-29.sql @@ -7,7 +7,6 @@ ALTER TABLE "#__modules" ALTER COLUMN "publish_down" DROP DEFAULT; ALTER TABLE "#__modules" ALTER COLUMN "checked_out_time" DROP NOT NULL; ALTER TABLE "#__modules" ALTER COLUMN "checked_out_time" DROP DEFAULT; -UPDATE "#__modules" SET - "publish_up" = CASE WHEN "publish_up" = '1970-01-01 00:00:00' THEN NULL ELSE "publish_up" END, - "publish_down" = CASE WHEN "publish_down" = '1970-01-01 00:00:00' THEN NULL ELSE "publish_down" END, - "checked_out_time" = CASE WHEN "checked_out_time" = '1970-01-01 00:00:00' THEN NULL ELSE "checked_out_time" END; +UPDATE "#__modules" SET "publish_up" = NULL WHERE "publish_up" = '1970-01-01 00:00:00'; +UPDATE "#__modules" SET "publish_down" = NULL WHERE "publish_down" = '1970-01-01 00:00:00'; +UPDATE "#__modules" SET "checked_out_time" = NULL WHERE "checked_out_time" = '1970-01-01 00:00:00'; diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-04-22.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-04-22.sql index 32d91acc14636..d7917bdb2635d 100644 --- a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-04-22.sql +++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-04-22.sql @@ -7,7 +7,6 @@ ALTER TABLE "#__contact_details" ALTER COLUMN "publish_down" DROP DEFAULT; ALTER TABLE "#__contact_details" ALTER COLUMN "checked_out_time" DROP NOT NULL; ALTER TABLE "#__contact_details" ALTER COLUMN "checked_out_time" DROP DEFAULT; -UPDATE "#__contact_details" SET - "publish_up" = CASE WHEN "publish_up" = '1970-01-01 00:00:00' THEN NULL ELSE "publish_up" END, - "publish_down" = CASE WHEN "publish_down" = '1970-01-01 00:00:00' THEN NULL ELSE "publish_down" END, - "checked_out_time" = CASE WHEN "checked_out_time" = '1970-01-01 00:00:00' THEN NULL ELSE "checked_out_time" END; +UPDATE "#__contact_details" SET "publish_up" = NULL WHERE "publish_up" = '1970-01-01 00:00:00'; +UPDATE "#__contact_details" SET "publish_down" = NULL WHERE "publish_down" = '1970-01-01 00:00:00'; +UPDATE "#__contact_details" SET "checked_out_time" = NULL WHERE "checked_out_time" = '1970-01-01 00:00:00'; diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-06-28.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-06-28.sql index 279ea358b3a9b..35fceeae4df88 100644 --- a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-06-28.sql +++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-06-28.sql @@ -7,7 +7,6 @@ ALTER TABLE "#__banners" ALTER COLUMN "publish_down" DROP DEFAULT; ALTER TABLE "#__banners" ALTER COLUMN "checked_out_time" DROP NOT NULL; ALTER TABLE "#__banners" ALTER COLUMN "checked_out_time" DROP DEFAULT; - UPDATE "#__banners" SET - "publish_up" = CASE WHEN "publish_up" = '1970-01-01 00:00:00' THEN NULL ELSE "publish_up" END, - "publish_down" = CASE WHEN "publish_down" = '1970-01-01 00:00:00' THEN NULL ELSE "publish_down" END, - "checked_out_time" = CASE WHEN "checked_out_time" = '1970-01-01 00:00:00' THEN NULL ELSE "checked_out_time" END; \ No newline at end of file +UPDATE "#__banners" SET "publish_up" = NULL WHERE "publish_up" = '1970-01-01 00:00:00'; +UPDATE "#__banners" SET "publish_down" = NULL WHERE "publish_down" = '1970-01-01 00:00:00'; +UPDATE "#__banners" SET "checked_out_time" = NULL WHERE "checked_out_time" = '1970-01-01 00:00:00'; diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-06-29.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-06-29.sql index ed15ad49b04cf..bf1f50f89fa6c 100644 --- a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-06-29.sql +++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-06-29.sql @@ -7,7 +7,6 @@ ALTER TABLE "#__newsfeeds" ALTER COLUMN "publish_down" DROP DEFAULT; ALTER TABLE "#__newsfeeds" ALTER COLUMN "checked_out_time" DROP NOT NULL; ALTER TABLE "#__newsfeeds" ALTER COLUMN "checked_out_time" DROP DEFAULT; -UPDATE "#__newsfeeds" SET - "publish_up" = CASE WHEN "publish_up" = '1970-01-01 00:00:00' THEN NULL ELSE "publish_up" END, - "publish_down" = CASE WHEN "publish_down" = '1970-01-01 00:00:00' THEN NULL ELSE "publish_down" END, - "checked_out_time" = CASE WHEN "checked_out_time" = '1970-01-01 00:00:00' THEN NULL ELSE "checked_out_time" END; \ No newline at end of file +UPDATE "#__newsfeeds" SET "publish_up" = NULL WHERE "publish_up" = '1970-01-01 00:00:00'; +UPDATE "#__newsfeeds" SET "publish_down" = NULL WHERE "publish_down" = '1970-01-01 00:00:00'; +UPDATE "#__newsfeeds" SET "checked_out_time" = NULL WHERE "checked_out_time" = '1970-01-01 00:00:00'; diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-09-14.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-09-14.sql new file mode 100644 index 0000000000000..3c2ae8a310bf5 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-09-14.sql @@ -0,0 +1,32 @@ +ALTER TABLE "#__content" ALTER COLUMN "created" DROP DEFAULT; + +ALTER TABLE "#__content" ALTER COLUMN "modified" DROP DEFAULT; + +ALTER TABLE "#__content" ALTER COLUMN "publish_up" DROP NOT NULL; +ALTER TABLE "#__content" ALTER COLUMN "publish_up" DROP DEFAULT; + +ALTER TABLE "#__content" ALTER COLUMN "publish_down" DROP NOT NULL; +ALTER TABLE "#__content" ALTER COLUMN "publish_down" DROP DEFAULT; + +ALTER TABLE "#__content" ALTER COLUMN "checked_out_time" DROP NOT NULL; +ALTER TABLE "#__content" ALTER COLUMN "checked_out_time" DROP DEFAULT; + +UPDATE "#__content" SET "modified" = "created" WHERE "modified" = '1970-01-01 00:00:00'; + +UPDATE "#__content" SET "publish_up" = NULL WHERE "publish_up" = '1970-01-01 00:00:00'; +UPDATE "#__content" SET "publish_down" = NULL WHERE "publish_down" = '1970-01-01 00:00:00'; +UPDATE "#__content" SET "checked_out_time" = NULL WHERE "checked_out_time" = '1970-01-01 00:00:00'; + +UPDATE "#__ucm_content" SET "core_modified_time" = "core_created_time" + WHERE "core_type_alias" = 'com_content.article' + AND "core_modified_time" = '1970-01-01 00:00:00'; + +UPDATE "#__ucm_content" SET "core_publish_up" = NULL + WHERE "core_type_alias" = 'com_content.article' + AND "core_publish_up" = '1970-01-01 00:00:00'; +UPDATE "#__ucm_content" SET "core_publish_down" = NULL + WHERE "core_type_alias" = 'com_content.article' + AND "core_publish_down" = '1970-01-01 00:00:00'; +UPDATE "#__ucm_content" SET "core_checked_out_time" = NULL + WHERE "core_type_alias" = 'com_content.article' + AND "core_checked_out_time" = '1970-01-01 00:00:00'; diff --git a/administrator/components/com_content/Model/ArticleModel.php b/administrator/components/com_content/Model/ArticleModel.php index 43c4b8d65d57f..5ebbd65897a96 100644 --- a/administrator/components/com_content/Model/ArticleModel.php +++ b/administrator/components/com_content/Model/ArticleModel.php @@ -337,7 +337,7 @@ protected function prepareTable($table) if ($table->state == Workflow::CONDITION_PUBLISHED && intval($table->publish_down) == 0) { - $table->publish_down = $this->getDbo()->getNullDate(); + $table->publish_down = null; } // Increment the content version number. diff --git a/components/com_content/Helper/AssociationHelper.php b/components/com_content/Helper/AssociationHelper.php index 6a3f6d3d7b966..a1e9021604333 100644 --- a/components/com_content/Helper/AssociationHelper.php +++ b/components/com_content/Helper/AssociationHelper.php @@ -65,13 +65,12 @@ public static function getAssociations($id = 0, $view = null, $layout = null) if (!$user->authorise('core.edit.state', 'com_content') && !$user->authorise('core.edit', 'com_content')) { // Filter by start and end dates. - $nullDate = $db->quote($db->getNullDate()); $date = Factory::getDate(); $nowDate = $db->quote($date->toSql()); - $advClause[] = '(c2.publish_up = ' . $nullDate . ' OR c2.publish_up <= ' . $nowDate . ')'; - $advClause[] = '(c2.publish_down = ' . $nullDate . ' OR c2.publish_down >= ' . $nowDate . ')'; + $advClause[] = '(c2.publish_up IS NULL OR c2.publish_up <= ' . $nowDate . ')'; + $advClause[] = '(c2.publish_down IS NULL OR c2.publish_down >= ' . $nowDate . ')'; // Filter by published $advClause[] = 'c2.state = 1'; diff --git a/components/com_content/Helper/QueryHelper.php b/components/com_content/Helper/QueryHelper.php index 02e7e5a1c3b40..1bf2081436dbc 100644 --- a/components/com_content/Helper/QueryHelper.php +++ b/components/com_content/Helper/QueryHelper.php @@ -189,11 +189,11 @@ public static function getQueryDate($orderDate, DatabaseInterface $db = null) // Use created if publish_up is not set case 'published' : - $queryDate = ' CASE WHEN a.publish_up = ' . $db->quote($db->getNullDate()) . ' THEN a.created ELSE a.publish_up END '; + $queryDate = ' CASE WHEN a.publish_up IS NULL THEN a.created ELSE a.publish_up END '; break; case 'unpublished' : - $queryDate = ' CASE WHEN a.publish_down = ' . $db->quote($db->getNullDate()) . ' THEN a.created ELSE a.publish_down END '; + $queryDate = ' CASE WHEN a.publish_down IS NULL THEN a.created ELSE a.publish_down END '; break; case 'created' : default : diff --git a/components/com_content/Model/ArchiveModel.php b/components/com_content/Model/ArchiveModel.php index 4dfd263c5915d..47f55386769e0 100644 --- a/components/com_content/Model/ArchiveModel.php +++ b/components/com_content/Model/ArchiveModel.php @@ -187,11 +187,12 @@ protected function _getList($query, $limitstart=0, $limit=0) public function getYears() { $db = $this->getDbo(); - $nullDate = $db->quote($db->getNullDate()); - $nowDate = $db->quote(Factory::getDate()->toSql()); + + $nowDate = $db->quote(Factory::getDate()->toSql()); $query = $db->getQuery(true); $years = $query->year($db->quoteName('c.created')); + $query->select('DISTINCT (' . $years . ')') ->from($db->quoteName('#__content', 'c')) ->from($db->quoteName('#__workflow_associations', 'wa')) @@ -199,8 +200,8 @@ public function getYears() ->where($db->quoteName('c.id') . ' = ' . $db->quoteName('wa.item_id')) ->where($db->quoteName('ws.id') . ' = ' . $db->quoteName('wa.stage_id')) ->where($db->quoteName('ws.condition') . '= ' . (int) ContentComponent::CONDITION_ARCHIVED) - ->where('(c.publish_up = ' . $nullDate . ' OR c.publish_up <= ' . $nowDate . ')') - ->where('(c.publish_down = ' . $nullDate . ' OR c.publish_down >= ' . $nowDate . ')') + ->where('(c.publish_up IS NULL OR c.publish_up <= ' . $nowDate . ')') + ->where('(c.publish_down IS NULL OR c.publish_down >= ' . $nowDate . ')') ->order('1 ASC'); $db->setQuery($query); diff --git a/components/com_content/Model/ArticleModel.php b/components/com_content/Model/ArticleModel.php index 6d804c54263ff..7dbbe71b47244 100644 --- a/components/com_content/Model/ArticleModel.php +++ b/components/com_content/Model/ArticleModel.php @@ -100,9 +100,7 @@ public function getItem($pk = null) $this->getState( 'item.select', 'a.id, a.asset_id, a.title, a.alias, a.introtext, a.fulltext, ' . 'a.state, a.catid, a.created, a.created_by, a.created_by_alias, ' . - // Use created if modified is 0 - 'CASE WHEN a.modified = ' . $db->quote($db->getNullDate()) . ' THEN a.created ELSE a.modified END as modified, ' . - 'a.modified_by, a.checked_out, a.checked_out_time, a.publish_up, a.publish_down, ' . + 'a.modified, a.modified_by, a.checked_out, a.checked_out_time, a.publish_up, a.publish_down, ' . 'a.images, a.urls, a.attribs, a.version, a.ordering, ' . 'a.metakey, a.metadesc, a.access, a.hits, a.metadata, a.featured, a.language' ) @@ -155,13 +153,12 @@ public function getItem($pk = null) ) { // Filter by start and end dates. - $nullDate = $db->quote($db->getNullDate()); $date = Factory::getDate(); $nowDate = $db->quote($date->toSql()); - $query->where('(a.publish_up = ' . $nullDate . ' OR a.publish_up <= ' . $nowDate . ')') - ->where('(a.publish_down = ' . $nullDate . ' OR a.publish_down >= ' . $nowDate . ')'); + $query->where('(a.publish_up IS NULL OR a.publish_up <= ' . $nowDate . ')') + ->where('(a.publish_down IS NULL OR a.publish_down >= ' . $nowDate . ')'); } // Filter by published state. diff --git a/components/com_content/Model/ArticlesModel.php b/components/com_content/Model/ArticlesModel.php index 7cfff9bc226a0..deedc29cf7686 100644 --- a/components/com_content/Model/ArticlesModel.php +++ b/components/com_content/Model/ArticlesModel.php @@ -207,11 +207,9 @@ protected function getListQuery() // If category is not published then force 0 'CASE WHEN c.published = 2 AND ws.condition > 0 THEN ' . (int) ContentComponent::CONDITION_ARCHIVED . ' WHEN c.published != 1 THEN ' . (int) ContentComponent::CONDITION_UNPUBLISHED . ' ELSE ws.condition END as state,' . - // Use created if modified is 0 - 'CASE WHEN a.modified = ' . $db->quote($db->getNullDate()) . ' THEN a.created ELSE a.modified END as modified, ' . - 'a.modified_by, uam.name as modified_by_name,' . - // Use created if publish_up is 0 - 'CASE WHEN a.publish_up = ' . $db->quote($db->getNullDate()) . ' THEN a.created ELSE a.publish_up END as publish_up,' . + 'a.modified, a.modified_by, uam.name as modified_by_name,' . + // Use created if publish_up is null + 'CASE WHEN a.publish_up IS NULL THEN a.created ELSE a.publish_up END as publish_up,' . 'a.publish_down, a.images, a.urls, a.attribs, a.metadata, a.metakey, a.metadesc, a.access, ' . 'a.hits, a.featured, a.language, ' . $query->length('a.fulltext') . ' AS readmore, a.ordering' ) @@ -466,15 +464,13 @@ function ($data) use ($db) $query->where($authorWhere . $authorAliasWhere); } - // Define null and now dates - $nullDate = $db->quote($db->getNullDate()); $nowDate = $db->quote(Factory::getDate()->toSql()); // Filter by start and end dates. if ((!$user->authorise('core.edit.state', 'com_content')) && (!$user->authorise('core.edit', 'com_content'))) { - $query->where('(a.publish_up = ' . $nullDate . ' OR a.publish_up <= ' . $nowDate . ')') - ->where('(a.publish_down = ' . $nullDate . ' OR a.publish_down >= ' . $nowDate . ')'); + $query->where('(a.publish_up IS NULL OR a.publish_up <= ' . $nowDate . ')') + ->where('(a.publish_down IS NULL OR a.publish_down >= ' . $nowDate . ')'); } // Filter by Date Range or Relative Date @@ -484,8 +480,8 @@ function ($data) use ($db) switch ($dateFiltering) { case 'range': - $startDateRange = $db->quote($this->getState('filter.start_date_range', $nullDate)); - $endDateRange = $db->quote($this->getState('filter.end_date_range', $nullDate)); + $startDateRange = $db->quote($this->getState('filter.start_date_range')); + $endDateRange = $db->quote($this->getState('filter.end_date_range')); $query->where( '(' . $dateField . ' >= ' . $startDateRange . ' AND ' . $dateField . ' <= ' . $endDateRange . ')' @@ -530,13 +526,13 @@ function ($data) use ($db) if ($monthFilter != '') { $query->where( - $db->quote(date("Y-m-d", strtotime($monthFilter)) . ' 00:00:00') . ' <= CASE WHEN a.publish_up = ' . - $db->quote($db->getNullDate()) . ' THEN a.created ELSE a.publish_up END' + $db->quote(date("Y-m-d", strtotime($monthFilter)) . ' 00:00:00') + . ' <= CASE WHEN a.publish_up IS NULL THEN a.created ELSE a.publish_up END' ); $query->where( - $db->quote(date("Y-m-t", strtotime($monthFilter)) . ' 23:59:59') . ' >= CASE WHEN a.publish_up = ' . - $db->quote($db->getNullDate()) . ' THEN a.created ELSE a.publish_up END' + $db->quote(date("Y-m-t", strtotime($monthFilter)) . ' 23:59:59') + . ' >= CASE WHEN a.publish_up IS NULL THEN a.created ELSE a.publish_up END' ); } break; diff --git a/components/com_content/tmpl/article/default.php b/components/com_content/tmpl/article/default.php index 973c7689cc159..5c8a58052d3a3 100644 --- a/components/com_content/tmpl/article/default.php +++ b/components/com_content/tmpl/article/default.php @@ -61,7 +61,7 @@ item->publish_up) > strtotime(Factory::getDate())) : ?> - item->publish_down) < strtotime(Factory::getDate())) && $this->item->publish_down != Factory::getDbo()->getNullDate()) : ?> + item->publish_down) && (strtotime($this->item->publish_down) < strtotime(Factory::getDate()))) : ?> diff --git a/components/com_content/tmpl/category/blog_item.php b/components/com_content/tmpl/category/blog_item.php index 7ccc0bccd7a67..ce8078a520c29 100644 --- a/components/com_content/tmpl/category/blog_item.php +++ b/components/com_content/tmpl/category/blog_item.php @@ -30,7 +30,7 @@
item->stage_condition == ContentComponent::CONDITION_UNPUBLISHED || strtotime($this->item->publish_up) > strtotime(Factory::getDate()) - || ((strtotime($this->item->publish_down) < strtotime(Factory::getDate())) && $this->item->publish_down != Factory::getDbo()->getNullDate())) : ?> + || (!is_null($this->item->publish_down) && strtotime($this->item->publish_down) < strtotime(Factory::getDate()))) : ?>
@@ -86,7 +86,7 @@ item->stage_condition == ContentComponent::CONDITION_UNPUBLISHED || strtotime($this->item->publish_up) > strtotime(Factory::getDate()) - || ((strtotime($this->item->publish_down) < strtotime(Factory::getDate())) && $this->item->publish_down != Factory::getDbo()->getNullDate())) : ?> + || (!is_null($this->item->publish_down) && strtotime($this->item->publish_down) < strtotime(Factory::getDate()))) : ?>
diff --git a/components/com_content/tmpl/category/default_articles.php b/components/com_content/tmpl/category/default_articles.php index f4fad41586149..c981fc03dafac 100644 --- a/components/com_content/tmpl/category/default_articles.php +++ b/components/com_content/tmpl/category/default_articles.php @@ -235,7 +235,7 @@ - publish_down) < strtotime(Factory::getDate())) && $article->publish_down != Factory::getDbo()->getNullDate()) : ?> + publish_down) && strtotime($article->publish_down) < strtotime(Factory::getDate())) : ?> diff --git a/components/com_content/tmpl/featured/default_item.php b/components/com_content/tmpl/featured/default_item.php index 2b8b5426c244b..e15f89d36b5db 100644 --- a/components/com_content/tmpl/featured/default_item.php +++ b/components/com_content/tmpl/featured/default_item.php @@ -30,7 +30,7 @@
item->state == Workflow::CONDITION_UNPUBLISHED || strtotime($this->item->publish_up) > strtotime(Factory::getDate()) - || ((strtotime($this->item->publish_down) < strtotime(Factory::getDate())) && $this->item->publish_down != Factory::getDbo()->getNullDate())) : ?> + || (!is_null($this->item->publish_down) && strtotime($this->item->publish_down) < strtotime(Factory::getDate()))) : ?>
@@ -52,7 +52,7 @@ item->publish_up) > strtotime(Factory::getDate())) : ?> - item->publish_down) < strtotime(Factory::getDate())) && $this->item->publish_down != Factory::getDbo()->getNullDate()) : ?> + item->publish_down) && strtotime($this->item->publish_down) < strtotime(Factory::getDate())) : ?> @@ -104,7 +104,7 @@ item->state == Workflow::CONDITION_UNPUBLISHED || strtotime($this->item->publish_up) > strtotime(Factory::getDate()) - || ((strtotime($this->item->publish_down) < strtotime(Factory::getDate())) && $this->item->publish_down != $this->db->getNullDate() )) : ?> + || (!is_null($this->item->publish_down) && strtotime($this->item->publish_down) < strtotime(Factory::getDate()))) : ?>
diff --git a/installation/sql/mysql/joomla.sql b/installation/sql/mysql/joomla.sql index 5428686023f6d..e578254b42070 100644 --- a/installation/sql/mysql/joomla.sql +++ b/installation/sql/mysql/joomla.sql @@ -346,15 +346,15 @@ CREATE TABLE IF NOT EXISTS `#__content` ( `fulltext` mediumtext NOT NULL, `state` tinyint(3) NOT NULL DEFAULT 0, `catid` int(10) unsigned NOT NULL DEFAULT 0, - `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `created` datetime NOT NULL, `created_by` int(10) unsigned NOT NULL DEFAULT 0, `created_by_alias` varchar(255) NOT NULL DEFAULT '', - `modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `modified` datetime NOT NULL, `modified_by` int(10) unsigned NOT NULL DEFAULT 0, `checked_out` int(10) unsigned NOT NULL DEFAULT 0, - `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `publish_up` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `publish_down` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `checked_out_time` datetime NULL DEFAULT NULL, + `publish_up` datetime NULL DEFAULT NULL, + `publish_down` datetime NULL DEFAULT NULL, `images` text NOT NULL, `urls` text NOT NULL, `attribs` varchar(5120) NOT NULL, @@ -1864,7 +1864,7 @@ CREATE TABLE IF NOT EXISTS `#__ucm_content` ( `core_alias` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '', `core_body` mediumtext NOT NULL DEFAULT '', `core_state` tinyint(1) NOT NULL DEFAULT 0, - `core_checked_out_time` varchar(255) NOT NULL DEFAULT '0000-00-00 00:00:00', + `core_checked_out_time` datetime, `core_checked_out_user_id` int(10) unsigned NOT NULL DEFAULT 0, `core_access` int(10) unsigned NOT NULL DEFAULT 0, `core_params` text NOT NULL DEFAULT '', @@ -1872,12 +1872,12 @@ CREATE TABLE IF NOT EXISTS `#__ucm_content` ( `core_metadata` varchar(2048) NOT NULL DEFAULT '' COMMENT 'JSON encoded metadata properties.', `core_created_user_id` int(10) unsigned NOT NULL DEFAULT 0, `core_created_by_alias` varchar(255) NOT NULL DEFAULT '', - `core_created_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `core_created_time` datetime NOT NULL, `core_modified_user_id` int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'Most recent user that modified', - `core_modified_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `core_modified_time` datetime NOT NULL, `core_language` char(7) NOT NULL DEFAULT '', - `core_publish_up` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `core_publish_down` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `core_publish_up` datetime, + `core_publish_down` datetime, `core_content_item_id` int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'ID from the individual type table', `asset_id` int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', `core_images` text NOT NULL DEFAULT '', @@ -1915,7 +1915,7 @@ CREATE TABLE IF NOT EXISTS `#__ucm_history` ( `ucm_item_id` int(10) unsigned NOT NULL, `ucm_type_id` int(10) unsigned NOT NULL, `version_note` varchar(255) NOT NULL DEFAULT '' COMMENT 'Optional version name', - `save_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `save_date` datetime NOT NULL, `editor_user_id` int(10) unsigned NOT NULL DEFAULT 0, `character_count` int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'Number of characters in this version.', `sha1_hash` varchar(50) NOT NULL DEFAULT '' COMMENT 'SHA1 hash of the version_data column.', diff --git a/installation/sql/postgresql/joomla.sql b/installation/sql/postgresql/joomla.sql index 22971aeeb0baa..1653726dd3678 100644 --- a/installation/sql/postgresql/joomla.sql +++ b/installation/sql/postgresql/joomla.sql @@ -351,15 +351,15 @@ CREATE TABLE IF NOT EXISTS "#__content" ( "fulltext" text NOT NULL, "state" smallint DEFAULT 0 NOT NULL, "catid" bigint DEFAULT 0 NOT NULL, - "created" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL, + "created" timestamp without time zone NOT NULL, "created_by" bigint DEFAULT 0 NOT NULL, "created_by_alias" varchar(255) DEFAULT '' NOT NULL, - "modified" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL, + "modified" timestamp without time zone NOT NULL, "modified_by" bigint DEFAULT 0 NOT NULL, "checked_out" bigint DEFAULT 0 NOT NULL, - "checked_out_time" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL, - "publish_up" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL, - "publish_down" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL, + "checked_out_time" timestamp without time zone, + "publish_up" timestamp without time zone, + "publish_down" timestamp without time zone, "images" text NOT NULL, "urls" text NOT NULL, "attribs" varchar(5120) NOT NULL, @@ -1855,7 +1855,7 @@ CREATE TABLE IF NOT EXISTS "#__ucm_content" ( "core_alias" varchar(255) DEFAULT '' NOT NULL, "core_body" text NOT NULL DEFAULT '', "core_state" smallint DEFAULT 0 NOT NULL, - "core_checked_out_time" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL, + "core_checked_out_time" timestamp without time zone, "core_checked_out_user_id" bigint DEFAULT 0 NOT NULL, "core_access" bigint DEFAULT 0 NOT NULL, "core_params" text DEFAULT '' NOT NULL, @@ -1863,12 +1863,12 @@ CREATE TABLE IF NOT EXISTS "#__ucm_content" ( "core_metadata" text DEFAULT '' NOT NULL, "core_created_user_id" bigint DEFAULT 0 NOT NULL, "core_created_by_alias" varchar(255) DEFAULT '' NOT NULL, - "core_created_time" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL, + "core_created_time" timestamp without time zone NOT NULL, "core_modified_user_id" bigint DEFAULT 0 NOT NULL, - "core_modified_time" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL, + "core_modified_time" timestamp without time zone NOT NULL, "core_language" varchar(7) DEFAULT '' NOT NULL, - "core_publish_up" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL, - "core_publish_down" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL, + "core_publish_up" timestamp without time zone, + "core_publish_down" timestamp without time zone, "core_content_item_id" bigint DEFAULT 0 NOT NULL, "asset_id" bigint DEFAULT 0 NOT NULL, "core_images" text DEFAULT '' NOT NULL, @@ -1905,7 +1905,7 @@ CREATE TABLE IF NOT EXISTS "#__ucm_history" ( "ucm_item_id" integer NOT NULL, "ucm_type_id" integer NOT NULL, "version_note" varchar(255) NOT NULL DEFAULT '', - "save_date" timestamp with time zone NOT NULL DEFAULT '1970-01-01 00:00:00', + "save_date" timestamp with time zone NOT NULL, "editor_user_id" integer NOT NULL DEFAULT 0, "character_count" integer NOT NULL DEFAULT 0, "sha1_hash" varchar(50) NOT NULL DEFAULT '', diff --git a/libraries/src/Table/Content.php b/libraries/src/Table/Content.php index bee35d09e2141..da2f1acf7a592 100644 --- a/libraries/src/Table/Content.php +++ b/libraries/src/Table/Content.php @@ -25,6 +25,14 @@ */ class Content extends Table { + /** + * Indicates that columns fully support the NULL value in the database + * + * @var boolean + * @since 4.0.0 + */ + protected $_supportNullValue = true; + /** * Constructor * @@ -244,20 +252,20 @@ public function check() $this->hits = 0; } - // Set publish_up to null date if not set + // Set publish_up to null if not set if (!$this->publish_up) { - $this->publish_up = $this->_db->getNullDate(); + $this->publish_up = null; } - // Set publish_down to null date if not set + // Set publish_down to null if not set if (!$this->publish_down) { - $this->publish_down = $this->_db->getNullDate(); + $this->publish_down = null; } // Check the publish down date is not earlier than publish up. - if ($this->publish_down < $this->publish_up && $this->publish_down > $this->_db->getNullDate()) + if (!is_null($this->publish_up) && !is_null($this->publish_down) && $this->publish_down < $this->publish_up) { // Swap the dates. $temp = $this->publish_up; @@ -265,12 +273,6 @@ public function check() $this->publish_down = $temp; } - // Set modified to null date if not set - if (!$this->modified) - { - $this->modified = $this->_db->getNullDate(); - } - // Clean up keywords -- eliminate extra spaces between phrases // and cr (\r) and lf (\n) characters from string if (!empty($this->metakey)) @@ -313,7 +315,7 @@ public function check() * * @since 1.6 */ - public function store($updateNulls = false) + public function store($updateNulls = true) { $date = Factory::getDate(); $user = Factory::getUser(); @@ -337,6 +339,12 @@ public function store($updateNulls = false) { $this->created_by = $user->get('id'); } + + // Set modified to created date if not set + if (!$this->modified) + { + $this->modified = $this->created; + } } // Verify that the alias is unique diff --git a/libraries/src/Table/CoreContent.php b/libraries/src/Table/CoreContent.php index 37ac1628e726a..1ab00c70c212f 100644 --- a/libraries/src/Table/CoreContent.php +++ b/libraries/src/Table/CoreContent.php @@ -26,6 +26,14 @@ */ class CoreContent extends Table { + /** + * Indicates that columns fully support the NULL value in the database + * + * @var boolean + * @since __DEPLOY_VERSION__ + */ + protected $_supportNullValue = true; + /** * Constructor * @@ -245,7 +253,7 @@ public function deleteByContentId($contentItemId = null, $typeAlias = null) * * @since 3.1 */ - public function store($updateNulls = false) + public function store($updateNulls = true) { $date = Factory::getDate(); $user = Factory::getUser(); @@ -271,6 +279,11 @@ public function store($updateNulls = false) $this->core_created_user_id = $user->get('id'); } + if (!(int) $this->core_modified_time) + { + $this->core_modified_time = $this->core_created_time; + } + $isNew = true; } @@ -296,7 +309,7 @@ public function store($updateNulls = false) * * @since 3.1 */ - protected function storeUcmBase($updateNulls = false, $isNew = false) + protected function storeUcmBase($updateNulls = true, $isNew = false) { // Store the ucm_base row $db = $this->getDbo(); diff --git a/modules/mod_related_items/Helper/RelatedItemsHelper.php b/modules/mod_related_items/Helper/RelatedItemsHelper.php index e1ad597ba5bfc..f696c5c67194e 100644 --- a/modules/mod_related_items/Helper/RelatedItemsHelper.php +++ b/modules/mod_related_items/Helper/RelatedItemsHelper.php @@ -61,7 +61,6 @@ public static function getList(&$params) $temp = explode(':', $temp); $id = (int) $temp[0]; - $nullDate = $db->getNullDate(); $now = Factory::getDate()->toSql(); $related = []; $query = $db->getQuery(true); @@ -131,16 +130,15 @@ public static function getList(&$params) } $query->extendWhere('AND', $wheres, 'OR') - ->extendWhere('AND', [ $db->quoteName('a.publish_up') . ' = :nullDate1', $db->quoteName('a.publish_up') . ' <= :nowDate1'], 'OR') + ->extendWhere('AND', [ $db->quoteName('a.publish_up') . ' IS NULL', $db->quoteName('a.publish_up') . ' <= :nowDate1'], 'OR') ->extendWhere( 'AND', [ - $db->quoteName('a.publish_down') . ' = :nullDate2', + $db->quoteName('a.publish_down') . ' IS NULL', $db->quoteName('a.publish_down') . ' >= :nowDate2' ], 'OR' ) - ->bind([':nullDate1', ':nullDate2'], $nullDate) ->bind([':nowDate1', ':nowDate2'], $now); // Filter by language diff --git a/plugins/content/pagenavigation/pagenavigation.php b/plugins/content/pagenavigation/pagenavigation.php index 11c4524062a0b..79a61a9f54f5c 100644 --- a/plugins/content/pagenavigation/pagenavigation.php +++ b/plugins/content/pagenavigation/pagenavigation.php @@ -53,7 +53,6 @@ public function onContentBeforeDisplay($context, &$row, &$params, $page = 0) $db = Factory::getDbo(); $user = Factory::getUser(); $lang = Factory::getLanguage(); - $nullDate = $db->getNullDate(); $date = Factory::getDate(); $now = $date->toSql(); @@ -127,8 +126,8 @@ public function onContentBeforeDisplay($context, &$row, &$params, $page = 0) } $xwhere = ' AND (ws.condition = 1 OR ws.condition = -2)' - . ' AND (publish_up = ' . $db->quote($nullDate) . ' OR publish_up <= ' . $db->quote($now) . ')' - . ' AND (publish_down = ' . $db->quote($nullDate) . ' OR publish_down >= ' . $db->quote($now) . ')'; + . ' AND (publish_up IS NULL OR publish_up <= ' . $db->quote($now) . ')' + . ' AND (publish_down IS NULL OR publish_down >= ' . $db->quote($now) . ')'; // Array of articles in same category correctly ordered. $query = $db->getQuery(true); @@ -251,14 +250,13 @@ private static function getQueryDate($orderDate) switch ($orderDate) { - // Use created if modified is not set case 'modified' : - $queryDate = ' CASE WHEN a.modified = ' . $db->quote($db->getNullDate()) . ' THEN a.created ELSE a.modified END'; + $queryDate = ' a.modified'; break; // Use created if publish_up is not set case 'published' : - $queryDate = ' CASE WHEN a.publish_up = ' . $db->quote($db->getNullDate()) . ' THEN a.created ELSE a.publish_up END '; + $queryDate = ' CASE WHEN a.publish_up IS NULL THEN a.created ELSE a.publish_up END '; break; // Use created as default diff --git a/plugins/sampledata/multilang/multilang.php b/plugins/sampledata/multilang/multilang.php index 02b3723da2c5a..cff71dd30e9d0 100644 --- a/plugins/sampledata/multilang/multilang.php +++ b/plugins/sampledata/multilang/multilang.php @@ -1107,7 +1107,7 @@ private function addArticle($itemLanguage, $categoryId) 'created_by' => (int) $this->getAdminId(), 'created_by_alias' => 'Joomla', 'publish_up' => $currentDate, - 'publish_down' => $db->getNullDate(), + 'publish_down' => null, 'version' => 1, 'catid' => $categoryId, 'metadata' => '{"robots":"","author":"","rights":"","tags":null}',