Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
172c18a
Contacts not nullable datetimes defaults - SQL changes
richard67 Sep 22, 2019
df915d0
Don't check for pseudo null datetimes in PHP
richard67 Sep 22, 2019
8c569c4
Update components/com_contact/Model/ContactModel.php
richard67 Sep 22, 2019
a87264f
Merge branch '4.0-dev' into 4.0-dev-datetime-default-com-contacts
richard67 Sep 24, 2019
214f388
Merge branch '4.0-dev' into 4.0-dev-datetime-default-com-contacts
richard67 Sep 25, 2019
a5fce46
Merge branch '4.0-dev' into 4.0-dev-datetime-default-com-contacts
rdeutz Sep 28, 2019
4f6a444
No defaults for not nullable, minimize updating old data, handle ucm …
richard67 Sep 28, 2019
665f332
Update modified also on postgresql
richard67 Sep 28, 2019
abe323a
Merge branch '4.0-dev' into 4.0-dev-datetime-default-com-contacts
richard67 Sep 28, 2019
ff56a73
Fields datetimes defaults - SQL changes
richard67 Oct 3, 2019
434604d
Finder datetimes defaults - SQL changes
richard67 Oct 3, 2019
6db6bb5
Fields datetimes defaults - PHP changes
richard67 Oct 3, 2019
c1d70f8
Merge branch '4.0-dev' into 4.0-dev-datetime-default-com-fields
richard67 Oct 3, 2019
f4e67b8
Merge branch '4.0-dev' into 4.0-dev-datetime-default-com-contacts
richard67 Oct 3, 2019
d7dcb23
Merge branch '4.0-dev' into 4.0-dev-datetime-default-com-fields
richard67 Oct 3, 2019
279f14a
Merge remote-tracking branch 'upstream/4.0-dev' into 4.0-dev-datetime…
richard67 Oct 3, 2019
b1245e0
Finder datetimes defaults - PHP changes
richard67 Oct 3, 2019
9d6fbce
silly me
richard67 Oct 3, 2019
c15981a
Tags datetimes defaults - SQL changes
richard67 Oct 4, 2019
4d84c5b
Users and user notes datetimes defaults - SQL changes
richard67 Oct 4, 2019
4c92872
Categories datetimes defaults - SQL changes
richard67 Oct 4, 2019
4ddec1c
Tags datetimes defaults - PHP changes
richard67 Oct 4, 2019
d6ce68b
Users and user notes datetimes defaults - PHP changes step 1
richard67 Oct 4, 2019
ebec837
Fix my mistake in registration model
richard67 Oct 4, 2019
f9c43c9
Silly me fix no. 1
richard67 Oct 5, 2019
9f52abc
Fix root tag for new installs
richard67 Oct 5, 2019
ca03eb9
Merge branch '4.0-dev' into 4.0-dev-datetime-default-com-tags
richard67 Oct 5, 2019
abaa635
Fix tag table checks
richard67 Oct 5, 2019
dbcac14
Update NoteTable.php
richard67 Oct 5, 2019
367395c
Merge remote-tracking branch 'upstream/4.0-dev' into 4.0-dev-datetime…
richard67 Oct 5, 2019
768b6a0
Merge branch '4.0-dev' into 4.0-dev-datetime-default-com-fields
richard67 Oct 5, 2019
e14e5d1
Merge branch '4.0-dev' into 4.0-dev-datetime-default-com-finder
richard67 Oct 5, 2019
3f78141
Merge branch '4.0-dev' into 4.0-dev-datetime-default-com-finder
richard67 Oct 6, 2019
f985875
Merge remote-tracking branch 'upstream/4.0-dev' into 4.0-dev-datetime…
richard67 Oct 6, 2019
9bbd630
Merge remote-tracking branch 'upstream/4.0-dev' into 4.0-dev-datetime…
richard67 Oct 6, 2019
ef8f94d
Merge remote-tracking branch 'upstream/4.0-dev' into 4.0-dev-datetime…
richard67 Oct 6, 2019
04df20f
Merge remote-tracking branch 'upstream/4.0-dev' into 4.0-dev-datetime…
richard67 Oct 6, 2019
d44c15c
Merge remote-tracking branch 'upstream/4.0-dev' into 4.0-dev-datetime…
richard67 Oct 6, 2019
51175bb
Merge remote-tracking branch 'upstream/4.0-dev' into 4.0-dev-datetime…
richard67 Oct 6, 2019
223b194
Categories datetimes defaults - PHP changes step 1
richard67 Oct 6, 2019
ef47bc6
Insert categories with correct datetimes on new install
richard67 Oct 6, 2019
88d2131
Update CheckinModel.php
richard67 Oct 6, 2019
19fcf5f
Update CategoryNode.php
richard67 Oct 6, 2019
7c69be9
Make checked out time of extensions nullable - SQL
richard67 Oct 6, 2019
c83b53e
Update install.mysql.utf8.sql
richard67 Oct 6, 2019
2f4b59a
Update install.mysql.sql
richard67 Oct 6, 2019
27dca6d
Update install.postgresql.sql
richard67 Oct 6, 2019
b046fa1
Use CURRENT_TIMESTAMP for root tag on new install
richard67 Oct 6, 2019
ced6b6d
Use CURRENT_TIMESTAMP when creating categories on new install
richard67 Oct 6, 2019
4ddb50e
Update TagsHelper.php
richard67 Oct 6, 2019
b067b58
Merge branch '4.0-dev' into 4.0-dev-datetime-default-com-finder
richard67 Oct 7, 2019
8efc91f
Merge branch '4.0-dev' into 4.0-dev-datetime-default-com-contacts
richard67 Oct 12, 2019
e070781
Merge branch '4.0-dev' into 4.0-dev-datetime-default-com-fields
richard67 Oct 12, 2019
d304040
Merge branch '4.0-dev' into 4.0-dev-datetime-default-com-finder
richard67 Oct 12, 2019
45d315e
Merge branch '4.0-dev' into 4.0-dev-datetime-default-com-tags
richard67 Oct 12, 2019
21aab75
Merge branch '4.0-dev-datetime-default-com-fields' into 4.0-dev-datet…
richard67 Oct 12, 2019
4565d50
Privacy datetimes defaults - SQL changes
richard67 Oct 12, 2019
d2eb6b2
Privacy datetimes defaults - PHP changes
richard67 Oct 12, 2019
52386b2
Merge branch '4.0-dev' into 4.0-dev-datetime-default-com-privacy-2
richard67 Oct 12, 2019
f6d2198
Merge branch '4.0-dev-datetime-default-com-finder' into 4.0-dev-datet…
richard67 Oct 12, 2019
e1adbdf
Merge branch '4.0-dev-datetime-default-com-tags' into 4.0-dev-datetim…
richard67 Oct 12, 2019
6a922e8
Merge branch '4.0-dev-datetime-default-com-users' into 4.0-dev-dateti…
richard67 Oct 12, 2019
636877b
Merge branch '4.0-dev-datetime-default-com-categories' into 4.0-dev-d…
richard67 Oct 12, 2019
a9dd258
Merge branch '4.0-dev-datetime-default-com-checkin' into 4.0-dev-date…
richard67 Oct 12, 2019
fadfe89
Merge branch '4.0-dev-extensions-checked-out-time-nullable' into 4.0-…
richard67 Oct 12, 2019
368dac9
Merge branch '4.0-dev-datetime-default-com-privacy-2' into 4.0-dev-da…
richard67 Oct 12, 2019
c8294a0
Merge branch '4.0-dev' into 4.0-dev-datetime-default-test-all
richard67 Oct 12, 2019
b993163
Merge branch '4.0-dev' into 4.0-dev-datetime-default-com-users
richard67 Oct 13, 2019
63987f3
Merge branch '4.0-dev' into 4.0-dev-datetime-default-com-tags
richard67 Oct 13, 2019
0b99c8f
Undo unrelated change in users model
richard67 Oct 13, 2019
8b9af88
Update UsersModel.php
richard67 Oct 13, 2019
e8a384b
Merge branch '4.0-dev' into 4.0-dev-datetime-default-com-users
richard67 Oct 13, 2019
8c6449d
Update UsersModel.php
richard67 Oct 13, 2019
e583fce
Update UsersModel.php
richard67 Oct 13, 2019
5cc53ca
Merge branch '4.0-dev-datetime-default-com-users' into 4.0-dev-dateti…
richard67 Oct 13, 2019
fc4657c
Merge branch '4.0-dev' into 4.0-dev-datetime-default-com-tags
richard67 Oct 13, 2019
204233b
Add back check of old null date for 3rd party compatibility of UCM co…
richard67 Oct 13, 2019
fac281e
Update TagsPopularHelper.php
richard67 Oct 13, 2019
348d1a0
Merge branch '4.0-dev-datetime-default-com-tags' into 4.0-dev-datetim…
richard67 Oct 13, 2019
6da7120
Merge remote-tracking branch 'upstream/4.0-dev' into 4.0-dev-extensio…
richard67 Oct 13, 2019
1af2f3d
Use real null date in update sql for subfields
richard67 Oct 13, 2019
b756318
Merge branch '4.0-dev-extensions-checked-out-time-nullable' into 4.0-…
richard67 Oct 13, 2019
0b82c66
Revert "Use real null date in update sql for subfields"
richard67 Oct 13, 2019
65d86f4
Revert "Use real null date in update sql for subfields"
richard67 Oct 13, 2019
6bbb0d9
Merge branch '4.0-dev-extensions-checked-out-time-nullable' into 4.0-…
richard67 Oct 13, 2019
94cafe6
Fix checked_out_time for loadmodule extension
richard67 Oct 13, 2019
65b3471
Fix extension order for new installs
richard67 Oct 13, 2019
75d3c71
Merge branch '4.0-dev-extensions-checked-out-time-nullable' into 4.0-…
richard67 Oct 13, 2019
96587be
Merge branch '4.0-dev' into 4.0-dev-datetime-default-test-all
richard67 Oct 13, 2019
37c6898
Merge branch '4.0-dev' into 4.0-dev-datetime-default-test-all
wilsonge Oct 13, 2019
48f499b
Merge branch '4.0-dev' into 4.0-dev-datetime-default-test-all
wilsonge Oct 13, 2019
cbe636e
Merge remote-tracking branch 'upstream/4.0-dev' into 4.0-dev-datetime…
richard67 Oct 16, 2019
158289b
Merge branch '4.0-dev' into 4.0-dev-datetime-default-test-all
wilsonge Oct 16, 2019
767da23
Merge branch '4.0-dev' into 4.0-dev-datetime-default-test-all
wilsonge Oct 16, 2019
40c07af
Merge branch '4.0-dev' into 4.0-dev-datetime-default-test-all
wilsonge Oct 16, 2019
5ebea2f
Merge branch '4.0-dev' into 4.0-dev-datetime-default-test-all
richard67 Oct 16, 2019
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
Expand Up @@ -150,8 +150,8 @@ protected function getListQuery()
{
$date = $this->buildDateRange($dateRange);

// If the chosen range is not more than a year ago
if ($date['dNow'] != false)
// If a range was chosen and it is not more than a year ago
if ($date['dNow'] != false && $date['dStart'] != false)
{
$dStart = $date['dStart']->format('Y-m-d H:i:s');
$dNow = $date['dNow']->format('Y-m-d H:i:s');
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ALTER TABLE `#__privacy_requests` MODIFY `requested_at` datetime NOT NULL;
ALTER TABLE `#__privacy_requests` MODIFY `confirm_token_created_at` datetime NULL DEFAULT NULL;

ALTER TABLE `#__privacy_consents` MODIFY `created` datetime NOT NULL;

UPDATE `#__privacy_requests` SET `confirm_token_created_at` = NULL WHERE `confirm_token_created_at` = '0000-00-00 00:00:00';
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
ALTER TABLE `#__users` MODIFY `registerDate` datetime NOT NULL;
ALTER TABLE `#__users` MODIFY `lastvisitDate` datetime NOT NULL;

ALTER TABLE `#__users` MODIFY `lastResetTime` datetime NULL DEFAULT NULL;

ALTER TABLE `#__user_notes` MODIFY `created_time` datetime NOT NULL;
ALTER TABLE `#__user_notes` MODIFY `modified_time` datetime NOT NULL;

ALTER TABLE `#__user_notes` MODIFY `review_time` datetime NULL DEFAULT NULL;
ALTER TABLE `#__user_notes` MODIFY `publish_up` datetime NULL DEFAULT NULL;
ALTER TABLE `#__user_notes` MODIFY `publish_down` datetime NULL DEFAULT NULL;
ALTER TABLE `#__user_notes` MODIFY `checked_out_time` datetime NULL DEFAULT NULL;

UPDATE `#__users` SET `lastvisitDate` = `registerDate` WHERE `lastvisitDate` = '0000-00-00 00:00:00';

UPDATE `#__users` SET `lastResetTime` = NULL WHERE `lastResetTime` = '0000-00-00 00:00:00';

UPDATE `#__user_notes` SET `modified_time` = `created_time` WHERE `modified_time` = '0000-00-00 00:00:00';

UPDATE `#__user_notes` SET `review_time` = NULL WHERE `review_time` = '0000-00-00 00:00:00';
UPDATE `#__user_notes` SET `publish_up` = NULL WHERE `publish_up` = '0000-00-00 00:00:00';
UPDATE `#__user_notes` SET `publish_down` = NULL WHERE `publish_down` = '0000-00-00 00:00:00';
UPDATE `#__user_notes` 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_users.user'
AND `core_modified_time` = '0000-00-00 00:00:00';

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

UPDATE `#__ucm_content` SET `core_publish_up` = NULL
WHERE `core_type_alias` = 'com_users.note'
AND `core_publish_up` = '0000-00-00 00:00:00';
UPDATE `#__ucm_content` SET `core_publish_down` = NULL
WHERE `core_type_alias` = 'com_users.note'
AND `core_publish_down` = '0000-00-00 00:00:00';
UPDATE `#__ucm_content` SET `core_checked_out_time` = NULL
WHERE `core_type_alias` = 'com_users.note'
AND `core_checked_out_time` = '0000-00-00 00:00:00';
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ALTER TABLE "#__privacy_requests" ALTER COLUMN "requested_at" DROP DEFAULT;

ALTER TABLE "#__privacy_requests" ALTER COLUMN "confirm_token_created_at" DROP NOT NULL;
ALTER TABLE "#__privacy_requests" ALTER COLUMN "confirm_token_created_at" DROP DEFAULT;

ALTER TABLE "#__privacy_consents" ALTER COLUMN "created" DROP DEFAULT;

UPDATE "#__privacy_requests" SET "confirm_token_created_at" = NULL WHERE "confirm_token_created_at" = '1970-01-01 00:00:00';
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
ALTER TABLE "#__users" ALTER COLUMN "registerDate" DROP DEFAULT;
ALTER TABLE "#__users" ALTER COLUMN "lastvisitDate" DROP DEFAULT;

ALTER TABLE "#__users" ALTER COLUMN "lastResetTime" DROP NOT NULL;
ALTER TABLE "#__users" ALTER COLUMN "lastResetTime" DROP DEFAULT;

ALTER TABLE "#__user_notes" ALTER COLUMN "created_time" DROP DEFAULT;

ALTER TABLE "#__user_notes" ALTER COLUMN "modified_time" DROP DEFAULT;

ALTER TABLE "#__user_notes" ALTER COLUMN "review_time" DROP NOT NULL;
ALTER TABLE "#__user_notes" ALTER COLUMN "review_time" DROP DEFAULT;

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

ALTER TABLE "#__user_notes" ALTER COLUMN "publish_down" DROP NOT NULL;
ALTER TABLE "#__user_notes" ALTER COLUMN "publish_down" DROP DEFAULT;

ALTER TABLE "#__user_notes" ALTER COLUMN "checked_out_time" DROP NOT NULL;
ALTER TABLE "#__user_notes" ALTER COLUMN "checked_out_time" DROP DEFAULT;

UPDATE "#__users" SET "lastvisitDate" = "registerDate" WHERE "lastvisitDate" = '1970-01-01 00:00:00';

UPDATE "#__users" SET "lastResetTime" = NULL WHERE "lastResetTime" = '1970-01-01 00:00:00';

UPDATE "#__user_notes" SET "modified_time" = "created_time" WHERE "modified_time" = '1970-01-01 00:00:00';

UPDATE "#__user_notes" SET "review_time" = NULL WHERE "review_time" = '1970-01-01 00:00:00';
UPDATE "#__user_notes" SET "publish_up" = NULL WHERE "publish_up" = '1970-01-01 00:00:00';
UPDATE "#__user_notes" SET "publish_down" = NULL WHERE "publish_down" = '1970-01-01 00:00:00';
UPDATE "#__user_notes" 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_users.user'
AND "core_modified_time" = '1970-01-01 00:00:00';

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

UPDATE "#__ucm_content" SET "core_publish_up" = NULL
WHERE "core_type_alias" = 'com_users.note'
AND "core_publish_up" = '1970-01-01 00:00:00';
UPDATE "#__ucm_content" SET "core_publish_down" = NULL
WHERE "core_type_alias" = 'com_users.note'
AND "core_publish_down" = '1970-01-01 00:00:00';
UPDATE "#__ucm_content" SET "core_checked_out_time" = NULL
WHERE "core_type_alias" = 'com_users.note'
AND "core_checked_out_time" = '1970-01-01 00:00:00';
6 changes: 2 additions & 4 deletions administrator/components/com_checkin/Model/CheckinModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ protected function populateState($ordering = 'table', $direction = 'asc')
public function checkin($ids = array())
{
$db = $this->getDbo();
$nullDate = $db->getNullDate();

if (!is_array($ids))
{
Expand Down Expand Up @@ -111,9 +110,8 @@ public function checkin($ids = array())
$query = $db->getQuery(true)
->update($db->quoteName($tn))
->set($db->quoteName('checked_out') . ' = DEFAULT')
->set($db->quoteName('checked_out_time') . ' = :checkouttime')
->where($db->quoteName('checked_out') . ' > 0')
->bind(':checkouttime', $nullDate);
->set($db->quoteName('checked_out_time') . ' = NULL')
->where($db->quoteName('checked_out') . ' > 0');

$db->setQuery($query);

Expand Down
15 changes: 14 additions & 1 deletion administrator/components/com_privacy/Table/RequestTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@
*/
class RequestTable extends Table
{
/**
* Indicates that columns fully support the NULL value in the database
*
* @var boolean
* @since __DEPLOY_VERSION__
*/
protected $_supportNullValue = true;

/**
* The class constructor.
*
Expand All @@ -51,7 +59,7 @@ public function __construct(DatabaseDriver $db)
*
* @since 3.9.0
*/
public function store($updateNulls = false)
public function store($updateNulls = true)
{
$date = Factory::getDate();

Expand All @@ -67,6 +75,11 @@ public function store($updateNulls = false)
{
$this->requested_at = $date->toSql();
}

if (!$this->confirm_token_created_at)
{
$this->confirm_token_created_at = null;
}
}

return parent::store($updateNulls);
Expand Down
22 changes: 13 additions & 9 deletions administrator/components/com_users/Model/UsersModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -371,15 +371,19 @@ protected function getListQuery()
}
}

// Add filter for registration ranges select list
// Add filter for registration time ranges select list
$range = $this->getState('filter.range');

// Apply the range filter.
if ($range)
{
$dates = $this->buildDateRange($range);

if ($dates['dNow'] === false)
if ($dates['dStart'] === false)
{
$query->where('1 = 0');
}
elseif ($dates['dNow'] === false)
{
$query->where(
$db->quoteName('a.registerDate') . ' < ' . $db->quote($dates['dStart']->format('Y-m-d H:i:s'))
Expand All @@ -394,7 +398,7 @@ protected function getListQuery()
}
}

// Add filter for registration ranges select list
// Add filter for last visit time ranges select list
$lastvisitrange = $this->getState('filter.lastvisitrange');

// Apply the range filter.
Expand All @@ -408,17 +412,17 @@ protected function getListQuery()
$db->quoteName('a.lastvisitDate') . ' = ' . $db->quote($dates['dStart'])
);
}
elseif ($dates['dNow'] === false)
elseif ($dates['dNow'] !== false && $dates['dStart'] !== false)
{
$query->where(
$db->quoteName('a.lastvisitDate') . ' < ' . $db->quote($dates['dStart']->format('Y-m-d H:i:s'))
$db->quoteName('a.lastvisitDate') . ' >= ' . $db->quote($dates['dStart']->format('Y-m-d H:i:s')) .
' AND ' . $db->quoteName('a.lastvisitDate') . ' <= ' . $db->quote($dates['dNow']->format('Y-m-d H:i:s'))
);
}
else
elseif ($dates['dStart'] !== false)
{
$query->where(
$db->quoteName('a.lastvisitDate') . ' >= ' . $db->quote($dates['dStart']->format('Y-m-d H:i:s')) .
' AND ' . $db->quoteName('a.lastvisitDate') . ' <= ' . $db->quote($dates['dNow']->format('Y-m-d H:i:s'))
$db->quoteName('a.lastvisitDate') . ' < ' . $db->quote($dates['dStart']->format('Y-m-d H:i:s'))
);
}
}
Expand Down Expand Up @@ -495,7 +499,7 @@ private function buildDateRange($range)
break;
case 'never':
$dNow = false;
$dStart = $this->_db->getNullDate();
$dStart = false;
break;
}

