Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
ALTER TABLE `#__newsfeeds` MODIFY `created` datetime NOT NULL;
ALTER TABLE `#__newsfeeds` MODIFY `modified` datetime NOT NULL;

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 `modified` = `created` WHERE `modified` = '0000-00-00 00:00:00';

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';

UPDATE `#__ucm_content` SET `core_modified_time` = `core_created_time`
WHERE `core_type_alias` = 'com_newsfeeds.newsfeed'
AND `core_modified_time` = '0000-00-00 00:00:00';

UPDATE `#__ucm_content` SET `core_publish_up` = NULL
WHERE `core_type_alias` = 'com_newsfeeds.newsfeed'
AND `core_publish_up` = '0000-00-00 00:00:00';
UPDATE `#__ucm_content` SET `core_publish_down` = NULL
WHERE `core_type_alias` = 'com_newsfeeds.newsfeed'
AND `core_publish_down` = '0000-00-00 00:00:00';
UPDATE `#__ucm_content` SET `core_checked_out_time` = NULL
WHERE `core_type_alias` = 'com_newsfeeds.newsfeed'
AND `core_checked_out_time` = '0000-00-00 00:00:00';
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
ALTER TABLE "#__newsfeeds" ALTER COLUMN "created" DROP DEFAULT;

ALTER TABLE "#__newsfeeds" ALTER COLUMN "modified" DROP DEFAULT;

ALTER TABLE "#__newsfeeds" ALTER COLUMN "publish_up" DROP NOT NULL;
ALTER TABLE "#__newsfeeds" ALTER COLUMN "publish_up" DROP DEFAULT;

Expand All @@ -7,6 +11,22 @@ 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 "modified" = "created" WHERE "modified" = '1970-01-01 00:00:00';

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';

UPDATE "#__ucm_content" SET "core_modified_time" = "core_created_time"
WHERE "core_type_alias" = 'com_newsfeeds.newsfeed'
AND "core_modified_time" = '1970-01-01 00:00:00';

UPDATE "#__ucm_content" SET "core_publish_up" = NULL
WHERE "core_type_alias" = 'com_newsfeeds.newsfeed'
AND "core_publish_up" = '1970-01-01 00:00:00';
UPDATE "#__ucm_content" SET "core_publish_down" = NULL
WHERE "core_type_alias" = 'com_newsfeeds.newsfeed'
AND "core_publish_down" = '1970-01-01 00:00:00';
UPDATE "#__ucm_content" SET "core_checked_out_time" = NULL
WHERE "core_type_alias" = 'com_newsfeeds.newsfeed'
AND "core_checked_out_time" = '1970-01-01 00:00:00';
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ CREATE TABLE IF NOT EXISTS `#__newsfeeds` (
`numarticles` int(10) unsigned NOT NULL DEFAULT 1,
`cache_time` int(10) unsigned NOT NULL DEFAULT 3600,
`checked_out` int(10) unsigned NOT NULL DEFAULT 0,
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`checked_out_time` datetime,
`ordering` int(11) NOT NULL DEFAULT 0,
`rtl` tinyint(4) NOT NULL DEFAULT 0,
`access` int(10) unsigned NOT NULL DEFAULT 0,
`language` char(7) NOT NULL DEFAULT '',
`params` text NOT NULL,
`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,
`metakey` text NOT NULL,
`metadesc` text NOT NULL,
`metadata` text NOT NULL,
`publish_up` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`publish_down` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`publish_up` datetime,
`publish_down` datetime,
`description` text NOT NULL,
`version` int(10) unsigned NOT NULL DEFAULT 1,
`hits` int(10) unsigned NOT NULL DEFAULT 0,
Expand Down
4 changes: 2 additions & 2 deletions components/com_newsfeeds/Model/CategoryModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ protected function getListQuery()

if ($this->getState('filter.publish_date'))
{
$query->where('(' . $query->isNullDatetime('a.publish_up') . ' OR a.publish_up <= ' . $db->quote($nowDate) . ')')
->where('(' . $query->isNullDatetime('a.publish_down') . ' OR a.publish_down >= ' . $db->quote($nowDate) . ')');
$query->where('(a.publish_up IS NULL OR a.publish_up <= ' . $db->quote($nowDate) . ')')
->where('(a.publish_down IS NULL OR a.publish_down >= ' . $db->quote($nowDate) . ')');
}

// Filter by search in title
Expand Down
4 changes: 2 additions & 2 deletions components/com_newsfeeds/Model/NewsfeedModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ public function &getItem($pk = null)
if (is_numeric($published))
{
$query->where('(a.published = ' . (int) $published . ' OR a.published =' . (int) $archived . ')')
->where('(' . $query->isNullDatetime('a.publish_up') . ' OR a.publish_up <= ' . $db->quote($nowDate) . ')')
->where('(' . $query->isNullDatetime('a.publish_down') . ' OR a.publish_down >= ' . $db->quote($nowDate) . ')')
->where('(a.publish_up IS NULL OR a.publish_up <= ' . $db->quote($nowDate) . ')')
->where('(a.publish_down IS NULL OR a.publish_down >= ' . $db->quote($nowDate) . ')')
->where('(c.published = ' . (int) $published . ' OR c.published =' . (int) $archived . ')');
}

Expand Down
4 changes: 2 additions & 2 deletions installation/sql/mysql/joomla.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1567,10 +1567,10 @@ CREATE TABLE IF NOT EXISTS `#__newsfeeds` (
`access` int(10) unsigned NOT NULL DEFAULT 0,
`language` char(7) NOT NULL DEFAULT '',
`params` text NOT NULL,
`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,
`metakey` text NOT NULL,
`metadesc` text NOT NULL,
Expand Down
4 changes: 2 additions & 2 deletions installation/sql/postgresql/joomla.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1564,10 +1564,10 @@ CREATE TABLE IF NOT EXISTS "#__newsfeeds" (
"access" bigint DEFAULT 0 NOT NULL,
"language" varchar(7) DEFAULT '' NOT NULL,
"params" text 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" integer 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" integer DEFAULT 0 NOT NULL,
"metakey" text NOT NULL,
"metadesc" text NOT NULL,
Expand Down