Skip to content
Closed
Show file tree
Hide file tree
Changes from 7 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
@@ -0,0 +1,6 @@
ALTER TABLE `#__privacy_requests` MODIFY `requested_at` datetime NOT NULL;
ALTER TABLE `#__privacy_requests` MODIFY `confirm_token_created_at` datetime NOT NULL;

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

UPDATE `#__privacy_requests` SET `confirm_token_created_at` = `requested_at` WHERE `confirm_token_created_at` = '0000-00-00 00:00:00';
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ALTER TABLE "#__privacy_requests" ALTER COLUMN "requested_at" DROP DEFAULT;
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" = "requested_at" WHERE "confirm_token_created_at" = '1970-01-01 00:00:00';

5 changes: 5 additions & 0 deletions administrator/components/com_privacy/Table/RequestTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ public function store($updateNulls = false)
{
$this->requested_at = $date->toSql();
}

if (!$this->confirm_token_created_at)
{
$this->confirm_token_created_at = $date->toSql();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this in real life? doesn't this need to be nullable until the confirm token is actually created?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. To be honest, I don’t remember right now why I‘ve done it that way. Will check later today or tomorrow and if necessary correct that. Any hint where in code this token is created would be very welcome.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found where the token is set. Will check later what to do here at this place.

}
}

return parent::store($updateNulls);
Expand Down
6 changes: 3 additions & 3 deletions installation/sql/mysql/joomla.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1651,11 +1651,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 NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

Expand All @@ -1669,7 +1669,7 @@ CREATE TABLE IF NOT EXISTS `#__privacy_consents` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(10) unsigned NOT NULL DEFAULT 0,
`state` INT(10) NOT NULL DEFAULT 1,
`created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`created` datetime NOT NULL,
`subject` varchar(255) NOT NULL DEFAULT '',
`body` text NOT NULL,
`remind` tinyint(4) NOT NULL DEFAULT 0,
Expand Down
6 changes: 3 additions & 3 deletions installation/sql/postgresql/joomla.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1656,11 +1656,11 @@ SELECT "extension_id", 'PLG_SYSTEM_HTTPHEADERS_POSTINSTALL_INTRODUCTION_TITLE',
CREATE TABLE "#__privacy_requests" (
"id" serial NOT NULL,
"email" varchar(100) DEFAULT '' NOT NULL,
"requested_at" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL,
"requested_at" timestamp without time zone NOT NULL,
"status" smallint DEFAULT 0 NOT NULL,
"request_type" varchar(25) DEFAULT '' NOT NULL,
"confirm_token" varchar(100) DEFAULT '' NOT NULL,
"confirm_token_created_at" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL,
"confirm_token_created_at" timestamp without time zone NOT NULL,
PRIMARY KEY ("id")
);

Expand All @@ -1672,7 +1672,7 @@ CREATE TABLE "#__privacy_consents" (
"id" serial NOT NULL,
"user_id" bigint DEFAULT 0 NOT NULL,
"state" smallint DEFAULT 1 NOT NULL,
"created" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL,
"created" timestamp without time zone NOT NULL,
"subject" varchar(255) DEFAULT '' NOT NULL,
"body" text NOT NULL,
"remind" smallint DEFAULT 0 NOT NULL,
Expand Down