Expand Down
18 changes: 13 additions & 5 deletions administrator/components/com_users/Table/NoteTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
*/
class NoteTable extends Table
{
/**
* Indicates that columns fully support the NULL value in the database
*
* @var boolean
* @since __DEPLOY_VERSION__
*/
protected $_supportNullValue = true;

/**
* Constructor
*
Expand All @@ -46,15 +54,14 @@ public function __construct(DatabaseDriver $db)
*
* @since 2.5
*/
public function store($updateNulls = false)
public function store($updateNulls = true)
{
$date = Factory::getDate()->toSql();
$userId = Factory::getUser()->get('id');

if (!((int) $this->review_time))
{
// Null date.
$this->review_time = $this->getDbo()->getNullDate();
$this->review_time = null;
}

if ($this->id)
Expand All @@ -66,8 +73,9 @@ public function store($updateNulls = false)
else
{
// New record.
$this->created_time = $date;
$this->created_time = $date;
$this->created_user_id = $userId;
$this->modified_time = $date;
}

// Attempt to store the data.
Expand Down Expand Up @@ -96,7 +104,7 @@ public function check()

if (empty($this->modified_time))
{
$this->modified_time = $this->getDbo()->getNullDate();
$this->modified_time = $this->created_time;
}

return true;
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_users/tmpl/notes/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
<?php echo $this->escape($item->user_name); ?>
</td>
<td class="d-none d-md-table-cell">
<?php if ($item->review_time !== Factory::getDbo()->getNullDate()) : ?>
<?php if (!is_null($item->review_time)) : ?>
<?php echo HTMLHelper::_('date', $item->review_time, Text::_('DATE_FORMAT_LC4')); ?>
<?php else : ?>
<?php echo Text::_('COM_USERS_EMPTY_REVIEW'); ?>
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_users/tmpl/users/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
<?php echo PunycodeHelper::emailToUTF8($this->escape($item->email)); ?>
</td>
<td class="d-none d-xl-table-cell">
<?php if ($item->lastvisitDate != $this->db->getNullDate()) : ?>
<?php if ($item->lastvisitDate !== $item->registerDate) : ?>
<?php echo HTMLHelper::_('date', $item->lastvisitDate, Text::_('DATE_FORMAT_LC6')); ?>
<?php else : ?>
<?php echo Text::_('JNEVER'); ?>
Expand Down
3 changes: 2 additions & 1 deletion components/com_privacy/Model/ConfirmModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function confirmRequest($data)
}

// A request can only be confirmed if it is in a pending status and has a confirmation token
if ($table->status != '0' || !$table->confirm_token)
if ($table->status != '0' || !$table->confirm_token || $table->confirm_token_created_at === null)
{
$this->setError(Text::_('COM_PRIVACY_ERROR_NO_PENDING_REQUESTS'));

Expand All @@ -104,6 +104,7 @@ public function confirmRequest($data)
// Invalidate the request
$table->status = -1;
$table->confirm_token = '';
$table->confirm_token_created_at = null;

try
{
Expand Down
2 changes: 1 addition & 1 deletion components/com_users/Model/RegistrationModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function getUserIdFromToken($token)
->from($db->quoteName('#__users'))
->where($db->quoteName('activation') . ' = ' . $db->quote($token))
->where($db->quoteName('block') . ' = ' . 1)
->where($db->quoteName('lastvisitDate') . ' = ' . $db->quote($db->getNullDate()));
->where($db->quoteName('lastvisitDate') . ' = ' . $db->quoteName('registerDate'));
$db->setQuery($query);

try
Expand Down
2 changes: 1 addition & 1 deletion components/com_users/tmpl/profile/default_core.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<dt>
<?php echo Text::_('COM_USERS_PROFILE_LAST_VISITED_DATE_LABEL'); ?>
</dt>
<?php if ($this->data->lastvisitDate != $this->db->getNullDate()) : ?>
<?php if ($this->data->lastvisitDate != $this->data->registerDate) : ?>
<dd>
<?php echo HTMLHelper::_('date', $this->data->lastvisitDate, Text::_('DATE_FORMAT_LC1')); ?>
</dd>
Expand Down
22 changes: 11 additions & 11 deletions installation/sql/mysql/joomla.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1652,11 +1652,11 @@ SELECT extension_id, 'PLG_SYSTEM_HTTPHEADERS_POSTINSTALL_INTRODUCTION_TITLE', 'P
CREATE TABLE IF NOT EXISTS `#__privacy_requests` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`email` varchar(100) NOT NULL DEFAULT '',
`requested_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`requested_at` datetime NOT NULL,
`status` tinyint(4) NOT NULL DEFAULT 0,
`request_type` varchar(25) NOT NULL DEFAULT '',
`confirm_token` varchar(100) NOT NULL DEFAULT '',
`confirm_token_created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`confirm_token_created_at` datetime,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

Expand Down Expand Up @@ -2051,11 +2051,11 @@ CREATE TABLE IF NOT EXISTS `#__users` (
`password` varchar(100) NOT NULL DEFAULT '',
`block` tinyint(4) NOT NULL DEFAULT 0,
`sendEmail` tinyint(4) DEFAULT 0,
`registerDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`lastvisitDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`registerDate` datetime NOT NULL,
`lastvisitDate` datetime NOT NULL,
`activation` varchar(100) NOT NULL DEFAULT '',
`params` text NOT NULL,
`lastResetTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Date of last password reset',
`lastResetTime` datetime COMMENT 'Date of last password reset',
`resetCount` int(11) NOT NULL DEFAULT 0 COMMENT 'Count of password resets since lastResetTime',
`otpKey` varchar(1000) NOT NULL DEFAULT '' COMMENT 'Two factor authentication encrypted keys',
`otep` varchar(1000) NOT NULL DEFAULT '' COMMENT 'One time emergency passwords',
Expand Down Expand Up @@ -2099,14 +2099,14 @@ CREATE TABLE IF NOT EXISTS `#__user_notes` (
`body` text NOT NULL,
`state` tinyint(3) 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',
`checked_out_time` datetime,
`created_user_id` int(10) unsigned NOT NULL DEFAULT 0,
`created_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`created_time` datetime NOT NULL,
`modified_user_id` int(10) unsigned NOT NULL DEFAULT 0,
`modified_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`review_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',
`modified_time` datetime NOT NULL,
`review_time` datetime,
`publish_up` datetime,
`publish_down` datetime,
PRIMARY KEY (`id`),
KEY `idx_user_id` (`user_id`),
KEY `idx_category_id` (`catid`)
Expand Down
Loading