diff --git a/.appveyor.yml b/.appveyor.yml
index ba159debdd42d..87f9dae4c0180 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -15,12 +15,14 @@ environment:
matrix:
- php_ver_target: 7.2
DLLVersion: "5.3.0"
+ WINCACHE: "2.0.0.8"
- php_ver_target: 7.3
+ WINCACHE: "2.0.0.8"
init:
- SET PATH=C:\Program Files\OpenSSL;C:\tools\php;%PATH%
- SET COMPOSER_NO_INTERACTION=1
- - SET PHP=1 # This var relates to caching the php install
+ - SET PHP=1 # This var relates to caching the php install
- SET ANSICON=121x90 (121x90)
services:
- mssql2014
@@ -52,10 +54,11 @@ install:
$source = "https://windows.php.net/downloads/pecl/releases/pdo_sqlsrv/$($env:DLLVersion)/php_pdo_sqlsrv-$($env:DLLVersion)-$($env:php_ver_target)-nts-$($env:VC)-$($env:PHPBuild).zip"
$destination = "c:\tools\php\ext\php_pdo_sqlsrv-$($env:DLLVersion)-$($env:php_ver_target)-nts-$($env:VC)-$($env:PHPBuild).zip"
Invoke-WebRequest $source -OutFile $destination
- #appveyor-retry appveyor DownloadFile http://windows.php.net/downloads/pecl/releases/pdo_sqlsrv/$($env:DLLVersion)/php_pdo_sqlsrv-$($env:DLLVersion)-$($env:php_ver_target)-nts-$($env:VC)-$($env:PHPBuild).zip
+ #appveyor-retry appveyor DownloadFile https://windows.php.net/downloads/pecl/releases/pdo_sqlsrv/$($env:DLLVersion)/php_pdo_sqlsrv-$($env:DLLVersion)-$($env:php_ver_target)-nts-$($env:VC)-$($env:PHPBuild).zip
7z x -y php_pdo_sqlsrv-$($env:DLLVersion)-$($env:php_ver_target)-nts-$($env:VC)-$($env:PHPBuild).zip > $null
Remove-Item c:\tools\php\ext* -include .zip
- cd c:\tools\php}
+ cd c:\tools\php
+ }
- IF %PHP%==1 copy php.ini-production php.ini /Y
- IF %PHP%==1 echo date.timezone="UTC" >> php.ini
- IF %PHP%==1 echo extension_dir=ext >> php.ini
@@ -80,18 +83,19 @@ install:
- IF %PHP%==1 echo extension=php_curl.dll >> php.ini
# Get the Wincache DLLs
- ps: >-
- If ($env:PHP -eq "1") {
- $wincache = "2.0.0.8"
+ If ($env:PHP -eq "1" -and $env:WINCACHE) {
cd c:\tools\php\ext
- $source = "http://windows.php.net/downloads/pecl/releases/wincache/$($wincache)/php_wincache-$($wincache)-$($env:php_ver_target)-nts-$($env:VC)-$($env:PHPBuild).zip"
- $destination = "c:\tools\php\ext\php_wincache-$($wincache)-$($env:php_ver_target)-nts-$($env:VC)-$($env:PHPBuild).zip"
+ $source = "https://windows.php.net/downloads/pecl/releases/wincache/$($env:WINCACHE)/php_wincache-$($env:WINCACHE)-$($env:php_ver_target)-nts-$($env:VC)-$($env:PHPBuild).zip"
+ $destination = "c:\tools\php\ext\php_wincache-$($env:WINCACHE)-$($env:php_ver_target)-nts-$($env:VC)-$($env:PHPBuild).zip"
Invoke-WebRequest $source -OutFile $destination
- #appveyor-retry appveyor DownloadFile http://windows.php.net/downloads/pecl/releases/wincache/$($wincache)/php_wincache-$($wincache)-$($env:php_ver_target)-nts-$($env:VC)-$($env:PHPBuild).zip
- 7z x -y php_wincache-$($wincache)-$($env:php_ver_target)-nts-$($env:VC)-$($env:PHPBuild).zip > $null
+ #appveyor-retry appveyor DownloadFile https://windows.php.net/downloads/pecl/releases/wincache/$($env:WINCACHE)/php_wincache-$($env:WINCACHE)-$($env:php_ver_target)-nts-$($env:VC)-$($env:PHPBuild).zip
+ 7z x -y php_wincache-$($env:WINCACHE)-$($env:php_ver_target)-nts-$($env:VC)-$($env:PHPBuild).zip > $null
Remove-Item C:\tools\php\ext* -include .zip
- cd c:\tools\php}
- - IF %PHP%==1 echo extension=php_wincache.dll >> php.ini
- - IF %PHP%==1 echo wincache.enablecli = 1 >> php.ini
+ cd c:\tools\php
+ Add-Content php.ini "`nextension=php_wincache.dll"
+ Add-Content php.ini "`wincache.enablecli = 1"
+ Add-Content php.ini "`n"
+ }
- IF %PHP%==1 echo zend_extension=php_opcache.dll >> php.ini
- IF %PHP%==1 echo opcache.enable_cli=1 >> php.ini
- IF %PHP%==1 echo extension=php_ldap.dll >> php.ini
diff --git a/.drone.yml b/.drone.yml
index 4b7343060d3f1..3325ab50fc724 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -40,6 +40,34 @@ steps:
commands:
- npm ci --unsafe-perm
+ - name: publish-diff
+ image: joomlaprojects/docker-images:patchtester
+ depends_on: [ npm ]
+ environment:
+ CMP_ARCHIVE_NAME: "build"
+ CMP_MASTER_FOLDER: "/reference"
+ CMP_SLAVE_FOLDER: "." # The directory the current repo is in
+ FTP_USERNAME:
+ from_secret: ftpusername
+ FTP_PASSWORD:
+ from_secret: ftppassword
+ FTP_HOSTNAME: ci.joomla.org
+ FTP_PORT: "21"
+ FTP_DEST_DIR: /artifacts
+ FTP_VERIFY: "false"
+ FTP_SECURE: "true"
+ BRANCH_NAME: "4.0-dev" # Current branch to check against (from repo joomla/joomla-cms)
+ DRONE_PULL_REQUEST: DRONE_PULL_REQUEST
+ commands:
+ - export PULL_ID=$DRONE_PULL_REQUEST
+ - /bin/compare.sh
+ volumes:
+ - name: reference
+ path: /reference
+ when:
+ branch:
+ - 4.0-dev
+
- name: rebuild-cache
image: drillster/drone-volume-cache
depends_on: [ npm ]
@@ -56,21 +84,21 @@ steps:
- name: php72-unit
depends_on: [ phpcs ]
- image: php:7.2
+ image: joomlaprojects/docker-images:php7.2
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Unit
- name: php73-unit
depends_on: [ phpcs ]
- image: php:7.3
+ image: joomlaprojects/docker-images:php7.3
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Unit
- name: php74-unit
depends_on: [ phpcs ]
- image: phpdaily/php:7.4-dev
+ image: joomlaprojects/docker-images:php7.4
failure: ignore
commands:
- php -v
@@ -78,7 +106,7 @@ steps:
- name: php80-unit
depends_on: [ phpcs ]
- image: phpdaily/php:8.0-dev
+ image: joomlaprojects/docker-images:php8.0
failure: ignore
commands:
- php -v
@@ -197,7 +225,7 @@ steps:
PLUGIN_SECURE: false
PLUGIN_EXCLUDE: ^\.git/$
commands:
- - export PLUGIN_DEST_DIR=$PLUGIN_DEST_DIR/$DRONE_REPO/$DRONE_BRANCH/$DRONE_PULL_REQUEST_$DRONE_BUILD_NUMBER/system-tests
+ - export PLUGIN_DEST_DIR=$PLUGIN_DEST_DIR/$DRONE_REPO/$DRONE_BRANCH/$DRONE_PULL_REQUEST/system-tests/$DRONE_BUILD_NUMBER
- echo https://ci.joomla.org:444$PLUGIN_DEST_DIR
- /bin/upload.sh
when:
@@ -234,6 +262,9 @@ volumes:
- name: cache
host:
path: /tmp/cache
+- name: reference
+ host:
+ path: /tmp/reference
services:
- name: mysql
@@ -270,6 +301,6 @@ services:
---
kind: signature
-hmac: af5f0783363fae3f8876585fff87e08dd470ee9a81599f20e4c0e8d2d0836801
+hmac: f17f253b02d7a16535d706a31f99d678dcdc595d5bc2ca1e8c2889c3eae2a51b
...
diff --git a/.editorconfig b/.editorconfig
index 287896868eaa4..59d8eec2608ae 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -10,3 +10,7 @@ end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
+
+[*.{js,scss,css}]
+indent_style = space
+indent_size = 2
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
new file mode 100644
index 0000000000000..0be9be57ae051
--- /dev/null
+++ b/.github/FUNDING.yml
@@ -0,0 +1 @@
+custom: https://community.joomla.org/sponsorship-campaigns.html
diff --git a/SECURITY.md b/.github/SECURITY.md
similarity index 87%
rename from SECURITY.md
rename to .github/SECURITY.md
index 449c2a5978fdd..52af74f0b6c0a 100644
--- a/SECURITY.md
+++ b/.github/SECURITY.md
@@ -9,9 +9,7 @@ This document outlines security procedures and policies for the `Joomla! Project
## Reporting a Bug
-The `Joomla` team and community take all security bugs in `Joomla` seriously.
-
-The Joomla! Project takes security vulnerabilities very seriously. As such, the Joomla! Security Strike Team (JSST) oversees the project's security issues and follows some specific procedures when dealing with these issues.
+The `Joomla` team and community take all security bugs in `Joomla` seriously. The Joomla! Security Strike Team (JSST) oversees the project's security issues and follows some specific procedures when dealing with these issues.
If you find a possible vulnerability, please report it to the JSST using the [online form](https://developer.joomla.org/security/contact-the-team.html) or via email at security@joomla.org
@@ -25,7 +23,7 @@ Thank you for improving the security of `Joomla`.
## Response Handling
-The JSST aims to ensure all issues are handled in a timely manner and for clear communication between the team and issue reporters. As such, we have established the following guidelines for responding to issue reports:
+The JSST aims to ensure all issues are handled in a timely manner and for clear communication between the team and issue reporters. We have established the following guidelines for responding to issue reports:
* Within 24 hours every report gets acknowledged
* Within 7 days every report gets a further response stating either
diff --git a/administrator/components/com_actionlogs/Field/LogcreatorField.php b/administrator/components/com_actionlogs/Field/LogcreatorField.php
index 28ff4cb68da0b..133e1ece5080a 100644
--- a/administrator/components/com_actionlogs/Field/LogcreatorField.php
+++ b/administrator/components/com_actionlogs/Field/LogcreatorField.php
@@ -58,12 +58,12 @@ protected function getOptions()
// Construct the query
$query = $db->getQuery(true)
->select($db->quoteName('u.id', 'value'))
- ->select($db->quoteName('u.name', 'text'))
+ ->select($db->quoteName('u.username', 'text'))
->from($db->quoteName('#__users', 'u'))
->join('INNER', $db->quoteName('#__action_logs', 'c') . ' ON ' . $db->quoteName('c.user_id') . ' = ' . $db->quoteName('u.id'))
->group($db->quoteName('u.id'))
- ->group($db->quoteName('u.name'))
- ->order($db->quoteName('u.name'));
+ ->group($db->quoteName('u.username'))
+ ->order($db->quoteName('u.username'));
// Setup the query
$db->setQuery($query);
diff --git a/administrator/components/com_actionlogs/Helper/ActionlogsHelper.php b/administrator/components/com_actionlogs/Helper/ActionlogsHelper.php
index dfa7388bc795b..eaa35bde142dc 100644
--- a/administrator/components/com_actionlogs/Helper/ActionlogsHelper.php
+++ b/administrator/components/com_actionlogs/Helper/ActionlogsHelper.php
@@ -26,6 +26,14 @@
*/
class ActionlogsHelper
{
+ /**
+ * Array of characters starting a formula
+ *
+ * @var array
+ * @since 3.9.7
+ */
+ private static $characters = array('=', '+', '-', '@');
+
/**
* Method to convert logs objects array to an iterable type for use with a CSV export
*
@@ -49,6 +57,8 @@ public static function getCsvData($data): Generator
);
}
+ $disabledText = Text::_('COM_ACTIONLOGS_DISABLED');
+
// Header row
yield ['Id', 'Message', 'Date', 'Extension', 'User', 'Ip'];
@@ -58,14 +68,14 @@ public static function getCsvData($data): Generator
static::loadTranslationFiles($extension);
- yield [
+ yield array(
'id' => $log->id,
- 'message' => strip_tags(static::getHumanReadableLogMessage($log, false)),
+ 'message' => self::escapeCsvFormula(strip_tags(static::getHumanReadableLogMessage($log, false))),
'date' => (new Date($log->log_date, new \DateTimeZone('UTC')))->format('Y-m-d H:i:s T'),
- 'extension' => Text::_($extension),
- 'name' => $log->name,
- 'ip_address' => Text::_($log->ip_address),
- ];
+ 'extension' => self::escapeCsvFormula(Text::_($extension)),
+ 'name' => self::escapeCsvFormula($log->name),
+ 'ip_address' => self::escapeCsvFormula($log->ip_address === 'COM_ACTIONLOGS_DISABLED' ? $disabledText : $log->ip_address)
+ );
}
}
@@ -196,7 +206,7 @@ public static function getHumanReadableLogMessage($log, $generateLinks = true)
$messageData['type'] = Text::_($messageData['type']);
}
- $linkMode = Factory::getApplication()->get('force_ssl', 0) >= 1 ? 1 : -1;
+ $linkMode = Factory::getApplication()->get('force_ssl', 0) >= 1 ? Route::TLS_FORCE : Route::TLS_IGNORE;
foreach ($messageData as $key => $value)
{
@@ -330,4 +340,28 @@ public static function loadActionLogPluginsLanguage()
// Load com_privacy too.
$lang->load('com_privacy', JPATH_ADMINISTRATOR, null, false, true);
}
+
+ /**
+ * Escapes potential characters that start a formula in a CSV value to prevent injection attacks
+ *
+ * @param mixed $value csv field value
+ *
+ * @return mixed
+ *
+ * @since 3.9.7
+ */
+ protected static function escapeCsvFormula($value)
+ {
+ if ($value == '')
+ {
+ return $value;
+ }
+
+ if (in_array($value[0], self::$characters, true))
+ {
+ $value = ' ' . $value;
+ }
+
+ return $value;
+ }
}
diff --git a/administrator/components/com_actionlogs/Model/ActionlogsModel.php b/administrator/components/com_actionlogs/Model/ActionlogsModel.php
index 563882a8771e2..4b2a9b504fbd8 100644
--- a/administrator/components/com_actionlogs/Model/ActionlogsModel.php
+++ b/administrator/components/com_actionlogs/Model/ActionlogsModel.php
@@ -426,7 +426,7 @@ public function getFilterForm($data = array(), $loadData = true)
// Add ip sort options to sort dropdown
if ($form && $ipLogging)
{
- /* @var JFormFieldList $field */
+ /* @var \Joomla\CMS\Form\Field\ListField $field */
$field = $form->getField('fullordering', 'list');
$field->addOption(Text::_('COM_ACTIONLOGS_IP_ADDRESS_ASC'), array('value' => 'a.ip_address ASC'));
$field->addOption(Text::_('COM_ACTIONLOGS_IP_ADDRESS_DESC'), array('value' => 'a.ip_address DESC'));
diff --git a/administrator/components/com_actionlogs/View/Actionlogs/HtmlView.php b/administrator/components/com_actionlogs/View/Actionlogs/HtmlView.php
index dd42b5e14f53c..0e9385a365301 100644
--- a/administrator/components/com_actionlogs/View/Actionlogs/HtmlView.php
+++ b/administrator/components/com_actionlogs/View/Actionlogs/HtmlView.php
@@ -101,7 +101,7 @@ public function display($tpl = null)
$params = ComponentHelper::getParams('com_actionlogs');
$this->showIpColumn = (bool) $params->get('ip_logging', 0);
- if (count($errors = $this->get('Errors')))
+ if (count($errors = $model->getErrors()))
{
throw new GenericDataException(implode("\n", $errors), 500);
}
diff --git a/administrator/components/com_actionlogs/tmpl/actionlogs/default.php b/administrator/components/com_actionlogs/tmpl/actionlogs/default.php
index 9679d1023061a..5d582634cc903 100644
--- a/administrator/components/com_actionlogs/tmpl/actionlogs/default.php
+++ b/administrator/components/com_actionlogs/tmpl/actionlogs/default.php
@@ -9,7 +9,6 @@
defined('_JEXEC') or die;
-use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
@@ -22,13 +21,13 @@
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
-Factory::getDocument()->addScriptDeclaration('
+$this->document->addScriptDeclaration('
Joomla.submitbutton = function(task)
{
if (task == "actionlogs.exportLogs")
{
Joomla.submitform(task, document.getElementById("exportForm"));
-
+
return;
}
@@ -71,24 +70,24 @@
|
-
+ |
|
-
+ |
|
-
+ |
|
-
+ |
|
showIpColumn) : ?>
-
+ |
|
-
+ |
|
@@ -101,27 +100,27 @@
id); ?>
|
-
+ |
|
-
+ |
escape(Text::_($extension)); ?>
|
-
+ |
log_date); ?>
log_date, Text::_('DATE_FORMAT_LC6')); ?>
|
-
+ |
name; ?>
|
showIpColumn) : ?>
-
+ |
escape($item->ip_address)); ?>
|
-
+ |
id; ?>
|
diff --git a/administrator/components/com_admin/Model/SysinfoModel.php b/administrator/components/com_admin/Model/SysinfoModel.php
index e699a022a9e10..0bba09c258748 100644
--- a/administrator/components/com_admin/Model/SysinfoModel.php
+++ b/administrator/components/com_admin/Model/SysinfoModel.php
@@ -530,7 +530,7 @@ public function getDirectory($public = false)
foreach ($admin_langs as $folder)
{
- if (!$folder->isDir() || $folder->isDot())
+ if ($folder->isDot() || !$folder->isDir())
{
continue;
}
@@ -546,7 +546,7 @@ public function getDirectory($public = false)
foreach ($manifests as $folder)
{
- if (!$folder->isDir() || $folder->isDot())
+ if ($folder->isDot() || !$folder->isDir())
{
continue;
}
@@ -569,7 +569,7 @@ public function getDirectory($public = false)
foreach ($image_folders as $folder)
{
- if (!$folder->isDir() || $folder->isDot())
+ if ($folder->isDot() || !$folder->isDir())
{
continue;
}
@@ -587,7 +587,7 @@ public function getDirectory($public = false)
foreach ($site_langs as $folder)
{
- if (!$folder->isDir() || $folder->isDot())
+ if ($folder->isDot() || !$folder->isDir())
{
continue;
}
@@ -605,7 +605,7 @@ public function getDirectory($public = false)
foreach ($plugin_groups as $folder)
{
- if (!$folder->isDir() || $folder->isDot())
+ if ($folder->isDot() || !$folder->isDir())
{
continue;
}
diff --git a/administrator/components/com_admin/script.php b/administrator/components/com_admin/script.php
index eac43e8fe4a1c..979dd0e0f6187 100644
--- a/administrator/components/com_admin/script.php
+++ b/administrator/components/com_admin/script.php
@@ -784,6 +784,7 @@ public function deleteUnexistingFiles()
'/administrator/components/com_contact/models/forms/fields/mail.xml',
'/administrator/components/com_contact/models/forms/filter_contacts.xml',
'/administrator/components/com_contact/tables/contact.php',
+ '/administrator/components/com_contact/tmpl/contacts/default_batch.php',
'/administrator/components/com_contact/views/contact/tmpl/edit.php',
'/administrator/components/com_contact/views/contact/tmpl/edit_associations.php',
'/administrator/components/com_contact/views/contact/tmpl/edit_metadata.php',
@@ -1502,8 +1503,6 @@ public function deleteUnexistingFiles()
'/administrator/language/en-GB/en-GB.com_search.sys.ini',
'/administrator/language/en-GB/en-GB.com_weblinks.ini',
'/administrator/language/en-GB/en-GB.com_weblinks.sys.ini',
- '/administrator/language/en-GB/en-GB.mod_submenu.ini',
- '/administrator/language/en-GB/en-GB.mod_submenu.sys.ini',
'/administrator/language/en-GB/en-GB.plg_authentication_gmail.ini',
'/administrator/language/en-GB/en-GB.plg_authentication_gmail.sys.ini',
'/administrator/language/en-GB/en-GB.plg_finder_weblinks.ini',
@@ -1540,9 +1539,9 @@ public function deleteUnexistingFiles()
'/administrator/modules/mod_quickicon/mod_quickicon.php',
'/administrator/modules/mod_sampledata/helper.php',
'/administrator/modules/mod_stats_admin/helper.php',
- '/administrator/modules/mod_submenu/mod_submenu.php',
- '/administrator/modules/mod_submenu/mod_submenu.xml',
- '/administrator/modules/mod_submenu/tmpl/default.php',
+ '/administrator/modules/mod_status/mod_status.php',
+ '/administrator/modules/mod_status/mod_status.xml',
+ '/administrator/modules/mod_status/tmpl/default.php',
'/administrator/modules/mod_version/helper.php',
'/administrator/modules/mod_version/language/en-GB/en-GB.mod_version.ini',
'/administrator/modules/mod_version/language/en-GB/en-GB.mod_version.sys.ini',
@@ -4952,8 +4951,8 @@ public function deleteUnexistingFiles()
'/administrator/components/com_users/views/user/tmpl',
'/administrator/components/com_users/views/users',
'/administrator/components/com_users/views/users/tmpl',
- '/administrator/modules/mod_submenu',
- '/administrator/modules/mod_submenu/tmpl',
+ '/administrator/modules/mod_status',
+ '/administrator/modules/mod_status/tmpl',
'/administrator/modules/mod_version/language',
'/administrator/modules/mod_version/language/en-GB',
'/administrator/templates/hathor',
diff --git a/administrator/components/com_admin/sql/updates/mysql/3.8.0-2017-07-28.sql b/administrator/components/com_admin/sql/updates/mysql/3.8.0-2017-07-28.sql
deleted file mode 100644
index 3ea86df61fc79..0000000000000
--- a/administrator/components/com_admin/sql/updates/mysql/3.8.0-2017-07-28.sql
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE `#__fields_groups` ADD COLUMN `params` TEXT NOT NULL AFTER `ordering`;
diff --git a/administrator/components/com_admin/sql/updates/mysql/3.8.0-2017-07-31.sql b/administrator/components/com_admin/sql/updates/mysql/3.8.0-2017-07-31.sql
deleted file mode 100644
index 08693d56b7c5b..0000000000000
--- a/administrator/components/com_admin/sql/updates/mysql/3.8.0-2017-07-31.sql
+++ /dev/null
@@ -1,5 +0,0 @@
-INSERT INTO `#__extensions`
-(`package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `system_data`, `checked_out`, `checked_out_time`, `ordering`, `state`)
-VALUES
- (0, 'mod_sampledata', 'module', 'mod_sampledata', '', 1, 0, 1, 0, '', '{}', '', '', 0, '0000-00-00 00:00:00', 0, 0),
- (0, 'plg_sampledata_blog', 'plugin', 'blog', 'sampledata', 0, 0, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0);
diff --git a/administrator/components/com_admin/sql/updates/mysql/3.8.2-2017-10-14.sql b/administrator/components/com_admin/sql/updates/mysql/3.8.2-2017-10-14.sql
deleted file mode 100644
index d379ef208d611..0000000000000
--- a/administrator/components/com_admin/sql/updates/mysql/3.8.2-2017-10-14.sql
+++ /dev/null
@@ -1,5 +0,0 @@
---
--- Add index for alias check #__content
---
-
-ALTER TABLE `#__content` ADD INDEX `idx_alias` (`alias`(191));
diff --git a/administrator/components/com_admin/sql/updates/mysql/3.8.4-2018-01-16.sql b/administrator/components/com_admin/sql/updates/mysql/3.8.4-2018-01-16.sql
deleted file mode 100644
index 1d204b7f63f13..0000000000000
--- a/administrator/components/com_admin/sql/updates/mysql/3.8.4-2018-01-16.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-ALTER TABLE `#__user_keys` DROP INDEX `series_2`;
-ALTER TABLE `#__user_keys` DROP INDEX `series_3`;
diff --git a/administrator/components/com_admin/sql/updates/mysql/3.8.8-2018-05-18.sql b/administrator/components/com_admin/sql/updates/mysql/3.8.8-2018-05-18.sql
deleted file mode 100644
index 981549dd05ab5..0000000000000
--- a/administrator/components/com_admin/sql/updates/mysql/3.8.8-2018-05-18.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-INSERT INTO `#__postinstall_messages` (`extension_id`, `title_key`, `description_key`, `action_key`, `language_extension`, `language_client_id`, `type`, `action_file`, `action`, `condition_file`, `condition_method`, `version_introduced`, `enabled`)
-VALUES
-(700, 'COM_CPANEL_MSG_UPDATEDEFAULTSETTINGS_TITLE', 'COM_CPANEL_MSG_UPDATEDEFAULTSETTINGS_BODY', '', 'com_cpanel', 1, 'message', '', '', 'admin://components/com_admin/postinstall/updatedefaultsettings.php', 'admin_postinstall_updatedefaultsettings_condition', '3.8.8', 1);
diff --git a/administrator/components/com_admin/sql/updates/mysql/3.8.9-2018-06-19.sql b/administrator/components/com_admin/sql/updates/mysql/3.8.9-2018-06-19.sql
deleted file mode 100644
index cd46b4624a2ac..0000000000000
--- a/administrator/components/com_admin/sql/updates/mysql/3.8.9-2018-06-19.sql
+++ /dev/null
@@ -1,2 +0,0 @@
--- Enable Sample Data Module.
-UPDATE `#__extensions` SET `enabled` = '1' WHERE `name` = 'mod_sampledata';
diff --git a/administrator/components/com_admin/sql/updates/mysql/3.9.10-2019-07-09.sql b/administrator/components/com_admin/sql/updates/mysql/3.9.10-2019-07-09.sql
new file mode 100644
index 0000000000000..3738ee367d0ac
--- /dev/null
+++ b/administrator/components/com_admin/sql/updates/mysql/3.9.10-2019-07-09.sql
@@ -0,0 +1 @@
+ALTER TABLE `#__template_styles` MODIFY `home` char(7) NOT NULL DEFAULT '0';
diff --git a/administrator/components/com_admin/sql/updates/mysql/3.9.7-2019-04-23.sql b/administrator/components/com_admin/sql/updates/mysql/3.9.7-2019-04-23.sql
new file mode 100644
index 0000000000000..8250cfbcb04e7
--- /dev/null
+++ b/administrator/components/com_admin/sql/updates/mysql/3.9.7-2019-04-23.sql
@@ -0,0 +1 @@
+ALTER TABLE `#__session` ADD INDEX `client_id_guest` (`client_id`, `guest`);
diff --git a/administrator/components/com_admin/sql/updates/mysql/3.9.7-2019-04-26.sql b/administrator/components/com_admin/sql/updates/mysql/3.9.7-2019-04-26.sql
new file mode 100644
index 0000000000000..5a13011beeae1
--- /dev/null
+++ b/administrator/components/com_admin/sql/updates/mysql/3.9.7-2019-04-26.sql
@@ -0,0 +1 @@
+UPDATE `#__content_types` SET `content_history_options` = REPLACE(`content_history_options`, '\"ignoreChanges\":[\"modified_by\", \"modified\", \"checked_out\", \"checked_out_time\", \"version\", \"hits\"]', '\"ignoreChanges\":[\"modified_by\", \"modified\", \"checked_out\", \"checked_out_time\", \"version\", \"hits\", \"ordering\"]');
diff --git a/administrator/components/com_admin/sql/updates/mysql/3.9.7-2019-05-16.sql b/administrator/components/com_admin/sql/updates/mysql/3.9.7-2019-05-16.sql
new file mode 100644
index 0000000000000..e03422239c89e
--- /dev/null
+++ b/administrator/components/com_admin/sql/updates/mysql/3.9.7-2019-05-16.sql
@@ -0,0 +1 @@
+# Query removed, see https://github.com/joomla/joomla-cms/pull/25177
diff --git a/administrator/components/com_admin/sql/updates/mysql/3.9.8-2019-06-11.sql b/administrator/components/com_admin/sql/updates/mysql/3.9.8-2019-06-11.sql
new file mode 100644
index 0000000000000..61d79e585edb8
--- /dev/null
+++ b/administrator/components/com_admin/sql/updates/mysql/3.9.8-2019-06-11.sql
@@ -0,0 +1 @@
+UPDATE #__users SET params = REPLACE(params, '",,"', '","');
\ No newline at end of file
diff --git a/administrator/components/com_admin/sql/updates/mysql/3.9.8-2019-06-15.sql b/administrator/components/com_admin/sql/updates/mysql/3.9.8-2019-06-15.sql
new file mode 100644
index 0000000000000..33df450aa00ca
--- /dev/null
+++ b/administrator/components/com_admin/sql/updates/mysql/3.9.8-2019-06-15.sql
@@ -0,0 +1,4 @@
+ALTER TABLE `#__template_styles` DROP INDEX `idx_home`;
+# Query removed, see https://github.com/joomla/joomla-cms/pull/25484
+ALTER TABLE `#__template_styles` ADD INDEX `idx_client_id` (`client_id`);
+ALTER TABLE `#__template_styles` ADD INDEX `idx_client_id_home` (`client_id`, `home`);
diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-05-15.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-05-15.sql
index d265768211547..7bbedc437e6d4 100644
--- a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-05-15.sql
+++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-05-15.sql
@@ -12,10 +12,12 @@ CREATE TABLE IF NOT EXISTS `#__workflows` (
`default` tinyint(1) NOT NULL DEFAULT 0,
`core` tinyint(1) NOT NULL DEFAULT 0,
`ordering` int(11) NOT NULL DEFAULT 0,
- `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `created` datetime NOT NULL,
`created_by` int(10) NOT NULL DEFAULT 0,
- `modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `modified` datetime NOT NULL,
`modified_by` int(10) NOT NULL DEFAULT 0,
+ `checked_out_time` datetime,
+ `checked_out` int(10) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
KEY `idx_asset_id` (`asset_id`),
KEY `idx_title` (`title`(191)),
@@ -24,15 +26,16 @@ CREATE TABLE IF NOT EXISTS `#__workflows` (
KEY `idx_created` (`created`),
KEY `idx_created_by` (`created_by`),
KEY `idx_modified` (`modified`),
- KEY `idx_modified_by` (`modified_by`)
+ KEY `idx_modified_by` (`modified_by`),
+ KEY `idx_checked_out` (`checked_out`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `#__workflows`
--
-INSERT INTO `#__workflows` (`id`, `asset_id`, `published`, `title`, `description`, `extension`, `default`, `core`, `ordering`, `created`, `created_by`, `modified`, `modified_by`) VALUES
-(1, 0, 1, 'COM_WORKFLOW_DEFAULT_WORKFLOW', '', 'com_content', 1, 1, 1, '0000-00-00 00:00:00', 0, '0000-00-00 00:00:00', 0);
+INSERT INTO `#__workflows` (`id`, `asset_id`, `published`, `title`, `description`, `extension`, `default`, `core`,`ordering`, `created`, `created_by`, `modified`, `modified_by`, `checked_out_time`, `checked_out`) VALUES
+(1, 0, 1, 'COM_WORKFLOW_DEFAULT_WORKFLOW', '', 'com_content', 1, 1, 1, CURRENT_TIMESTAMP(), 0, CURRENT_TIMESTAMP(), 0, NULL, 0);
--
-- Table structure for table `#__workflow_associations`
@@ -63,8 +66,11 @@ CREATE TABLE IF NOT EXISTS `#__workflow_stages` (
`description` text NOT NULL,
`condition` int(10) DEFAULT 0,
`default` tinyint(1) NOT NULL DEFAULT 0,
+ `checked_out_time` datetime,
+ `checked_out` int(10) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
KEY `idx_workflow_id` (`workflow_id`),
+ KEY `idx_checked_out` (`checked_out`),
KEY `idx_title` (`title`(191)),
KEY `idx_asset_id` (`asset_id`),
KEY `idx_default` (`default`)
@@ -74,11 +80,11 @@ CREATE TABLE IF NOT EXISTS `#__workflow_stages` (
-- Dumping data for table `#__workflow_stages`
--
-INSERT INTO `#__workflow_stages` (`id`, `asset_id`, `ordering`, `workflow_id`, `published`, `title`, `description`, `condition`, `default`) VALUES
-(1, 0, 1, 1, 1, 'JUNPUBLISHED', '', 0, 1),
-(2, 0, 2, 1, 1, 'JPUBLISHED', '', 1, 0),
-(3, 0, 3, 1, 1, 'JTRASHED', '', -2, 0),
-(4, 0, 4, 1, 1, 'JARCHIVED', '', 2, 0);
+INSERT INTO `#__workflow_stages` (`id`, `asset_id`, `ordering`, `workflow_id`, `published`, `title`, `description`, `condition`, `default`, `checked_out_time`, `checked_out`) VALUES
+(1, 0, 1, 1, 1, 'JUNPUBLISHED', '', 0, 1, NULL, 0),
+(2, 0, 2, 1, 1, 'JPUBLISHED', '', 1, 0, NULL, 0),
+(3, 0, 3, 1, 1, 'JTRASHED', '', -2, 0, NULL, 0),
+(4, 0, 4, 1, 1, 'JARCHIVED', '', 2, 0, NULL, 0);
--
-- Table structure for table `#__workflow_transitions`
@@ -94,9 +100,12 @@ CREATE TABLE IF NOT EXISTS `#__workflow_transitions` (
`description` text NOT NULL,
`from_stage_id` int(10) NOT NULL,
`to_stage_id` int(10) NOT NULL,
+ `checked_out_time` datetime,
+ `checked_out` int(10) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
KEY `idx_title` (`title`(191)),
KEY `idx_asset_id` (`asset_id`),
+ KEY `idx_checked_out` (`checked_out`),
KEY `idx_from_stage_id` (`from_stage_id`),
KEY `idx_to_stage_id` (`to_stage_id`),
KEY `idx_workflow_id` (`workflow_id`)
@@ -106,11 +115,11 @@ CREATE TABLE IF NOT EXISTS `#__workflow_transitions` (
-- Dumping data for table `#__workflow_transitions`
--
-INSERT INTO `#__workflow_transitions` (`id`, `asset_id`, `published`, `ordering`, `workflow_id`, `title`, `description`, `from_stage_id`, `to_stage_id`) VALUES
-(1, 0, 1, 1, 1, 'Unpublish', '', -1, 1),
-(2, 0, 1, 2, 1, 'Publish', '', -1, 2),
-(3, 0, 1, 3, 1, 'Trash', '', -1, 3),
-(4, 0, 1, 4, 1, 'Archive', '', -1, 4);
+INSERT INTO `#__workflow_transitions` (`id`, `asset_id`, `published`, `ordering`, `workflow_id`, `title`, `description`, `from_stage_id`, `to_stage_id`, `checked_out_time`, `checked_out`) VALUES
+(1, 0, 1, 1, 1, 'Unpublish', '', -1, 1, NULL, 0),
+(2, 0, 1, 2, 1, 'Publish', '', -1, 2, NULL, 0),
+(3, 0, 1, 3, 1, 'Trash', '', -1, 3, NULL, 0),
+(4, 0, 1, 4, 1, 'Archive', '', -1, 4, NULL, 0);
--
-- Creating extension entry
diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-06-03.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-06-03.sql
index fd6dff11bb9d7..a89f316264c58 100644
--- a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-06-03.sql
+++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-06-03.sql
@@ -8,8 +8,8 @@ CREATE TABLE IF NOT EXISTS `#__csp` (
`blocked_uri` varchar(500) NOT NULL DEFAULT '',
`directive` varchar(500) NOT NULL DEFAULT '',
`client` varchar(500) NOT NULL DEFAULT '',
- `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
- `modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `created` datetime NOT NULL,
+ `modified` datetime NOT NULL,
`published` tinyint(1) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;
diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-07-29.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-07-29.sql
index daad748af9d11..ef8a4055edfc8 100644
--- a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-07-29.sql
+++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-07-29.sql
@@ -76,14 +76,17 @@ TRUNCATE TABLE `#__finder_terms`;
ALTER TABLE `#__finder_terms` CHANGE `language` `language` CHAR(7) NOT NULL DEFAULT '' AFTER `links`;
ALTER TABLE `#__finder_terms` MODIFY `stem` varchar(75) NOT NULL DEFAULT '';
ALTER TABLE `#__finder_terms` MODIFY `soundex` varchar(75) NOT NULL DEFAULT '';
-ALTER TABLE `#__finder_terms` DROP INDEX `idx_term`, ADD INDEX `idx_stem` (`stem`), ADD INDEX `idx_language` (`language`), ADD INDEX `language` (`language`), ADD UNIQUE INDEX `idx_term` (`term`, `language`);
+ALTER TABLE `#__finder_terms` DROP INDEX `idx_term`;
+ALTER TABLE `#__finder_terms` ADD INDEX `idx_stem` (`stem`);
+ALTER TABLE `#__finder_terms` ADD INDEX `idx_language` (`language`);
+ALTER TABLE `#__finder_terms` ADD UNIQUE INDEX `idx_term_language` (`term`, `language`);
DROP TABLE IF EXISTS `#__finder_terms_common`;
CREATE TABLE `#__finder_terms_common` (
`term` varchar(75) NOT NULL DEFAULT '',
`language` char(7) NOT NULL DEFAULT '',
`custom` int(11) NOT NULL DEFAULT '0',
- UNIQUE KEY `idx_word_lang` (`term`,`language`),
+ UNIQUE KEY `idx_term_language` (`term`,`language`),
KEY `idx_lang` (`language`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_bin;
INSERT INTO `#__finder_terms_common` (`term`, `language`, `custom`) VALUES
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-01-16.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-01-16.sql
new file mode 100644
index 0000000000000..2e0610b517402
--- /dev/null
+++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-01-16.sql
@@ -0,0 +1,15 @@
+INSERT INTO `#__extensions` (`name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES
+('com_mails', 'component', 'com_mails', '', 1, 1, 1, 1, '{"name":"com_mails","type":"component","creationDate":"January 2019","author":"Joomla! Project","copyright":"(C) 2005 - 2018 Open Source Matters. All rights reserved.","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"4.0.0","description":"COM_MAILS_XML_DESCRIPTION","group":""}', '{}', 0, '0000-00-00 00:00:00', 0, 0);
+
+CREATE TABLE IF NOT EXISTS `#__mail_templates` (
+ `template_id` VARCHAR(127) NOT NULL DEFAULT '',
+ `language` char(7) NOT NULL DEFAULT '',
+ `subject` VARCHAR(255) NOT NULL DEFAULT '',
+ `body` TEXT NOT NULL,
+ `htmlbody` TEXT NOT NULL,
+ `attachments` TEXT NOT NULL,
+ `params` TEXT NOT NULL,
+ PRIMARY KEY (`template_id`, `language`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;
+
+INSERT INTO `#__mail_templates` (`template_id`, `language`, `subject`, `body`, `htmlbody`, `attachments`, `params`) VALUES ('com_config.test_mail', '', 'COM_CONFIG_SENDMAIL_SUBJECT', 'COM_CONFIG_SENDMAIL_BODY', '', '', '{"tags":["sitename","method"]}');
diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-03-30.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-03-30.sql
index 6fb809e2d9353..61c154232e5fe 100644
--- a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-03-30.sql
+++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-03-30.sql
@@ -1,2 +1,6 @@
-ALTER TABLE `#__menu` ADD COLUMN `publish_up` datetime NOT NULL DEFAULT '0000-00-00 00:00:00';
-ALTER TABLE `#__menu` ADD COLUMN `publish_down` datetime NOT NULL DEFAULT '0000-00-00 00:00:00';
+ALTER TABLE `#__menu` ADD COLUMN `publish_up` datetime;
+ALTER TABLE `#__menu` ADD COLUMN `publish_down` datetime;
+
+ALTER TABLE `#__menu` MODIFY `checked_out_time` datetime NULL DEFAULT NULL;
+
+UPDATE `#__menu` 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-05-05.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-05-05.sql
index 8f423a14366bc..703c54dd30a6f 100644
--- a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-05-05.sql
+++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-05-05.sql
@@ -1,5 +1,6 @@
UPDATE `#__menu` SET `link`='index.php?option=com_banners&view=banners' WHERE `id`=3;
UPDATE `#__menu` SET `link`='index.php?option=com_categories&view=categories&extension=com_banners' WHERE `id`=4;
+UPDATE `#__menu` SET `link`='index.php?option=com_contact&view=contacts' WHERE `id`=8;
UPDATE `#__menu` SET `link`='index.php?option=com_categories&view=categories&extension=com_contact' WHERE `id`=9;
UPDATE `#__menu` SET `link`='index.php?option=com_newsfeeds&view=newsfeeds' WHERE `id`=14;
UPDATE `#__menu` SET `link`='index.php?option=com_categories&view=categories&extension=com_newsfeeds' WHERE `id`=15;
@@ -7,4 +8,4 @@ UPDATE `#__menu` SET `link`='index.php?option=com_redirect&view=links' WHERE `id
UPDATE `#__menu` SET `link`='index.php?option=com_search&view=searches' WHERE `id`=17;
UPDATE `#__menu` SET `link`='index.php?option=com_finder&view=index' WHERE `id`=18;
UPDATE `#__menu` SET `link`='index.php?option=com_tags&view=tags' WHERE `id`=20;
-UPDATE `#__menu` SET `link`='index.php?option=com_associations&view=associations' WHERE `id`=22;
\ No newline at end of file
+UPDATE `#__menu` SET `link`='index.php?option=com_associations&view=associations' WHERE `id`=22;
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..b2bb1f01cdfd6 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
@@ -1,8 +1,32 @@
+ALTER TABLE `#__banners` MODIFY `created` datetime NOT NULL;
+ALTER TABLE `#__banners` MODIFY `modified` datetime NOT NULL;
+
+ALTER TABLE `#__banners` MODIFY `reset` datetime NULL DEFAULT NULL;
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
+ALTER TABLE `#__banner_clients` MODIFY `checked_out_time` datetime NULL DEFAULT NULL;
+
+UPDATE `#__banners` SET `modified` = `created` WHERE `modified` = '0000-00-00 00:00:00';
+
+UPDATE `#__banners` SET `reset` = NULL WHERE `reset` = '0000-00-00 00:00:00';
+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';
+
+UPDATE `#__banner_clients` 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_banners.banner'
+ AND `core_modified_time` = '0000-00-00 00:00:00';
+
+UPDATE `#__ucm_content` SET `core_publish_up` = NULL
+ WHERE `core_type_alias` = 'com_banners.banner'
+ AND `core_publish_up` = '0000-00-00 00:00:00';
+UPDATE `#__ucm_content` SET `core_publish_down` = NULL
+ WHERE `core_type_alias` = 'com_banners.banner'
+ AND `core_publish_down` = '0000-00-00 00:00:00';
+UPDATE `#__ucm_content` SET `core_checked_out_time` = NULL
+ WHERE `core_type_alias` = 'com_banners.banner'
+ AND `core_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..d7c5e1e0d9e9d 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
@@ -1,8 +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
- `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 `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';
diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-07-13.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-07-13.sql
new file mode 100644
index 0000000000000..6096aeff05a8d
--- /dev/null
+++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-07-13.sql
@@ -0,0 +1,91 @@
+INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES
+(0, 'mod_loginsupport', 'module', 'mod_loginsupport', '', 1, 1, 1, 1, '', '', 0, '0000-00-00 00:00:00', 0, 0),
+(0, 'mod_frontend', 'module', 'mod_frontend', '', 1, 1, 1, 0, '', '', 0, '0000-00-00 00:00:00', 0, 0),
+(0, 'mod_messages', 'module', 'mod_messages', '', 1, 1, 1, 0, '', '', 0, '0000-00-00 00:00:00', 0, 0),
+(0, 'mod_post_installation_messages', 'module', 'mod_post_installation_messages', '', 1, 1, 1, 0, '', '', 0, '0000-00-00 00:00:00', 0, 0),
+(0, 'mod_user', 'module', 'mod_user', '', 1, 1, 1, 0, '', '', 0, '0000-00-00 00:00:00', 0, 0),
+(0, 'mod_submenu', 'module', 'mod_submenu', '', 1, 1, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0),
+(0, 'mod_privacy_status', 'module', 'mod_privacy_status', '', 1, 1, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0);
+
+DELETE FROM `#__extensions` WHERE `element` = 'mod_status' AND `client_id` = 1;
+
+
+INSERT INTO `#__modules` (`title`, `note`, `content`, `ordering`, `position`, `checked_out`, `checked_out_time`, `publish_up`, `publish_down`, `published`, `module`, `access`, `showtitle`, `params`, `client_id`, `language`) VALUES
+('Login Support', '', '', 1, 'sidebar', 0, NULL, NULL, NULL, 1, 'mod_loginsupport', 1, 1, '{"forum_url":"https://forum.joomla.org/","documentation_url":"https://docs.joomla.org/","news_url":"https://www.joomla.org/","automatic_title":1,"prepare_content":1,"layout":"_:default","moduleclass_sfx":"","cache":1,"cache_time":900,"module_tag":"div","bootstrap_size":"0","header_tag":"h3","header_class":"","style":"0"}', 1, '*');
+INSERT INTO `#__modules_menu` (`moduleid`, `menuid`) VALUES (LAST_INSERT_ID(), 0);
+
+INSERT INTO `#__modules` (`title`, `note`, `content`, `ordering`, `position`, `checked_out`, `checked_out_time`, `publish_up`, `publish_down`, `published`, `module`, `access`, `showtitle`, `params`, `client_id`, `language`) VALUES
+('System Dashboard', '', '', 1, 'cpanel-system', 0, NULL, NULL, NULL, 1, 'mod_submenu', 1, 0, '{"menutype":"*","preset":"system","layout":"_:default","moduleclass_sfx":"","module_tag":"div","bootstrap_size":"12","header_tag":"h3","header_class":"","style":"System-none"}', 1, '*');
+INSERT INTO `#__modules_menu` (`moduleid`, `menuid`) VALUES (LAST_INSERT_ID(), 0);
+
+INSERT INTO `#__modules` (`title`, `note`, `content`, `ordering`, `position`, `checked_out`, `checked_out_time`, `publish_up`, `publish_down`, `published`, `module`, `access`, `showtitle`, `params`, `client_id`, `language`) VALUES
+('Content Dashboard', '', '', 1, 'cpanel-content', 0, NULL, NULL, NULL, 1, 'mod_submenu', 1, 0, '{"menutype":"*","preset":"content","layout":"_:default","moduleclass_sfx":"","module_tag":"div","bootstrap_size":"3","header_tag":"h3","header_class":"","style":"System-none"}', 1, '*');
+INSERT INTO `#__modules_menu` (`moduleid`, `menuid`) VALUES (LAST_INSERT_ID(), 0);
+
+INSERT INTO `#__modules` (`title`, `note`, `content`, `ordering`, `position`, `checked_out`, `checked_out_time`, `publish_up`, `publish_down`, `published`, `module`, `access`, `showtitle`, `params`, `client_id`, `language`) VALUES
+('Menus Dashboard', '', '', 1, 'cpanel-menus', 0, NULL, NULL, NULL, 1, 'mod_submenu', 1, 0, '{"menutype":"*","preset":"menus","layout":"_:default","moduleclass_sfx":"","module_tag":"div","bootstrap_size":"6","header_tag":"h3","header_class":"","style":"System-none"}', 1, '*');
+INSERT INTO `#__modules_menu` (`moduleid`, `menuid`) VALUES (LAST_INSERT_ID(), 0);
+
+INSERT INTO `#__modules` (`title`, `note`, `content`, `ordering`, `position`, `checked_out`, `checked_out_time`, `publish_up`, `publish_down`, `published`, `module`, `access`, `showtitle`, `params`, `client_id`, `language`) VALUES
+('Components Dashboard', '', '', 1, 'cpanel-components', 0, NULL, NULL, NULL, 1, 'mod_submenu', 1, 0, '{"menutype":"*","preset":"components","layout":"_:default","moduleclass_sfx":"","module_tag":"div","bootstrap_size":"12","header_tag":"h3","header_class":"","style":"System-none"}', 1, '*');
+INSERT INTO `#__modules_menu` (`moduleid`, `menuid`) VALUES (LAST_INSERT_ID(), 0);
+
+INSERT INTO `#__modules` (`title`, `note`, `content`, `ordering`, `position`, `checked_out`, `checked_out_time`, `publish_up`, `publish_down`, `published`, `module`, `access`, `showtitle`, `params`, `client_id`, `language`) VALUES
+('Users Dashboard', '', '', 1, 'cpanel-users', 0, NULL, NULL, NULL, 1, 'mod_submenu', 1, 0, '{"menutype":"*","preset":"users","layout":"_:default","moduleclass_sfx":"","module_tag":"div","bootstrap_size":"6","header_tag":"h3","header_class":"","style":"System-none"}', 1, '*');
+INSERT INTO `#__modules_menu` (`moduleid`, `menuid`) VALUES (LAST_INSERT_ID(), 0);
+
+INSERT INTO `#__modules` (`title`, `note`, `content`, `ordering`, `position`, `checked_out`, `checked_out_time`, `publish_up`, `publish_down`, `published`, `module`, `access`, `showtitle`, `params`, `client_id`, `language`) VALUES
+('Popular Articles', '', '', 3, 'cpanel-content', 0, NULL, NULL, NULL, 1, 'mod_popular', 3, 1, '{"count":"5","catid":"","user_id":"0","layout":"_:default","moduleclass_sfx":"","cache":"0", "bootstrap_size": "6"}', 1, '*');
+INSERT INTO `#__modules_menu` (`moduleid`, `menuid`) VALUES (LAST_INSERT_ID(), 0);
+
+INSERT INTO `#__modules` (`title`, `note`, `content`, `ordering`, `position`, `checked_out`, `checked_out_time`, `publish_up`, `publish_down`, `published`, `module`, `access`, `showtitle`, `params`, `client_id`, `language`) VALUES
+('Recently Added Articles', '', '', 4, 'cpanel-content', 0, NULL, NULL, NULL, 1, 'mod_latest', 3, 1, '{"count":"5","ordering":"c_dsc","catid":"","user_id":"0","layout":"_:default","moduleclass_sfx":"","cache":"0", "bootstrap_size": "6"}', 1, '*');
+INSERT INTO `#__modules_menu` (`moduleid`, `menuid`) VALUES (LAST_INSERT_ID(), 0);
+
+INSERT INTO `#__modules` (`title`, `note`, `content`, `ordering`, `position`, `checked_out`, `checked_out_time`, `publish_up`, `publish_down`, `published`, `module`, `access`, `showtitle`, `params`, `client_id`, `language`) VALUES
+('Logged-in Users', '', '', 2, 'cpanel-users', 0, NULL, NULL, NULL, 1, 'mod_logged', 3, 1, '{"count":"5","name":"1","layout":"_:default","moduleclass_sfx":"","cache":"0", "bootstrap_size": "6"}', 1, '*');
+INSERT INTO `#__modules_menu` (`moduleid`, `menuid`) VALUES (LAST_INSERT_ID(), 0);
+
+INSERT INTO `#__modules` (`title`, `note`, `content`, `ordering`, `position`, `checked_out`, `checked_out_time`, `publish_up`, `publish_down`, `published`, `module`, `access`, `showtitle`, `params`, `client_id`, `language`) VALUES
+('Frontend Link', '', '', 5, 'status', 0, NULL, NULL, NULL, 1, 'mod_frontend', 1, 1, '', 1, '*');
+INSERT INTO `#__modules_menu` (`moduleid`, `menuid`) VALUES (LAST_INSERT_ID(), 0);
+
+INSERT INTO `#__modules` (`title`, `note`, `content`, `ordering`, `position`, `checked_out`, `checked_out_time`, `publish_up`, `publish_down`, `published`, `module`, `access`, `showtitle`, `params`, `client_id`, `language`) VALUES
+('Messages', '', '', 4, 'status', 0, NULL, NULL, NULL, 1, 'mod_messages', 3, 1, '', 1, '*');
+INSERT INTO `#__modules_menu` (`moduleid`, `menuid`) VALUES (LAST_INSERT_ID(), 0);
+
+INSERT INTO `#__modules` (`title`, `note`, `content`, `ordering`, `position`, `checked_out`, `checked_out_time`, `publish_up`, `publish_down`, `published`, `module`, `access`, `showtitle`, `params`, `client_id`, `language`) VALUES
+('Post Install Messages', '', '', 3, 'status', 0, NULL, NULL, NULL, 1, 'mod_post_installation_messages', 3, 1, '', 1, '*');
+INSERT INTO `#__modules_menu` (`moduleid`, `menuid`) VALUES (LAST_INSERT_ID(), 0);
+
+INSERT INTO `#__modules` (`title`, `note`, `content`, `ordering`, `position`, `checked_out`, `checked_out_time`, `publish_up`, `publish_down`, `published`, `module`, `access`, `showtitle`, `params`, `client_id`, `language`) VALUES
+('User Status', '', '', 6, 'status', 0, NULL, NULL, NULL, 1, 'mod_user', 3, 1, '', 1, '*');
+INSERT INTO `#__modules_menu` (`moduleid`, `menuid`) VALUES (LAST_INSERT_ID(), 0);
+
+INSERT INTO `#__modules` (`title`, `note`, `content`, `ordering`, `position`, `checked_out`, `checked_out_time`, `publish_up`, `publish_down`, `published`, `module`, `access`, `showtitle`, `params`, `client_id`, `language`) VALUES
+('Site', '', '', 1, 'icon', 0, NULL, NULL, NULL, 1, 'mod_quickicon', 1, 1, '{"context":"site_quickicon","header_icon":"fa fa-desktop","show_users":"1","show_articles":"1","show_categories":"1","show_media":"1","show_menuItems":"1","show_modules":"1","show_plugins":"1","show_templates":"1","layout":"_:default","moduleclass_sfx":"","cache":1,"cache_time":900,"style":"0","module_tag":"div","bootstrap_size":"6","header_tag":"h3","header_class":""}', 1, '*');
+INSERT INTO `#__modules_menu` (`moduleid`, `menuid`) VALUES (LAST_INSERT_ID(), 0);
+
+INSERT INTO `#__modules` (`title`, `note`, `content`, `ordering`, `position`, `checked_out`, `checked_out_time`, `publish_up`, `publish_down`, `published`, `module`, `access`, `showtitle`, `params`, `client_id`, `language`) VALUES
+('System', '', '', 2, 'icon', 0, NULL, NULL, NULL, 1, 'mod_quickicon', 1, 1, '{"context":"system_quickicon","header_icon":"fa fa-wrench","show_global":"1","show_checkin":"1","show_cache":"1","layout":"_:default","moduleclass_sfx":"","cache":1,"cache_time":900,"style":"0","module_tag":"div","bootstrap_size":"6","header_tag":"h3","header_class":""}', 1, '*');
+INSERT INTO `#__modules_menu` (`moduleid`, `menuid`) VALUES (LAST_INSERT_ID(), 0);
+
+INSERT INTO `#__modules` (`title`, `note`, `content`, `ordering`, `position`, `checked_out`, `checked_out_time`, `publish_up`, `publish_down`, `published`, `module`, `access`, `showtitle`, `params`, `client_id`, `language`) VALUES
+('3rd Party', '', '', 4, 'icon', 0, NULL, NULL, NULL, 1, 'mod_quickicon', 1, 1, '{"context":"mod_quickicon","header_icon":"fa fa-boxes","load_plugins":"1","layout":"_:default","moduleclass_sfx":"","cache":1,"cache_time":900,"style":"0","module_tag":"div","bootstrap_size":"6","header_tag":"h3","header_class":""}', 1, '*');
+INSERT INTO `#__modules_menu` (`moduleid`, `menuid`) VALUES (LAST_INSERT_ID(), 0);
+
+UPDATE `#__modules` SET `title` = 'Update Checks',`ordering` = 3,`position` = 'icon',`showtitle` = 1,`params` = '{"context":"update_quickicon","header_icon":"fa fa-sync","show_global":"0","show_checkin":"0","show_cache":"0","show_users":"0","show_articles":"0","show_categories":"0","show_media":"0","show_menuItems":"0","show_modules":"0","show_plugins":"0","show_templates":"0","layout":"_:default","moduleclass_sfx":"","cache":1,"cache_time":900,"style":"0","module_tag":"div","bootstrap_size":"12","header_tag":"h3","header_class":""}' WHERE `#__modules`.`id` = 9;
+
+INSERT INTO `#__modules` (`title`, `note`, `content`, `ordering`, `position`, `checked_out`, `checked_out_time`, `publish_up`, `publish_down`, `published`, `module`, `access`, `showtitle`, `params`, `client_id`, `language`) VALUES
+('Help Dashboard', '', '', 1, 'cpanel-help', 0, NULL, NULL, NULL, 1, 'mod_submenu', 1, 0, '{"menutype":"*","preset":"help","layout":"_:default","moduleclass_sfx":"","style":"System-none","module_tag":"div","bootstrap_size":"0","header_tag":"h3","header_class":""}', 1, '*');
+INSERT INTO `#__modules_menu` (`moduleid`, `menuid`) VALUES (LAST_INSERT_ID(), 0);
+
+UPDATE `#__modules` SET `ordering` = 2,`position` = 'status' WHERE `#__modules`.`id` = 79;
+
+INSERT INTO `#__modules` (`title`, `note`, `content`, `ordering`, `position`, `checked_out`, `checked_out_time`, `publish_up`, `publish_down`, `published`, `module`, `access`, `showtitle`, `params`, `client_id`, `language`) VALUES
+('Privacy Requests', '', '', 1, 'cpanel-privacy', 0, NULL, NULL, NULL, 1, 'mod_privacy_dashboard', 1, 1, '{"layout":"_:default","moduleclass_sfx":"","cache":1,"cache_time":900,"cachemode":"static","style":"0","module_tag":"div","bootstrap_size":"0","header_tag":"h3","header_class":""}', 1, '*');
+INSERT INTO `#__modules_menu` (`moduleid`, `menuid`) VALUES (LAST_INSERT_ID(), 0);
+
+INSERT INTO `#__modules` (`title`, `note`, `content`, `ordering`, `position`, `checked_out`, `checked_out_time`, `publish_up`, `publish_down`, `published`, `module`, `access`, `showtitle`, `params`, `client_id`, `language`) VALUES
+('Privacy Status', '', '', 1, 'cpanel-privacy', 0, NULL, NULL, NULL, 1, 'mod_privacy_status', 1, 1, '{"layout":"_:default","moduleclass_sfx":"","cache":1,"cache_time":900,"cachemode":"static","style":"0","module_tag":"div","bootstrap_size":"0","header_tag":"h3","header_class":""}', 1, '*');
+INSERT INTO `#__modules_menu` (`moduleid`, `menuid`) VALUES (LAST_INSERT_ID(), 0);
diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-08-03.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-08-03.sql
new file mode 100644
index 0000000000000..a8df63a72d80c
--- /dev/null
+++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-08-03.sql
@@ -0,0 +1,2 @@
+ALTER TABLE `#__update_sites` ADD COLUMN `checked_out` int(10) unsigned NOT NULL DEFAULT 0;
+ALTER TABLE `#__update_sites` ADD COLUMN `checked_out_time` datetime NULL DEFAULT NULL;
diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-08-21.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-08-21.sql
new file mode 100644
index 0000000000000..49b8e0564acc7
--- /dev/null
+++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-08-21.sql
@@ -0,0 +1,15 @@
+INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES
+(0, 'plg_webservices_banners', 'plugin', 'banners', 'webservices', 0, 1, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0),
+(0, 'plg_webservices_config', 'plugin', 'config', 'webservices', 0, 1, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0),
+(0, 'plg_webservices_contact', 'plugin', 'contact', 'webservices', 0, 1, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0),
+(0, 'plg_webservices_languages', 'plugin', 'languages', 'webservices', 0, 1, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0),
+(0, 'plg_webservices_menus', 'plugin', 'menus', 'webservices', 0, 1, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0),
+(0, 'plg_webservices_messages', 'plugin', 'messages', 'webservices', 0, 1, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0),
+(0, 'plg_webservices_modules', 'plugin', 'modules', 'webservices', 0, 1, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0),
+(0, 'plg_webservices_newsfeeds', 'plugin', 'newsfeeds', 'webservices', 0, 1, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0),
+(0, 'plg_webservices_plugins', 'plugin', 'plugins', 'webservices', 0, 1, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0),
+(0, 'plg_webservices_privacy', 'plugin', 'privacy', 'webservices', 0, 1, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0),
+(0, 'plg_webservices_redirect', 'plugin', 'redirect', 'webservices', 0, 1, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0),
+(0, 'plg_webservices_tags', 'plugin', 'tags', 'webservices', 0, 1, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0),
+(0, 'plg_webservices_templates', 'plugin', 'templates', 'webservices', 0, 1, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0),
+(0, 'plg_webservices_users', 'plugin', 'users', 'webservices', 0, 1, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0);
diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-09-13.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-09-13.sql
new file mode 100644
index 0000000000000..911dddca67723
--- /dev/null
+++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-09-13.sql
@@ -0,0 +1,2 @@
+INSERT INTO `#__menu` (`menutype`, `title`, `alias`, `note`, `path`, `link`, `type`, `published`, `parent_id`, `level`, `component_id`, `checked_out`, `checked_out_time`, `browserNav`, `access`, `img`, `template_style_id`, `params`, `lft`, `rgt`, `home`, `language`, `client_id`, `publish_up`, `publish_down`)
+SELECT 'main', 'com_messages_manager', 'Private Messages', '', 'Messaging/Private Messages', 'index.php?option=com_messages&view=messages', 'component', 1, 10, 2, `extension_id`, 0, NULL, 0, 0, 'class:messages-add', 0, '', 18, 19, 0, '*', 1, NULL, NULL FROM `#__extensions` WHERE `name` = 'com_messages';
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/mysql/4.0.0-2019-09-22.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-09-22.sql
new file mode 100644
index 0000000000000..0a057c91842f9
--- /dev/null
+++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-09-22.sql
@@ -0,0 +1 @@
+ALTER TABLE `#__messages` MODIFY `date_time` datetime NOT NULL;
diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-09-23.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-09-23.sql
new file mode 100644
index 0000000000000..1e7592530f8a7
--- /dev/null
+++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-09-23.sql
@@ -0,0 +1,4 @@
+ALTER TABLE `#__redirect_links` MODIFY `created_date` datetime NOT NULL;
+ALTER TABLE `#__redirect_links` MODIFY `modified_date` datetime NOT NULL;
+
+UPDATE `#__redirect_links` SET `modified_date` = `created_date` WHERE `modified_date` = '0000-00-00 00:00:00';
diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-09-24.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-09-24.sql
new file mode 100644
index 0000000000000..758702a5773b6
--- /dev/null
+++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-09-24.sql
@@ -0,0 +1 @@
+ALTER TABLE `#__action_logs` MODIFY `log_date` datetime NOT NULL;
diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.8.0-2017-07-28.sql b/administrator/components/com_admin/sql/updates/postgresql/3.8.0-2017-07-28.sql
deleted file mode 100644
index 6b88b64d45039..0000000000000
--- a/administrator/components/com_admin/sql/updates/postgresql/3.8.0-2017-07-28.sql
+++ /dev/null
@@ -1 +0,0 @@
-ALTER TABLE "#__fields_groups" ADD COLUMN "params" TEXT NOT NULL;
diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.8.0-2017-07-31.sql b/administrator/components/com_admin/sql/updates/postgresql/3.8.0-2017-07-31.sql
deleted file mode 100644
index e98b0248b1fea..0000000000000
--- a/administrator/components/com_admin/sql/updates/postgresql/3.8.0-2017-07-31.sql
+++ /dev/null
@@ -1,5 +0,0 @@
-INSERT INTO "#__extensions"
-("package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "custom_data", "system_data", "checked_out", "checked_out_time", "ordering", "state")
-VALUES
- (0, 'mod_sampledata', 'module', 'mod_sampledata', '', 1, 0, 1, 0, '', '{}', '', '', 0, '1970-01-01 00:00:00', 0, 0),
- (0, 'plg_sampledata_blog', 'plugin', 'blog', 'sampledata', 0, 0, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0);
diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.8.2-2017-10-14.sql b/administrator/components/com_admin/sql/updates/postgresql/3.8.2-2017-10-14.sql
deleted file mode 100644
index f7183db8bd2a3..0000000000000
--- a/administrator/components/com_admin/sql/updates/postgresql/3.8.2-2017-10-14.sql
+++ /dev/null
@@ -1,5 +0,0 @@
---
--- Add index for alias check #__content
---
-
-CREATE INDEX "#__content_idx_alias" ON "#__content" ("alias");
diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.8.4-2018-01-16.sql b/administrator/components/com_admin/sql/updates/postgresql/3.8.4-2018-01-16.sql
deleted file mode 100644
index 4546bab50b54a..0000000000000
--- a/administrator/components/com_admin/sql/updates/postgresql/3.8.4-2018-01-16.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-DROP INDEX "#__user_keys_series_2";
-DROP INDEX "#__user_keys_series_3";
diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.8.8-2018-05-18.sql b/administrator/components/com_admin/sql/updates/postgresql/3.8.8-2018-05-18.sql
deleted file mode 100644
index 975876d250321..0000000000000
--- a/administrator/components/com_admin/sql/updates/postgresql/3.8.8-2018-05-18.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-INSERT INTO "#__postinstall_messages" ("extension_id", "title_key", "description_key", "action_key", "language_extension", "language_client_id", "type", "action_file", "action", "condition_file", "condition_method", "version_introduced", "enabled")
-VALUES
-(700, 'COM_CPANEL_MSG_UPDATEDEFAULTSETTINGS_TITLE', 'COM_CPANEL_MSG_UPDATEDEFAULTSETTINGS_BODY', '', 'com_cpanel', 1, 'message', '', '', 'admin://components/com_admin/postinstall/updatedefaultsettings.php', 'admin_postinstall_updatedefaultsettings_condition', '3.8.8', 1);
diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.8.9-2018-06-19.sql b/administrator/components/com_admin/sql/updates/postgresql/3.8.9-2018-06-19.sql
deleted file mode 100644
index 666def7ad577b..0000000000000
--- a/administrator/components/com_admin/sql/updates/postgresql/3.8.9-2018-06-19.sql
+++ /dev/null
@@ -1,2 +0,0 @@
--- Enable Sample Data Module.
-UPDATE "#__extensions" SET "enabled" = '1' WHERE "name" = 'mod_sampledata';
diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.9.10-2019-07-09.sql b/administrator/components/com_admin/sql/updates/postgresql/3.9.10-2019-07-09.sql
new file mode 100644
index 0000000000000..b1a394cd5c582
--- /dev/null
+++ b/administrator/components/com_admin/sql/updates/postgresql/3.9.10-2019-07-09.sql
@@ -0,0 +1,2 @@
+ALTER TABLE "#__template_styles" ALTER COLUMN "home" TYPE character varying(7);
+ALTER TABLE "#__template_styles" ALTER COLUMN "home" SET DEFAULT '0';
diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.9.7-2019-04-23.sql b/administrator/components/com_admin/sql/updates/postgresql/3.9.7-2019-04-23.sql
new file mode 100644
index 0000000000000..88dc5d39f8d5e
--- /dev/null
+++ b/administrator/components/com_admin/sql/updates/postgresql/3.9.7-2019-04-23.sql
@@ -0,0 +1 @@
+CREATE INDEX "#__session_idx_client_id_guest" ON "#__session" ("client_id", "guest");
diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.9.7-2019-04-26.sql b/administrator/components/com_admin/sql/updates/postgresql/3.9.7-2019-04-26.sql
new file mode 100644
index 0000000000000..0439a87b08e84
--- /dev/null
+++ b/administrator/components/com_admin/sql/updates/postgresql/3.9.7-2019-04-26.sql
@@ -0,0 +1 @@
+UPDATE "#__content_types" SET "content_history_options" = REPLACE("content_history_options", '\"ignoreChanges\":[\"modified_by\", \"modified\", \"checked_out\", \"checked_out_time\", \"version\", \"hits\"]', '\"ignoreChanges\":[\"modified_by\", \"modified\", \"checked_out\", \"checked_out_time\", \"version\", \"hits\", \"ordering\"]');
diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.9.7-2019-05-16.sql b/administrator/components/com_admin/sql/updates/postgresql/3.9.7-2019-05-16.sql
new file mode 100644
index 0000000000000..e03422239c89e
--- /dev/null
+++ b/administrator/components/com_admin/sql/updates/postgresql/3.9.7-2019-05-16.sql
@@ -0,0 +1 @@
+# Query removed, see https://github.com/joomla/joomla-cms/pull/25177
diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.9.8-2019-06-11.sql b/administrator/components/com_admin/sql/updates/postgresql/3.9.8-2019-06-11.sql
new file mode 100644
index 0000000000000..018e8d73c3bde
--- /dev/null
+++ b/administrator/components/com_admin/sql/updates/postgresql/3.9.8-2019-06-11.sql
@@ -0,0 +1 @@
+UPDATE "#__users" SET "params" = REPLACE("params", '",,"', '","');
\ No newline at end of file
diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.9.8-2019-06-15.sql b/administrator/components/com_admin/sql/updates/postgresql/3.9.8-2019-06-15.sql
new file mode 100644
index 0000000000000..3acf06149c527
--- /dev/null
+++ b/administrator/components/com_admin/sql/updates/postgresql/3.9.8-2019-06-15.sql
@@ -0,0 +1,4 @@
+DROP INDEX IF EXISTS "#__template_styles_idx_home";
+# Queries removed, see https://github.com/joomla/joomla-cms/pull/25484
+CREATE INDEX "#__template_styles_idx_client_id" ON "#__template_styles" ("client_id");
+CREATE INDEX "#__template_styles_idx_client_id_home" ON "#__template_styles" ("client_id", "home");
diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-05-15.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-05-15.sql
index f7e6cca7fd917..a41ff39e4f764 100644
--- a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-05-15.sql
+++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-05-15.sql
@@ -12,10 +12,12 @@ CREATE TABLE IF NOT EXISTS "#__workflows" (
"default" smallint NOT NULL DEFAULT 0,
"core" smallint NOT NULL DEFAULT 0,
"ordering" bigint NOT NULL DEFAULT 0,
- "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,
- "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_time" timestamp without time zone,
+ "checked_out" bigint DEFAULT 0 NOT NULL,
PRIMARY KEY ("id")
);
@@ -27,9 +29,10 @@ CREATE INDEX "#__workflows_idx_created" ON "#__workflows" ("created");
CREATE INDEX "#__workflows_idx_created_by" ON "#__workflows" ("created_by");
CREATE INDEX "#__workflows_idx_modified" ON "#__workflows" ("modified");
CREATE INDEX "#__workflows_idx_modified_by" ON "#__workflows" ("modified_by");
+CREATE INDEX "#__workflows_idx_checked_out" ON "#__workflows" ("checked_out");
-INSERT INTO "#__workflows" ("id", "asset_id", "published", "title", "description", "extension", "default", "core", "ordering", "created", "created_by", "modified", "modified_by") VALUES
-(1, 0, 1, 'COM_WORKFLOW_DEFAULT_WORKFLOW', '', 'com_content', 1, 1, 1, '1970-01-01 00:00:00', 0, '1970-01-01 00:00:00', 0);
+INSERT INTO "#__workflows" ("id", "asset_id", "published", "title", "description", "extension", "default", "core", "ordering", "created", "created_by", "modified", "modified_by", "checked_out_time", "checked_out") VALUES
+(1, 0, 1, 'COM_WORKFLOW_DEFAULT_WORKFLOW', '', 'com_content', 1, 1, 1, CURRENT_TIMESTAMP, 0, CURRENT_TIMESTAMP, 0, NULL, 0);
--
-- Table structure for table "#__workflow_associations"
@@ -63,22 +66,25 @@ CREATE TABLE IF NOT EXISTS "#__workflow_stages" (
"description" text NOT NULL,
"condition" bigint DEFAULT 0 NOT NULL,
"default" smallint NOT NULL DEFAULT 0,
+ "checked_out_time" timestamp without time zone,
+ "checked_out" bigint DEFAULT 0 NOT NULL,
PRIMARY KEY ("id")
);
CREATE INDEX "#__workflow_stages_idx_workflow_id" ON "#__workflow_stages" ("workflow_id");
CREATE INDEX "#__workflow_stages_idx_title" ON "#__workflow_stages" ("title");
CREATE INDEX "#__workflow_stages_idx_asset_id" ON "#__workflow_stages" ("asset_id");
CREATE INDEX "#__workflow_stages_idx_default" ON "#__workflow_stages" ("default");
+CREATE INDEX "#__workflow_stages_idx_checked_out" ON "#__workflow_stages" ("checked_out");
--
-- Dumping data for table "#__workflow_stages"
--
-INSERT INTO "#__workflow_stages" ("id", "asset_id", "ordering", "workflow_id", "published", "title", "description", "condition", "default") VALUES
-(1, 0, 1, 1, 1, 'JUNPUBLISHED', '', 0, 1),
-(2, 0, 2, 1, 1, 'JPUBLISHED', '', 1, 0),
-(3, 0, 3, 1, 1, 'JTRASHED', '', -2, 0),
-(4, 0, 4, 1, 1, 'JARCHIVED', '', 2, 0);
+INSERT INTO "#__workflow_stages" ("id", "asset_id", "ordering", "workflow_id", "published", "title", "description", "condition", "default", "checked_out_time", "checked_out") VALUES
+(1, 0, 1, 1, 1, 'JUNPUBLISHED', '', 0, 1, NULL, 0),
+(2, 0, 2, 1, 1, 'JPUBLISHED', '', 1, 0, NULL, 0),
+(3, 0, 3, 1, 1, 'JTRASHED', '', -2, 0, NULL, 0),
+(4, 0, 4, 1, 1, 'JARCHIVED', '', 2, 0, NULL, 0);
--
-- Table structure for table "#__workflow_transitions"
@@ -94,6 +100,8 @@ CREATE TABLE IF NOT EXISTS "#__workflow_transitions" (
"description" text NOT NULL,
"from_stage_id" bigint DEFAULT 0 NOT NULL,
"to_stage_id" bigint DEFAULT 0 NOT NULL,
+ "checked_out_time" timestamp without time zone,
+ "checked_out" bigint DEFAULT 0 NOT NULL,
PRIMARY KEY ("id")
);
CREATE INDEX "#__workflow_transitions_idx_title" ON "#__workflow_transitions" ("title");
@@ -101,12 +109,13 @@ CREATE INDEX "#__workflow_transitions_idx_asset_id" ON "#__workflow_transitions"
CREATE INDEX "#__workflow_transitions_idx_from_stage_id" ON "#__workflow_transitions" ("from_stage_id");
CREATE INDEX "#__workflow_transitions_idx_to_stage_id" ON "#__workflow_transitions" ("to_stage_id");
CREATE INDEX "#__workflow_transitions_idx_workflow_id" ON "#__workflow_transitions" ("workflow_id");
+CREATE INDEX "#__workflow_transitions_idx_checked_out" ON "#__workflow_transitions" ("checked_out");
-INSERT INTO "#__workflow_transitions" ("id", "asset_id", "published", "ordering", "workflow_id", "title", "description", "from_stage_id", "to_stage_id") VALUES
-(1, 0, 1, 1, 1, 'Unpublish', '', -1, 1),
-(2, 0, 1, 2, 1, 'Publish', '', -1, 2),
-(3, 0, 1, 3, 1, 'Trash', '', -1, 3),
-(4, 0, 1, 4, 1, 'Archive', '', -1, 4);
+INSERT INTO "#__workflow_transitions" ("id", "asset_id", "published", "ordering", "workflow_id", "title", "description", "from_stage_id", "to_stage_id", "checked_out_time", "checked_out") VALUES
+(1, 0, 1, 1, 1, 'Unpublish', '', -1, 1, NULL, 0),
+(2, 0, 1, 2, 1, 'Publish', '', -1, 2, NULL, 0),
+(3, 0, 1, 3, 1, 'Trash', '', -1, 3, NULL, 0),
+(4, 0, 1, 4, 1, 'Archive', '', -1, 4, NULL, 0);
--
-- Creating extension entry
diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-06-03.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-06-03.sql
index 2c37e314ef6f8..cd09733ade30a 100644
--- a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-06-03.sql
+++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-06-03.sql
@@ -8,8 +8,8 @@ CREATE TABLE IF NOT EXISTS "#__csp" (
"blocked_uri" varchar(500) NOT NULL DEFAULT '',
"directive" varchar(500) NOT NULL DEFAULT '',
"client" varchar(500) NOT NULL DEFAULT '',
- "created" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL,
- "modified" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL,
+ "created" timestamp without time zone NOT NULL,
+ "modified" timestamp without time zone NOT NULL,
"published" smallint DEFAULT 0 NOT NULL,
PRIMARY KEY ("id")
);
diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-07-29.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-07-29.sql
index 53d9a7aa586ec..c540fc32d659d 100644
--- a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-07-29.sql
+++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-07-29.sql
@@ -8,7 +8,8 @@ ALTER TABLE "#__finder_filters" ALTER COLUMN "created_by_alias" SET DEFAULT '';
TRUNCATE TABLE "#__finder_links";
ALTER TABLE "#__finder_links" ALTER COLUMN "state" SET NOT NULL;
ALTER TABLE "#__finder_links" ALTER COLUMN "access" SET NOT NULL;
-ALTER TABLE "#__finder_links" ALTER COLUMN "language" TYPE VARCHAR(7), ALTER COLUMN "language" SET DEFAULT '';
+ALTER TABLE "#__finder_links" ALTER COLUMN "language" TYPE character varying(7);
+ALTER TABLE "#__finder_links" ALTER COLUMN "language" SET DEFAULT '';
CREATE INDEX "#__finder_links_idx_language" on "#__finder_links" ("language");
CREATE TABLE "#__finder_links_terms" (
@@ -75,21 +76,22 @@ INSERT INTO "#__finder_taxonomy" ("id", "parent_id", "lft", "rgt", "level", "pat
SELECT setval('#__finder_taxonomy_id_seq', 2, false);
TRUNCATE TABLE "#__finder_terms";
-ALTER TABLE "#__finder_terms" ALTER COLUMN "language" TYPE CHAR(7), ALTER COLUMN "language" SET DEFAULT '';
+ALTER TABLE "#__finder_terms" ALTER COLUMN "language" TYPE character varying(7);
+ALTER TABLE "#__finder_terms" ALTER COLUMN "language" SET DEFAULT '';
ALTER TABLE "#__finder_terms" ALTER COLUMN "stem" SET DEFAULT '';
ALTER TABLE "#__finder_terms" ALTER COLUMN "soundex" SET DEFAULT '';
CREATE INDEX "#__finder_terms_idx_stem" on "#__finder_terms" ("stem");
CREATE INDEX "#__finder_terms_idx_language" on "#__finder_terms" ("language");
-ALTER TABLE "#__finder_terms" DROP CONSTRAINT "#__finder_terms_idx_term", ADD CONSTRAINT "#__finder_terms_idx_term_language" UNIQUE ("term", "language");
+ALTER TABLE "#__finder_terms" DROP CONSTRAINT "#__finder_terms_idx_term";
+ALTER TABLE "#__finder_terms" ADD CONSTRAINT "#__finder_terms_idx_term_language" UNIQUE ("term", "language");
DROP TABLE IF EXISTS "#__finder_terms_common";
CREATE TABLE "#__finder_terms_common" (
"term" varchar(75) NOT NULL,
"language" varchar(7) DEFAULT '' NOT NULL,
"custom" integer DEFAULT 0 NOT NULL,
- CONSTRAINT "#__finder_terms_idx_term" UNIQUE ("term", "language")
+ CONSTRAINT "#__finder_terms_common_idx_term_language" UNIQUE ("term", "language")
);
-CREATE INDEX "#__finder_terms_common_idx_word_lang" on "#__finder_terms_common" ("term", "language");
CREATE INDEX "#__finder_terms_common_idx_lang" on "#__finder_terms_common" ("language");
INSERT INTO "#__finder_terms_common" ("term", "language", "custom") VALUES
('i', 'en', 0),
@@ -267,12 +269,14 @@ INSERT INTO "#__finder_terms_common" ("term", "language", "custom") VALUES
('too', 'en', 0),
('very', 'en', 0);
-ALTER TABLE "#__finder_tokens" ALTER COLUMN "language" TYPE VARCHAR(7), ALTER COLUMN "language" SET DEFAULT '';
+ALTER TABLE "#__finder_tokens" ALTER COLUMN "language" TYPE character varying(7);
+ALTER TABLE "#__finder_tokens" ALTER COLUMN "language" SET DEFAULT '';
ALTER TABLE "#__finder_tokens" ALTER COLUMN "stem" SET DEFAULT '';
CREATE INDEX "#__finder_tokens_idx_stem" on "#__finder_tokens" ("stem");
CREATE INDEX "#__finder_tokens_idx_language" on "#__finder_tokens" ("language");
-ALTER TABLE "#__finder_tokens_aggregate" ALTER COLUMN "language" TYPE VARCHAR(7), ALTER COLUMN "language" SET DEFAULT '';
+ALTER TABLE "#__finder_tokens_aggregate" ALTER COLUMN "language" TYPE character varying(7);
+ALTER TABLE "#__finder_tokens_aggregate" ALTER COLUMN "language" SET DEFAULT '';
ALTER TABLE "#__finder_tokens_aggregate" DROP COLUMN "map_suffix";
ALTER TABLE "#__finder_tokens_aggregate" ALTER COLUMN "stem" SET DEFAULT '';
ALTER TABLE "#__finder_tokens_aggregate" ALTER COLUMN "term_weight" SET DEFAULT 0;
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-01-16.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-01-16.sql
new file mode 100644
index 0000000000000..5b93fae6ad192
--- /dev/null
+++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-01-16.sql
@@ -0,0 +1,17 @@
+INSERT INTO "#__extensions" ("name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "checked_out", "checked_out_time", "ordering", "state") VALUES
+('com_mails', 'component', 'com_mails', '', 1, 1, 1, 1, '{"name":"com_mails","type":"component","creationDate":"January 2019","author":"Joomla! Project","copyright":"(C) 2005 - 2019 Open Source Matters. All rights reserved.","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"4.0.0","description":"COM_MAILS_XML_DESCRIPTION","group":""}', '{}', 0, '1970-01-01 00:00:00', 0, 0);
+
+CREATE TABLE IF NOT EXISTS "#__mail_templates" (
+ "template_id" varchar(127) NOT NULL DEFAULT '',
+ "language" char(7) NOT NULL DEFAULT '',
+ "subject" varchar(255) NOT NULL DEFAULT '',
+ "body" TEXT NOT NULL,
+ "htmlbody" TEXT NOT NULL,
+ "attachments" TEXT NOT NULL,
+ "params" TEXT NOT NULL,
+ CONSTRAINT "#__mail_templates_idx_template_id_language" UNIQUE ("template_id", "language")
+);
+CREATE INDEX "#__mail_templates_idx_template_id" ON "#__mail_templates" ("template_id");
+CREATE INDEX "#__mail_templates_idx_language" ON "#__mail_templates" ("language");
+
+INSERT INTO "#__mail_templates" ("template_id", "language", "subject", "body", "htmlbody", "attachments", "params") VALUES ('com_config.test_mail', '', 'COM_CONFIG_SENDMAIL_SUBJECT', 'COM_CONFIG_SENDMAIL_BODY', '', '', '{"tags":["sitename","method"]}');
diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-03-30.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-03-30.sql
index f3ce56ffcb477..9601b6b1dd693 100644
--- a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-03-30.sql
+++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-03-30.sql
@@ -1,2 +1,7 @@
-ALTER TABLE "#__menu" ADD COLUMN "publish_up" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL;
-ALTER TABLE "#__menu" ADD COLUMN "publish_down" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL;
+ALTER TABLE "#__menu" ADD COLUMN "publish_up" timestamp without time zone;
+ALTER TABLE "#__menu" ADD COLUMN "publish_down" timestamp without time zone;
+
+ALTER TABLE "#__menu" ALTER COLUMN "checked_out_time" DROP NOT NULL;
+ALTER TABLE "#__menu" ALTER COLUMN "checked_out_time" DROP DEFAULT;
+
+UPDATE "#__menu" 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-05-05.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-05-05.sql
index 2771acade7344..2bd47982fa756 100644
--- a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-05-05.sql
+++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-05-05.sql
@@ -1,5 +1,6 @@
UPDATE "#__menu" SET "link"='index.php?option=com_banners&view=banners' WHERE "id"=3;
UPDATE "#__menu" SET "link"='index.php?option=com_categories&view=categories&extension=com_banners' WHERE "id"=4;
+UPDATE "#__menu" SET "link"='index.php?option=com_contact&view=contacts' WHERE "id"=8;
UPDATE "#__menu" SET "link"='index.php?option=com_categories&view=categories&extension=com_contact' WHERE "id"=9;
UPDATE "#__menu" SET "link"='index.php?option=com_newsfeeds&view=newsfeeds' WHERE "id"=14;
UPDATE "#__menu" SET "link"='index.php?option=com_categories&view=categories&extension=com_newsfeeds' WHERE "id"=15;
@@ -7,4 +8,4 @@ UPDATE "#__menu" SET "link"='index.php?option=com_redirect&view=links' WHERE "id
UPDATE "#__menu" SET "link"='index.php?option=com_search&view=searches' WHERE "id"=17;
UPDATE "#__menu" SET "link"='index.php?option=com_finder&view=index' WHERE "id"=18;
UPDATE "#__menu" SET "link"='index.php?option=com_tags&view=tags' WHERE "id"=20;
-UPDATE "#__menu" SET "link"='index.php?option=com_associations&view=associations' WHERE "id"=22;
\ No newline at end of file
+UPDATE "#__menu" SET "link"='index.php?option=com_associations&view=associations' WHERE "id"=22;
diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-05-20.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-05-20.sql
index b88dee5e25b83..a97c2aff35325 100644
--- a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-05-20.sql
+++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-05-20.sql
@@ -1 +1 @@
-ALTER TABLE "#__extensions" ADD COLUMN "note" varchar(255);
+ALTER TABLE "#__extensions" ADD COLUMN "note" character varying(255);
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..44a37e0c1fb98 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
@@ -1,3 +1,10 @@
+ALTER TABLE "#__banners" ALTER COLUMN "created" DROP DEFAULT;
+
+ALTER TABLE "#__banners" ALTER COLUMN "modified" DROP DEFAULT;
+
+ALTER TABLE "#__banners" ALTER COLUMN "reset" DROP NOT NULL;
+ALTER TABLE "#__banners" ALTER COLUMN "reset" DROP DEFAULT;
+
ALTER TABLE "#__banners" ALTER COLUMN "publish_up" DROP NOT NULL;
ALTER TABLE "#__banners" ALTER COLUMN "publish_up" DROP DEFAULT;
@@ -7,7 +14,28 @@ 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
+ALTER TABLE "#__banner_clients" ALTER COLUMN "checked_out_time" DROP NOT NULL;
+ALTER TABLE "#__banner_clients" ALTER COLUMN "checked_out_time" DROP DEFAULT;
+
+UPDATE "#__banners" SET "modified" = "created" WHERE "modified" = '1970-01-01 00:00:00';
+
+UPDATE "#__banners" SET "reset" = NULL WHERE "reset" = '1970-01-01 00:00:00';
+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';
+
+UPDATE "#__banner_clients" 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_banners.banner'
+ AND "core_modified_time" = '1970-01-01 00:00:00';
+
+UPDATE "#__ucm_content" SET "core_publish_up" = NULL
+ WHERE "core_type_alias" = 'com_banners.banner'
+ AND "core_publish_up" = '1970-01-01 00:00:00';
+UPDATE "#__ucm_content" SET "core_publish_down" = NULL
+ WHERE "core_type_alias" = 'com_banners.banner'
+ AND "core_publish_down" = '1970-01-01 00:00:00';
+UPDATE "#__ucm_content" SET "core_checked_out_time" = NULL
+ WHERE "core_type_alias" = 'com_banners.banner'
+ AND "core_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..df9bb2c27d00c 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
@@ -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;
@@ -7,7 +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
- "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 "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';
diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-07-13.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-07-13.sql
new file mode 100644
index 0000000000000..29f3f92c8f7cc
--- /dev/null
+++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-07-13.sql
@@ -0,0 +1,90 @@
+INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "checked_out", "checked_out_time", "ordering", "state") VALUES
+(0, 'mod_loginsupport', 'module', 'mod_loginsupport', '', 1, 1, 1, 1, '', '', 0, '1970-01-01 00:00:00', 0, 0),
+(0, 'mod_frontend', 'module', 'mod_frontend', '', 1, 1, 1, 0, '', '', 0, '1970-01-01 00:00:00', 0, 0),
+(0, 'mod_messages', 'module', 'mod_messages', '', 1, 1, 1, 0, '', '', 0, '1970-01-01 00:00:00', 0, 0),
+(0, 'mod_post_installation_messages', 'module', 'mod_post_installation_messages', '', 1, 1, 1, 0, '', '', 0, '1970-01-01 00:00:00', 0, 0),
+(0, 'mod_user', 'module', 'mod_user', '', 1, 1, 1, 0, '', '', 0, '1970-01-01 00:00:00', 0, 0),
+(0, 'mod_submenu', 'module', 'mod_submenu', '', 1, 1, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0),
+(0, 'mod_privacy_status', 'module', 'mod_privacy_status', '', 1, 1, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0);
+
+DELETE FROM "#__extensions" WHERE "element" = 'mod_status' AND "client_id" = 1;
+
+INSERT INTO "#__modules" ("title", "note", "content", "ordering", "position", "checked_out", "checked_out_time", "publish_up", "publish_down", "published", "module", "access", "showtitle", "params", "client_id", "language") VALUES
+('Login Support', '', '', 1, 'sidebar', 0, NULL, NULL, NULL, 1, 'mod_loginsupport', 1, 1, '{"forum_url":"https://forum.joomla.org/","documentation_url":"https://docs.joomla.org/","news_url":"https://www.joomla.org/","automatic_title":1,"prepare_content":1,"layout":"_:default","moduleclass_sfx":"","cache":1,"cache_time":900,"module_tag":"div","bootstrap_size":"0","header_tag":"h3","header_class":"","style":"0"}', 1, '*');
+INSERT INTO "#__modules_menu" ("moduleid", "menuid") VALUES (currval(pg_get_serial_sequence('#__modules','id')), 0);
+
+INSERT INTO "#__modules" ("title", "note", "content", "ordering", "position", "checked_out", "checked_out_time", "publish_up", "publish_down", "published", "module", "access", "showtitle", "params", "client_id", "language") VALUES
+('System Dashboard', '', '', 1, 'cpanel-system', 0, NULL, NULL, NULL, 1, 'mod_submenu', 1, 0, '{"menutype":"*","preset":"system","layout":"_:default","moduleclass_sfx":"","module_tag":"div","bootstrap_size":"12","header_tag":"h3","header_class":"","style":"System-none"}', 1, '*');
+INSERT INTO "#__modules_menu" ("moduleid", "menuid") VALUES (currval(pg_get_serial_sequence('#__modules','id')), 0);
+
+INSERT INTO "#__modules" ("title", "note", "content", "ordering", "position", "checked_out", "checked_out_time", "publish_up", "publish_down", "published", "module", "access", "showtitle", "params", "client_id", "language") VALUES
+('Content Dashboard', '', '', 1, 'cpanel-content', 0, NULL, NULL, NULL, 1, 'mod_submenu', 1, 0, '{"menutype":"*","preset":"content","layout":"_:default","moduleclass_sfx":"","module_tag":"div","bootstrap_size":"3","header_tag":"h3","header_class":"","style":"System-none"}', 1, '*');
+INSERT INTO "#__modules_menu" ("moduleid", "menuid") VALUES (currval(pg_get_serial_sequence('#__modules','id')), 0);
+
+INSERT INTO "#__modules" ("title", "note", "content", "ordering", "position", "checked_out", "checked_out_time", "publish_up", "publish_down", "published", "module", "access", "showtitle", "params", "client_id", "language") VALUES
+('Menus Dashboard', '', '', 1, 'cpanel-menus', 0, NULL, NULL, NULL, 1, 'mod_submenu', 1, 0, '{"menutype":"*","preset":"menus","layout":"_:default","moduleclass_sfx":"","module_tag":"div","bootstrap_size":"6","header_tag":"h3","header_class":"","style":"System-none"}', 1, '*');
+INSERT INTO "#__modules_menu" ("moduleid", "menuid") VALUES (currval(pg_get_serial_sequence('#__modules','id')), 0);
+
+INSERT INTO "#__modules" ("title", "note", "content", "ordering", "position", "checked_out", "checked_out_time", "publish_up", "publish_down", "published", "module", "access", "showtitle", "params", "client_id", "language") VALUES
+('Components Dashboard', '', '', 1, 'cpanel-components', 0, NULL, NULL, NULL, 1, 'mod_submenu', 1, 0, '{"menutype":"*","preset":"components","layout":"_:default","moduleclass_sfx":"","module_tag":"div","bootstrap_size":"12","header_tag":"h3","header_class":"","style":"System-none"}', 1, '*');
+INSERT INTO "#__modules_menu" ("moduleid", "menuid") VALUES (currval(pg_get_serial_sequence('#__modules','id')), 0);
+
+INSERT INTO "#__modules" ("title", "note", "content", "ordering", "position", "checked_out", "checked_out_time", "publish_up", "publish_down", "published", "module", "access", "showtitle", "params", "client_id", "language") VALUES
+('Users Dashboard', '', '', 1, 'cpanel-users', 0, NULL, NULL, NULL, 1, 'mod_submenu', 1, 0, '{"menutype":"*","preset":"users","layout":"_:default","moduleclass_sfx":"","module_tag":"div","bootstrap_size":"6","header_tag":"h3","header_class":"","style":"System-none"}', 1, '*');
+INSERT INTO "#__modules_menu" ("moduleid", "menuid") VALUES (currval(pg_get_serial_sequence('#__modules','id')), 0);
+
+INSERT INTO "#__modules" ("title", "note", "content", "ordering", "position", "checked_out", "checked_out_time", "publish_up", "publish_down", "published", "module", "access", "showtitle", "params", "client_id", "language") VALUES
+('Popular Articles', '', '', 3, 'cpanel-content', 0, NULL, NULL, NULL, 1, 'mod_popular', 3, 1, '{"count":"5","catid":"","user_id":"0","layout":"_:default","moduleclass_sfx":"","cache":"0", "bootstrap_size": "6"}', 1, '*');
+INSERT INTO "#__modules_menu" ("moduleid", "menuid") VALUES (currval(pg_get_serial_sequence('#__modules','id')), 0);
+
+INSERT INTO "#__modules" ("title", "note", "content", "ordering", "position", "checked_out", "checked_out_time", "publish_up", "publish_down", "published", "module", "access", "showtitle", "params", "client_id", "language") VALUES
+('Recently Added Articles', '', '', 4, 'cpanel-content', 0, NULL, NULL, NULL, 1, 'mod_latest', 3, 1, '{"count":"5","ordering":"c_dsc","catid":"","user_id":"0","layout":"_:default","moduleclass_sfx":"","cache":"0", "bootstrap_size": "6"}', 1, '*');
+INSERT INTO "#__modules_menu" ("moduleid", "menuid") VALUES (currval(pg_get_serial_sequence('#__modules','id')), 0);
+
+INSERT INTO "#__modules" ("title", "note", "content", "ordering", "position", "checked_out", "checked_out_time", "publish_up", "publish_down", "published", "module", "access", "showtitle", "params", "client_id", "language") VALUES
+('Logged-in Users', '', '', 2, 'cpanel-users', 0, NULL, NULL, NULL, 1, 'mod_logged', 3, 1, '{"count":"5","name":"1","layout":"_:default","moduleclass_sfx":"","cache":"0", "bootstrap_size": "6"}', 1, '*');
+INSERT INTO "#__modules_menu" ("moduleid", "menuid") VALUES (currval(pg_get_serial_sequence('#__modules','id')), 0);
+
+INSERT INTO "#__modules" ("title", "note", "content", "ordering", "position", "checked_out", "checked_out_time", "publish_up", "publish_down", "published", "module", "access", "showtitle", "params", "client_id", "language") VALUES
+('Frontend Link', '', '', 5, 'status', 0, NULL, NULL, NULL, 1, 'mod_frontend', 1, 1, '', 1, '*');
+INSERT INTO "#__modules_menu" ("moduleid", "menuid") VALUES (currval(pg_get_serial_sequence('#__modules','id')), 0);
+
+INSERT INTO "#__modules" ("title", "note", "content", "ordering", "position", "checked_out", "checked_out_time", "publish_up", "publish_down", "published", "module", "access", "showtitle", "params", "client_id", "language") VALUES
+('Messages', '', '', 4, 'status', 0, NULL, NULL, NULL, 1, 'mod_messages', 3, 1, '', 1, '*');
+INSERT INTO "#__modules_menu" ("moduleid", "menuid") VALUES (currval(pg_get_serial_sequence('#__modules','id')), 0);
+
+INSERT INTO "#__modules" ("title", "note", "content", "ordering", "position", "checked_out", "checked_out_time", "publish_up", "publish_down", "published", "module", "access", "showtitle", "params", "client_id", "language") VALUES
+('Post Install Messages', '', '', 3, 'status', 0, NULL, NULL, NULL, 1, 'mod_post_installation_messages', 3, 1, '', 1, '*');
+INSERT INTO "#__modules_menu" ("moduleid", "menuid") VALUES (currval(pg_get_serial_sequence('#__modules','id')), 0);
+
+INSERT INTO "#__modules" ("title", "note", "content", "ordering", "position", "checked_out", "checked_out_time", "publish_up", "publish_down", "published", "module", "access", "showtitle", "params", "client_id", "language") VALUES
+('User Status', '', '', 6, 'status', 0, NULL, NULL, NULL, 1, 'mod_user', 3, 1, '', 1, '*');
+INSERT INTO "#__modules_menu" ("moduleid", "menuid") VALUES (currval(pg_get_serial_sequence('#__modules','id')), 0);
+
+INSERT INTO "#__modules" ("title", "note", "content", "ordering", "position", "checked_out", "checked_out_time", "publish_up", "publish_down", "published", "module", "access", "showtitle", "params", "client_id", "language") VALUES
+('Site', '', '', 1, 'icon', 0, NULL, NULL, NULL, 1, 'mod_quickicon', 1, 1, '{"context":"site_quickicon","header_icon":"fa fa-desktop","show_users":"1","show_articles":"1","show_categories":"1","show_media":"1","show_menuItems":"1","show_modules":"1","show_plugins":"1","show_templates":"1","layout":"_:default","moduleclass_sfx":"","cache":1,"cache_time":900,"style":"0","module_tag":"div","bootstrap_size":"6","header_tag":"h3","header_class":""}', 1, '*');
+INSERT INTO "#__modules_menu" ("moduleid", "menuid") VALUES (currval(pg_get_serial_sequence('#__modules','id')), 0);
+
+INSERT INTO "#__modules" ("title", "note", "content", "ordering", "position", "checked_out", "checked_out_time", "publish_up", "publish_down", "published", "module", "access", "showtitle", "params", "client_id", "language") VALUES
+('System', '', '', 2, 'icon', 0, NULL, NULL, NULL, 1, 'mod_quickicon', 1, 1, '{"context":"system_quickicon","header_icon":"fa fa-wrench","show_global":"1","show_checkin":"1","show_cache":"1","layout":"_:default","moduleclass_sfx":"","cache":1,"cache_time":900,"style":"0","module_tag":"div","bootstrap_size":"6","header_tag":"h3","header_class":""}', 1, '*');
+INSERT INTO "#__modules_menu" ("moduleid", "menuid") VALUES (currval(pg_get_serial_sequence('#__modules','id')), 0);
+
+INSERT INTO "#__modules" ("title", "note", "content", "ordering", "position", "checked_out", "checked_out_time", "publish_up", "publish_down", "published", "module", "access", "showtitle", "params", "client_id", "language") VALUES
+('3rd Party', '', '', 4, 'icon', 0, NULL, NULL, NULL, 1, 'mod_quickicon', 1, 1, '{"context":"mod_quickicon","header_icon":"fa fa-boxes","load_plugins":"1","layout":"_:default","moduleclass_sfx":"","cache":1,"cache_time":900,"style":"0","module_tag":"div","bootstrap_size":"6","header_tag":"h3","header_class":""}', 1, '*');
+INSERT INTO "#__modules_menu" ("moduleid", "menuid") VALUES (currval(pg_get_serial_sequence('#__modules','id')), 0);
+
+UPDATE "#__modules" SET "title" = 'Update Checks',"ordering" = 3,"position" = 'icon',"showtitle" = 1,"params" = '{"context":"update_quickicon","header_icon":"fa fa-sync","layout":"_:default","moduleclass_sfx":"","cache":1,"cache_time":900,"style":"0","module_tag":"div","bootstrap_size":"12","header_tag":"h3","header_class":""}' WHERE "#__modules"."id" = 9;
+
+INSERT INTO "#__modules" ("title", "note", "content", "ordering", "position", "checked_out", "checked_out_time", "publish_up", "publish_down", "published", "module", "access", "showtitle", "params", "client_id", "language") VALUES
+('Help Dashboard', '', '', 1, 'cpanel-help', 0, NULL, NULL, NULL, 1, 'mod_submenu', 1, 0, '{"menutype":"*","preset":"help","layout":"_:default","moduleclass_sfx":"","style":"System-none","module_tag":"div","bootstrap_size":"0","header_tag":"h3","header_class":""}', 1, '*');
+INSERT INTO "#__modules_menu" ("moduleid", "menuid") VALUES (currval(pg_get_serial_sequence('#__modules','id')), 0);
+
+UPDATE "#__modules" SET "ordering" = 2,"position" = 'status' WHERE "#__modules"."id" = 79;
+
+INSERT INTO "#__modules" ("title", "note", "content", "ordering", "position", "checked_out", "checked_out_time", "publish_up", "publish_down", "published", "module", "access", "showtitle", "params", "client_id", "language") VALUES
+('Privacy Requests', '', '', 1, 'cpanel-privacy', 0, NULL, NULL, NULL, 1, 'mod_privacy_dashboard', 1, 1, '{"layout":"_:default","moduleclass_sfx":"","cache":1,"cache_time":900,"cachemode":"static","style":"0","module_tag":"div","bootstrap_size":"0","header_tag":"h3","header_class":""}', 1, '*');
+INSERT INTO "#__modules_menu" ("moduleid", "menuid") VALUES (currval(pg_get_serial_sequence('#__modules','id')), 0);
+
+INSERT INTO "#__modules" ("title", "note", "content", "ordering", "position", "checked_out", "checked_out_time", "publish_up", "publish_down", "published", "module", "access", "showtitle", "params", "client_id", "language") VALUES
+('Privacy Status', '', '', 1, 'cpanel-privacy', 0, NULL, NULL, NULL, 1, 'mod_privacy_status', 1, 1, '{"layout":"_:default","moduleclass_sfx":"","cache":1,"cache_time":900,"cachemode":"static","style":"0","module_tag":"div","bootstrap_size":"0","header_tag":"h3","header_class":""}', 1, '*');
+INSERT INTO "#__modules_menu" ("moduleid", "menuid") VALUES (currval(pg_get_serial_sequence('#__modules','id')), 0);
diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-08-03.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-08-03.sql
new file mode 100644
index 0000000000000..a09ac565d03a7
--- /dev/null
+++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-08-03.sql
@@ -0,0 +1,2 @@
+ALTER TABLE "#__update_sites" ADD COLUMN "checked_out" bigint DEFAULT 0 NOT NULL;
+ALTER TABLE "#__update_sites" ADD COLUMN "checked_out_time" timestamp without time zone DEFAULT NULL;
diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-08-21.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-08-21.sql
new file mode 100644
index 0000000000000..76161234bfa1e
--- /dev/null
+++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-08-21.sql
@@ -0,0 +1,15 @@
+INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "checked_out", "checked_out_time", "ordering", "state") VALUES
+(0, 'plg_webservices_banners', 'plugin', 'banners', 'webservices', 0, 1, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0),
+(0, 'plg_webservices_config', 'plugin', 'config', 'webservices', 0, 1, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0),
+(0, 'plg_webservices_contact', 'plugin', 'contact', 'webservices', 0, 1, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0),
+(0, 'plg_webservices_languages', 'plugin', 'languages', 'webservices', 0, 1, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0),
+(0, 'plg_webservices_menus', 'plugin', 'menus', 'webservices', 0, 1, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0),
+(0, 'plg_webservices_messages', 'plugin', 'messages', 'webservices', 0, 1, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0),
+(0, 'plg_webservices_modules', 'plugin', 'modules', 'webservices', 0, 1, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0),
+(0, 'plg_webservices_newsfeeds', 'plugin', 'newsfeeds', 'webservices', 0, 1, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0),
+(0, 'plg_webservices_plugins', 'plugin', 'plugins', 'webservices', 0, 1, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0),
+(0, 'plg_webservices_privacy', 'plugin', 'privacy', 'webservices', 0, 1, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0),
+(0, 'plg_webservices_redirect', 'plugin', 'redirect', 'webservices', 0, 1, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0),
+(0, 'plg_webservices_tags', 'plugin', 'tags', 'webservices', 0, 1, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0),
+(0, 'plg_webservices_templates', 'plugin', 'templates', 'webservices', 0, 1, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0),
+(0, 'plg_webservices_users', 'plugin', 'users', 'webservices', 0, 1, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0);
diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-09-13.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-09-13.sql
new file mode 100644
index 0000000000000..04dc591e0c4f1
--- /dev/null
+++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-09-13.sql
@@ -0,0 +1,2 @@
+INSERT INTO "#__menu" ("menutype", "title", "alias", "note", "path", "link", "type", "published", "parent_id", "level", "component_id", "checked_out", "checked_out_time", "browserNav", "access", "img", "template_style_id", "params", "lft", "rgt", "home", "language", "client_id", "publish_up", "publish_down")
+SELECT 'main', 'com_messages_manager', 'Private Messages', '', 'Messaging/Private Messages', 'index.php?option=com_messages&view=messages', 'component', 1, 10, 2, "extension_id", 0, NULL, 0, 0, 'class:messages-add', 0, '', 18, 19, 0, '*', 1, NULL, NULL FROM "#__extensions" WHERE "name" = 'com_messages';
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_admin/sql/updates/postgresql/4.0.0-2019-09-22.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-09-22.sql
new file mode 100644
index 0000000000000..517cd37548144
--- /dev/null
+++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-09-22.sql
@@ -0,0 +1 @@
+ALTER TABLE "#__messages" ALTER COLUMN "date_time" DROP DEFAULT;
diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-09-23.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-09-23.sql
new file mode 100644
index 0000000000000..9b99ebe5874fb
--- /dev/null
+++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-09-23.sql
@@ -0,0 +1,4 @@
+ALTER TABLE "#__redirect_links" ALTER COLUMN "created_date" DROP DEFAULT;
+ALTER TABLE "#__redirect_links" ALTER COLUMN "modified_date" DROP DEFAULT;
+
+UPDATE "#__redirect_links" SET "modified_date" = "created_date" WHERE "modified_date" = '1970-01-01 00:00:00';
diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-09-24.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-09-24.sql
new file mode 100644
index 0000000000000..fadf8a2e693ee
--- /dev/null
+++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-09-24.sql
@@ -0,0 +1 @@
+ALTER TABLE "#__action_logs" ALTER COLUMN "log_date" DROP DEFAULT;
diff --git a/administrator/components/com_associations/Field/ItemtypeField.php b/administrator/components/com_associations/Field/ItemtypeField.php
index cdbe2f89887d1..36da82d7399a6 100644
--- a/administrator/components/com_associations/Field/ItemtypeField.php
+++ b/administrator/components/com_associations/Field/ItemtypeField.php
@@ -11,18 +11,16 @@
defined('JPATH_BASE') or die;
-use Joomla\CMS\Form\FormHelper;
+use Joomla\CMS\Form\Field\GroupedlistField;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\Component\Associations\Administrator\Helper\AssociationsHelper;
-FormHelper::loadFieldClass('groupedlist');
-
/**
* A drop down containing all component item types that implement associations.
*
* @since 3.7.0
*/
-class ItemtypeField extends \JFormFieldGroupedList
+class ItemtypeField extends GroupedlistField
{
/**
* The form field type.
diff --git a/administrator/components/com_associations/View/Association/HtmlView.php b/administrator/components/com_associations/View/Association/HtmlView.php
index 7d347567005bf..3569ef1207081 100644
--- a/administrator/components/com_associations/View/Association/HtmlView.php
+++ b/administrator/components/com_associations/View/Association/HtmlView.php
@@ -11,13 +11,21 @@
defined('_JEXEC') or die;
+use Joomla\CMS\Application\AdministratorApplication;
use Joomla\CMS\Factory;
+use Joomla\CMS\Form\Form;
use Joomla\CMS\Language\Text;
+use Joomla\CMS\MVC\View\GenericDataException;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
+use Joomla\CMS\Object\CMSObject;
+use Joomla\CMS\Pagination\Pagination;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\Component\Associations\Administrator\Helper\AssociationsHelper;
+use Joomla\Component\Associations\Administrator\Model\AssociationModel;
+use Joomla\Input\Input;
+use Joomla\Registry\Registry;
use Joomla\Utilities\ArrayHelper;
/**
@@ -34,12 +42,12 @@ class HtmlView extends BaseHtmlView
*
* @since 3.7.0
*/
- protected $items;
+ protected $items = [];
/**
* The pagination object
*
- * @var \Joomla\CMS\Pagination\Pagination
+ * @var Pagination
*
* @since 3.7.0
*/
@@ -48,7 +56,7 @@ class HtmlView extends BaseHtmlView
/**
* The model state
*
- * @var object
+ * @var CMSObject
*
* @since 3.7.0
*/
@@ -57,11 +65,147 @@ class HtmlView extends BaseHtmlView
/**
* Selected item type properties.
*
- * @var \Joomla\Registry\Registry
+ * @var Registry
*
* @since 3.7.0
*/
- public $itemType = null;
+ protected $itemType;
+
+ /**
+ * The application
+ *
+ * @var AdministratorApplication
+ * @since 3.7.0
+ */
+ protected $app;
+
+ /**
+ * The ID of the reference language
+ *
+ * @var integer
+ * @since 3.7.0
+ */
+ protected $referenceId = 0;
+
+ /**
+ * The type name
+ *
+ * @var string
+ * @since 3.7.0
+ */
+ protected $typeName = '';
+
+ /**
+ * The reference language
+ *
+ * @var string
+ * @since 3.7.0
+ */
+ protected $referenceLanguage = '';
+
+ /**
+ * The title of the reference language
+ *
+ * @var string
+ * @since 3.7.0
+ */
+ protected $referenceTitle = '';
+
+ /**
+ * The value of the reference title
+ *
+ * @var string
+ * @since 3.7.0
+ */
+ protected $referenceTitleValue = '';
+
+ /**
+ * The URL to the edit screen
+ *
+ * @var string
+ * @since 3.7.0
+ */
+ protected $editUri = '';
+
+ /**
+ * The ID of the target field
+ *
+ * @var string
+ * @since 3.7.0
+ */
+ protected $targetId = '';
+
+ /**
+ * The target language
+ *
+ * @var string
+ * @since 3.7.0
+ */
+ protected $targetLanguage = '';
+
+ /**
+ * The source of the target field
+ *
+ * @var string
+ * @since 3.7.0
+ */
+ protected $defaultTargetSrc = '';
+
+ /**
+ * The action to perform for the target field
+ *
+ * @var string
+ * @since 3.7.0
+ */
+ protected $targetAction = '';
+
+ /**
+ * The title of the target field
+ *
+ * @var string
+ * @since 3.7.0
+ */
+ protected $targetTitle = '';
+
+ /**
+ * The edit form
+ *
+ * @var Form
+ * @since 3.7.0
+ */
+ protected $form;
+
+ /**
+ * Set if the option is set to save as copy
+ *
+ * @var boolean
+ * @since 3.7.0
+ */
+ private $save2copy = false;
+
+ /**
+ * The type of language
+ *
+ * @var Registry
+ * @since 3.7.0
+ */
+ private $type;
+
+ /**
+ * The supported types
+ *
+ * @var array
+ * @since 3.7.0
+ */
+ private $typeSupports = [];
+
+ /**
+ * The extension name
+ *
+ * @var string
+ * @since 3.7.0
+ */
+ private $extensionName = '';
/**
* Display the view
@@ -71,36 +215,42 @@ class HtmlView extends BaseHtmlView
* @return void
*
* @since 3.7.0
+ *
* @throws \Exception
*/
- public function display($tpl = null)
+ public function display($tpl = null): void
{
+ /** @var AssociationModel $model */
+ $model = $this->getModel();
+
// Check for errors.
- if (count($errors = $this->get('Errors')))
+ if (count($errors = $model->getErrors()))
{
- throw new \Exception(implode("\n", $errors), 500);
+ throw new GenericDataException(implode("\n", $errors), 500);
}
$this->app = Factory::getApplication();
- $this->form = $this->get('Form');
- $input = $this->app->input;
+ $this->form = $model->getForm();
+ /** @var Input $input */
+ $input = $this->app->input;
$this->referenceId = $input->get('id', 0, 'int');
- list($extensionName, $typeName) = explode('.', $input->get('itemtype', '', 'string'), 2);
+ [$extensionName, $typeName] = explode('.', $input->get('itemtype', '', 'string'), 2);
+ /** @var Registry $extension */
$extension = AssociationsHelper::getSupportedExtension($extensionName);
$types = $extension->get('types');
if (array_key_exists($typeName, $types))
{
- $this->type = $types[$typeName];
- $this->typeSupports = array();
- $details = $this->type->get('details');
- $this->save2copy = false;
+ $this->type = $types[$typeName];
+ $this->typeSupports = [];
+ $details = $this->type->get('details');
+ $this->save2copy = false;
if (array_key_exists('support', $details))
{
- $support = $details['support'];
+ $support = $details['support'];
$this->typeSupports = $support;
}
@@ -112,14 +262,15 @@ public function display($tpl = null)
$this->extensionName = $extensionName;
$this->typeName = $typeName;
- $this->itemtype = $extensionName . '.' . $typeName;
+ $this->itemType = $extensionName . '.' . $typeName;
$languageField = AssociationsHelper::getTypeFieldName($extensionName, $typeName, 'language');
$referenceId = $input->get('id', 0, 'int');
$reference = ArrayHelper::fromObject(AssociationsHelper::getItem($extensionName, $typeName, $referenceId));
- $this->referenceLanguage = $reference[$languageField];
- $this->referenceTitle = AssociationsHelper::getTypeFieldName($extensionName, $typeName, 'title');
+ $this->referenceLanguage = $reference[$languageField];
+ $this->referenceTitle = AssociationsHelper::getTypeFieldName($extensionName, $typeName, 'title');
+ $this->referenceTitleValue = $reference[$this->referenceTitle];
// Check for special case category
$typeNameExploded = explode('.', $typeName);
@@ -133,21 +284,21 @@ public function display($tpl = null)
$extensionName .= '.' . implode('.', $typeNameExploded);
}
- $options = array(
+ $options = [
'option' => 'com_categories',
'view' => 'category',
'extension' => $extensionName,
'tmpl' => 'component',
- );
+ ];
}
else
{
- $options = array(
+ $options = [
'option' => $extensionName,
'view' => $typeName,
'extension' => $extensionName,
'tmpl' => 'component',
- );
+ ];
}
// Reference and target edit links.
@@ -162,19 +313,18 @@ public function display($tpl = null)
if ($target = $input->get('target', '', 'string'))
{
- $matches = preg_split("#[\:]+#", $target);
- $this->targetAction = $matches[2];
- $this->targetId = $matches[1];
- $this->targetLanguage = $matches[0];
- $this->targetTitle = AssociationsHelper::getTypeFieldName($extensionName, $typeName, 'title');
- $task = $typeName . '.' . $this->targetAction;
-
- /*
+ $matches = preg_split("#[\:]+#", $target);
+ $this->targetAction = $matches[2];
+ $this->targetId = $matches[1];
+ $this->targetLanguage = $matches[0];
+ $this->targetTitle = AssociationsHelper::getTypeFieldName($extensionName, $typeName, 'title');
+ $task = $typeName . '.' . $this->targetAction;
+
+ /**
* Let's put the target src into a variable to use in the javascript code
- * to avoid race conditions when the reference iframe loads.
+ * to avoid race conditions when the reference iframe loads.
*/
- $document = Factory::getDocument();
- $document->addScriptOptions('targetSrc', Route::_($this->editUri . '&task=' . $task . '&id=' . (int) $this->targetId));
+ $this->document->addScriptOptions('targetSrc', Route::_($this->editUri . '&task=' . $task . '&id=' . (int) $this->targetId));
$this->form->setValue('itemlanguage', '', $this->targetLanguage . ':' . $this->targetId . ':' . $this->targetAction);
}
@@ -189,11 +339,13 @@ public function display($tpl = null)
* @return void
*
* @since 3.7.0
+ *
+ * @throws \Exception
*/
- protected function addToolbar()
+ protected function addToolbar(): void
{
// Hide main menu.
- Factory::getApplication()->input->set('hidemainmenu', 1);
+ $this->app->input->set('hidemainmenu', 1);
$helper = AssociationsHelper::getExtensionHelper($this->extensionName);
$title = $helper->getTypeTitle($this->typeName);
@@ -205,9 +357,16 @@ protected function addToolbar()
$languageKey = strtoupper($this->extensionName) . '_CATEGORIES';
}
- ToolbarHelper::title(Text::sprintf('COM_ASSOCIATIONS_TITLE_EDIT', Text::_($this->extensionName), Text::_($languageKey)), 'contract assoc');
+ ToolbarHelper::title(
+ Text::sprintf(
+ 'COM_ASSOCIATIONS_TITLE_EDIT',
+ Text::_($this->extensionName),
+ Text::_($languageKey)
+ ),
+ 'language assoc'
+ );
- $bar = Toolbar::getInstance('toolbar');
+ $bar = Toolbar::getInstance();
$bar->appendButton(
'Custom', '