diff --git a/.drone.yml b/.drone.yml index 8feac298fb2f2..cdfc39c151401 100644 --- a/.drone.yml +++ b/.drone.yml @@ -12,7 +12,8 @@ steps: path: /tmp/composer-cache commands: - composer validate --no-check-all --strict - - composer install --no-progress + - composer install --no-progress --no-suggest + - patch -N -p0 < tests/patch/phpunit8_php8_match.patch || echo "Ignore this error." - name: phpcs image: joomlaprojects/docker-images:php7.2 @@ -56,13 +57,13 @@ steps: - php -v - ./libraries/vendor/bin/phpunit --testsuite Unit -# - name: php81-unit -# depends_on: [ phpcs ] -# image: joomlaprojects/docker-images:php8.1 -# failure: ignore -# commands: -# - php -v -# - ./libraries/vendor/bin/phpunit --testsuite Unit + - name: php81-unit + depends_on: [ phpcs ] + image: joomlaprojects/docker-images:php8.1 + failure: ignore + commands: + - php -v + - ./libraries/vendor/bin/phpunit --testsuite Unit - name: php72-integration depends_on: [ npm ] @@ -414,11 +415,11 @@ steps: path: /reference when: branch: - - 4.1-dev + - 4.2-dev --- kind: signature -hmac: 15e1abb49597a83c250c8785948aa9fa0c6d93ec88b03e45c30d8050b338ea5d +hmac: adfaa112f82d0487b292e9b22400b04abfbf56eb44516bc764abc1804a6f472b ... diff --git a/README.md b/README.md index d9ff48d2c9ef4..7217e605a596c 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,8 @@ Overview --------------------- * This is the source of Joomla! 4.x. * Joomla's [Official website](https://www.joomla.org). -* Joomla! 4.1 [version history](https://docs.joomla.org/Special:MyLanguage/Joomla_4.1_version_history). -* Detailed changes are in the [changelog](https://github.com/joomla/joomla-cms/commits/4.1-dev). +* Joomla! 4.2 [version history](https://docs.joomla.org/Special:MyLanguage/Joomla_4.2_version_history). +* Detailed changes are in the [changelog](https://github.com/joomla/joomla-cms/commits/4.2-dev). What is Joomla? --------------------- @@ -45,9 +45,9 @@ git clone https://github.com/joomla/joomla-cms.git ```bash cd joomla-cms ``` -- Go to the 4.1-dev branch: +- Go to the 4.2-dev branch: ```bash -git checkout 4.1-dev +git checkout 4.2-dev ``` - Install all the needed composer packages: ```bash diff --git a/README.txt b/README.txt index c7bc8faad2078..d36d3afafc030 100644 --- a/README.txt +++ b/README.txt @@ -3,8 +3,8 @@ Joomla! CMS™ 1- Overview * This is a Joomla! 4.x installation/upgrade package. * Joomla! Official site: https://www.joomla.org - * Joomla! 4.1 version history - https://docs.joomla.org/Special:MyLanguage/Joomla_4.1_version_history - * Detailed changes in the Changelog: https://github.com/joomla/joomla-cms/commits/4.1-dev + * Joomla! 4.2 version history - https://docs.joomla.org/Special:MyLanguage/Joomla_4.2_version_history + * Detailed changes in the Changelog: https://github.com/joomla/joomla-cms/commits/4.2-dev 2- What is Joomla? * Joomla! is a Content Management System (CMS) which enables you to build websites and powerful online applications. diff --git a/administrator/components/com_actionlogs/config.xml b/administrator/components/com_actionlogs/config.xml index bfb6c100dca6d..c8c6c932511c4 100644 --- a/administrator/components/com_actionlogs/config.xml +++ b/administrator/components/com_actionlogs/config.xml @@ -28,6 +28,7 @@ type="logtype" label="COM_ACTIONLOGS_LOG_EXTENSIONS_LABEL" multiple="true" + layout="joomla.form.field.list-fancy-select" default="com_banners,com_cache,com_categories,com_checkin,com_config,com_contact,com_content,com_installer,com_media,com_menus,com_messages,com_modules,com_newsfeeds,com_plugins,com_redirect,com_scheduler,com_tags,com_templates,com_users" /> setQuery($query)->loadColumn(); - $options = array(); - $tmp = array('checked' => true); + $options = []; foreach ($extensions as $extension) { ActionlogsHelper::loadTranslationFiles($extension); - $option = HTMLHelper::_('select.option', $extension, Text::_($extension)); - $options[ApplicationHelper::stringURLSafe(Text::_($extension)) . '_' . $extension] = (object) array_merge($tmp, (array) $option); + $extensionName = Text::_($extension); + $options[ApplicationHelper::stringURLSafe($extensionName) . '_' . $extension] = HTMLHelper::_('select.option', $extension, $extensionName); } ksort($options); diff --git a/administrator/components/com_actionlogs/tmpl/actionlogs/default.php b/administrator/components/com_actionlogs/tmpl/actionlogs/default.php index c3230bceb87f5..aad8da2a54a64 100644 --- a/administrator/components/com_actionlogs/tmpl/actionlogs/default.php +++ b/administrator/components/com_actionlogs/tmpl/actionlogs/default.php @@ -24,6 +24,7 @@ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->document->getWebAssetManager(); $wa->useScript('keepalive') + ->useScript('table.columns') ->useScript('multiselect') ->useScript('com_actionlogs.admin-actionlogs'); diff --git a/administrator/components/com_admin/script.php b/administrator/components/com_admin/script.php index 7602f25031e6d..265ada359004a 100644 --- a/administrator/components/com_admin/script.php +++ b/administrator/components/com_admin/script.php @@ -7718,6 +7718,8 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false) '/libraries/vendor/tobscure/json-api/.git', // From 4.1.1 to 4.1.2 '/administrator/components/com_users/src/Field/PrimaryauthprovidersField.php', + // From 4.1.1 to 4.2.0 + '/libraries/src/Service/Provider/ApiRouter.php' ); $status['files_checked'] = $files; diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-03-05.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-03-05.sql index c025f92818264..39c703e6b5363 100644 --- a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-03-05.sql +++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-03-05.sql @@ -1,7 +1,13 @@ +-- The following statement was moved from below to here and modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +ALTER TABLE `#__extensions` DROP COLUMN `system_data` /** CAN FAIL **/; + -- From 4.0.0-2016-07-03.sql -INSERT INTO `#__extensions` (`name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `system_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES -('plg_behaviour_taggable', 'plugin', 'taggable', 'behaviour', 0, 1, 1, 0, '', '{}', '', '', 0, '0000-00-00 00:00:00', 0, 0), -('plg_behaviour_versionable', 'plugin', 'versionable', 'behaviour', 0, 1, 1, 0, '', '{}', '', '', 0, '0000-00-00 00:00:00', 0, 0); +-- The following statement was modified for 4.1.1 by removing the `system_data` column. +-- See https://github.com/joomla/joomla-cms/pull/37156 +INSERT INTO `#__extensions` (`name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES +('plg_behaviour_taggable', 'plugin', 'taggable', 'behaviour', 0, 1, 1, 0, '', '{}', '', 0, '0000-00-00 00:00:00', 0, 0), +('plg_behaviour_versionable', 'plugin', 'versionable', 'behaviour', 0, 1, 1, 0, '', '{}', '', 0, '0000-00-00 00:00:00', 0, 0); -- From 4.0.0-2016-09-22.sql DELETE FROM `#__extensions` WHERE `type` = 'library' AND `element` = 'phputf8'; @@ -10,17 +16,22 @@ DELETE FROM `#__extensions` WHERE `type` = 'library' AND `element` = 'phputf8'; DELETE FROM `#__extensions` WHERE `type` = 'plugin' AND `element` = 'p3p' AND `folder` = 'system'; -- From 4.0.0-2016-10-02.sql -ALTER TABLE `#__user_keys` DROP COLUMN `invalid`; +-- The following statement was modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +ALTER TABLE `#__user_keys` DROP COLUMN `invalid` /** CAN FAIL **/; -- -- Insert the new templates into the database. Set as home if the old template is the active one -- -INSERT INTO `#__extensions` (`name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `system_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES -('atum', 'template', 'atum', '', 1, 1, 1, 0, '{}', '{}', '', '', 0, '0000-00-00 00:00:00', 0, 0), -('cassiopeia', 'template', 'cassiopeia', '', 0, 1, 1, 0, '{}', '{}', '', '', 0, '0000-00-00 00:00:00', 0, 0); + +-- The following statement was modified for 4.1.1 by removing the `system_data` column. +-- See https://github.com/joomla/joomla-cms/pull/37156 +INSERT INTO `#__extensions` (`name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES +('atum', 'template', 'atum', '', 1, 1, 1, 0, '{}', '{}', '', 0, '0000-00-00 00:00:00', 0, 0), +('cassiopeia', 'template', 'cassiopeia', '', 0, 1, 1, 0, '{}', '{}', '', 0, '0000-00-00 00:00:00', 0, 0); -- The following statement had to be modified for 4.1 by adding the `inheritable` and `parent` columns. --- See https://github.com/joomla/joomla-cms/pull/36585 . +-- See https://github.com/joomla/joomla-cms/pull/36585 INSERT INTO `#__template_styles` (`template`, `client_id`, `home`, `title`, `inheritable`, `parent`, `params`) VALUES ('atum', 1, (CASE WHEN (SELECT b.`count` FROM (SELECT count(a.`id`) AS `count` FROM `#__template_styles` a WHERE a.`home` = '1' AND a.`client_id` = 1 AND a.`template` IN ('isis', 'hathor')) AS b) = 0 THEN '0' ELSE '1' END), 'atum - Default', 1, '', '{}'), ('cassiopeia', 0, (CASE WHEN (SELECT d.`count` FROM (SELECT count(c.`id`) AS `count` FROM `#__template_styles` c WHERE c.`home` = '1' AND c.`client_id` = 0 AND c.`template` IN ('protostar', 'beez3')) AS d) = 0 THEN '0' ELSE '1' END), 'cassiopeia - Default', 1, '', '{}'); @@ -49,7 +60,9 @@ DELETE FROM `#__template_styles` WHERE `template` = 'beez3' AND `client_id` = 0; DELETE FROM `#__extensions` WHERE `name` = 'mod_submenu'; -- From 4.0.0-2017-03-18.sql -ALTER TABLE `#__extensions` DROP COLUMN `system_data`; +-- The following statement was moved to the top for 4.1.1. +-- See https://github.com/joomla/joomla-cms/pull/37156 +-- ALTER TABLE `#__extensions` DROP COLUMN `system_data`; -- From 4.0.0-2017-04-25.sql INSERT INTO `#__extensions` (`name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES @@ -63,8 +76,10 @@ UPDATE `#__menu` SET `link` = 'index.php?option=com_config&view=config' WHERE `l UPDATE `#__menu` SET `link` = 'index.php?option=com_config&view=templates' WHERE `link` = 'index.php?option=com_config&view=templates&controller=config.display.templates'; -- From 4.0.0-2017-06-03.sql -ALTER TABLE `#__extensions` ADD COLUMN `changelogurl` text AFTER `element`; -ALTER TABLE `#__updates` ADD COLUMN `changelogurl` text AFTER `infourl`; +-- The following two statements were modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +ALTER TABLE `#__extensions` ADD COLUMN `changelogurl` text AFTER `element` /** CAN FAIL **/; +ALTER TABLE `#__updates` ADD COLUMN `changelogurl` text AFTER `infourl` /** CAN FAIL **/; -- From 4.0.0-2017-10-10.sql INSERT INTO `#__extensions` (`name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES 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 7c0a7e2f5b990..12bdd47ccc6fa 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 @@ -33,7 +33,9 @@ CREATE TABLE IF NOT EXISTS `#__workflows` ( -- Dumping data for table `#__workflows` -- -INSERT INTO `#__workflows` (`id`, `asset_id`, `published`, `title`, `description`, `extension`, `default`, `ordering`, `created`, `created_by`, `modified`, `modified_by`, `checked_out_time`, `checked_out`) VALUES +-- The following statement was modified for 4.1.1 by adding the "IGNORE" keyword. +-- See https://github.com/joomla/joomla-cms/pull/37156 +INSERT IGNORE INTO `#__workflows` (`id`, `asset_id`, `published`, `title`, `description`, `extension`, `default`, `ordering`, `created`, `created_by`, `modified`, `modified_by`, `checked_out_time`, `checked_out`) VALUES (1, 0, 1, 'COM_WORKFLOW_BASIC_WORKFLOW', '', 'com_content.article', 1, 1, CURRENT_TIMESTAMP(), 0, CURRENT_TIMESTAMP(), 0, NULL, 0); -- @@ -78,7 +80,9 @@ 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`, `default`, `checked_out_time`, `checked_out`) VALUES +-- The following statement was modified for 4.1.1 by adding the "IGNORE" keyword. +-- See https://github.com/joomla/joomla-cms/pull/37156 +INSERT IGNORE INTO `#__workflow_stages` (`id`, `asset_id`, `ordering`, `workflow_id`, `published`, `title`, `description`, `default`, `checked_out_time`, `checked_out`) VALUES (1, 0, 1, 1, 1, 'COM_WORKFLOW_BASIC_STAGE', '', 1, NULL, 0); -- @@ -111,7 +115,9 @@ 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`, `options`, `checked_out_time`, `checked_out`) VALUES +-- The following statement was modified for 4.1.1 by adding the "IGNORE" keyword. +-- See https://github.com/joomla/joomla-cms/pull/37156 +INSERT IGNORE INTO `#__workflow_transitions` (`id`, `asset_id`, `published`, `ordering`, `workflow_id`, `title`, `description`, `from_stage_id`, `to_stage_id`, `options`, `checked_out_time`, `checked_out`) VALUES (1, 0, 1, 1, 1, 'Unpublish', '', -1, 1, '{"publishing":"0"}', NULL, 0), (2, 0, 1, 2, 1, 'Publish', '', -1, 1, '{"publishing":"1"}', NULL, 0), (3, 0, 1, 3, 1, 'Trash', '', -1, 1, '{"publishing":"-2"}', NULL, 0), @@ -137,5 +143,8 @@ INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`, -- -- Creating Associations for existing content -- -INSERT INTO `#__workflow_associations` (`item_id`, `stage_id`, `extension`) + +-- The following statement was modified for 4.1.1 by adding the "IGNORE" keyword. +-- See https://github.com/joomla/joomla-cms/pull/37156 +INSERT IGNORE INTO `#__workflow_associations` (`item_id`, `stage_id`, `extension`) SELECT `id`, 1, 'com_content.article' FROM `#__content`; 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 426ae323ba248..fe33fa3f8b096 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 @@ -20,11 +20,15 @@ ALTER TABLE `#__finder_links` MODIFY `publish_start_date` datetime NULL DEFAULT ALTER TABLE `#__finder_links` MODIFY `publish_end_date` datetime NULL DEFAULT NULL; ALTER TABLE `#__finder_links` MODIFY `start_date` datetime NULL DEFAULT NULL; ALTER TABLE `#__finder_links` MODIFY `end_date` datetime NULL DEFAULT NULL; -ALTER TABLE `#__finder_links` ADD INDEX `idx_language` (`language`); +-- The following statement was modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +ALTER TABLE `#__finder_links` ADD INDEX `idx_language` (`language`) /** CAN FAIL **/; ALTER TABLE `#__finder_links` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE `#__finder_links` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; -CREATE TABLE `#__finder_links_terms` ( +-- The following statement was modified for 4.1.1 by adding the "IF NOT EXISTS" keywords. +-- See https://github.com/joomla/joomla-cms/pull/37156 +CREATE TABLE IF NOT EXISTS `#__finder_links_terms` ( `link_id` INT UNSIGNED NOT NULL, `term_id` INT UNSIGNED NOT NULL, `weight` FLOAT UNSIGNED NOT NULL DEFAULT 0, @@ -33,22 +37,24 @@ CREATE TABLE `#__finder_links_terms` ( INDEX `idx_link_term_weight` (`link_id`, `term_id`, `weight`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; -DROP TABLE `#__finder_links_terms0`; -DROP TABLE `#__finder_links_terms1`; -DROP TABLE `#__finder_links_terms2`; -DROP TABLE `#__finder_links_terms3`; -DROP TABLE `#__finder_links_terms4`; -DROP TABLE `#__finder_links_terms5`; -DROP TABLE `#__finder_links_terms6`; -DROP TABLE `#__finder_links_terms7`; -DROP TABLE `#__finder_links_terms8`; -DROP TABLE `#__finder_links_terms9`; -DROP TABLE `#__finder_links_termsa`; -DROP TABLE `#__finder_links_termsb`; -DROP TABLE `#__finder_links_termsc`; -DROP TABLE `#__finder_links_termsd`; -DROP TABLE `#__finder_links_termse`; -DROP TABLE `#__finder_links_termsf`; +-- The following 16 statements were modified for 4.1.1 by adding the "IF EXISTS" keywords. +-- See https://github.com/joomla/joomla-cms/pull/37156 +DROP TABLE IF EXISTS `#__finder_links_terms0`; +DROP TABLE IF EXISTS `#__finder_links_terms1`; +DROP TABLE IF EXISTS `#__finder_links_terms2`; +DROP TABLE IF EXISTS `#__finder_links_terms3`; +DROP TABLE IF EXISTS `#__finder_links_terms4`; +DROP TABLE IF EXISTS `#__finder_links_terms5`; +DROP TABLE IF EXISTS `#__finder_links_terms6`; +DROP TABLE IF EXISTS `#__finder_links_terms7`; +DROP TABLE IF EXISTS `#__finder_links_terms8`; +DROP TABLE IF EXISTS `#__finder_links_terms9`; +DROP TABLE IF EXISTS `#__finder_links_termsa`; +DROP TABLE IF EXISTS `#__finder_links_termsb`; +DROP TABLE IF EXISTS `#__finder_links_termsc`; +DROP TABLE IF EXISTS `#__finder_links_termsd`; +DROP TABLE IF EXISTS `#__finder_links_termse`; +DROP TABLE IF EXISTS `#__finder_links_termsf`; CREATE TABLE IF NOT EXISTS `#__finder_logging` ( `searchterm` VARCHAR(255) NOT NULL DEFAULT '', @@ -62,7 +68,9 @@ CREATE TABLE IF NOT EXISTS `#__finder_logging` ( ALTER TABLE `#__finder_logging` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE `#__finder_logging` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; -DROP TABLE `#__finder_taxonomy`; +-- The following statement was modified for 4.1.1 by adding the "IF EXISTS" keywords. +-- See https://github.com/joomla/joomla-cms/pull/37156 +DROP TABLE IF EXISTS `#__finder_taxonomy`; CREATE TABLE IF NOT EXISTS `#__finder_taxonomy` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `parent_id` INT UNSIGNED NOT NULL DEFAULT '0', @@ -97,14 +105,18 @@ ALTER TABLE `#__finder_terms` CHANGE `language` `language` CHAR(7) NOT NULL DEFA ALTER TABLE `#__finder_terms` MODIFY `term` varchar(75) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL; ALTER TABLE `#__finder_terms` MODIFY `stem` varchar(75) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT ''; ALTER TABLE `#__finder_terms` MODIFY `soundex` varchar(75) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT ''; -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`); +-- The following 4 statements were modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +ALTER TABLE `#__finder_terms` DROP INDEX `idx_term` /** CAN FAIL **/; +ALTER TABLE `#__finder_terms` ADD INDEX `idx_stem` (`stem`) /** CAN FAIL **/; +ALTER TABLE `#__finder_terms` ADD INDEX `idx_language` (`language`) /** CAN FAIL **/; +ALTER TABLE `#__finder_terms` ADD UNIQUE INDEX `idx_term_language` (`term`, `language`) /** CAN FAIL **/; ALTER TABLE `#__finder_terms` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; DROP TABLE IF EXISTS `#__finder_terms_common`; -CREATE TABLE `#__finder_terms_common` ( +-- The following statement was modified for 4.1.1 by adding the "IF NOT EXISTS" keywords. +-- See https://github.com/joomla/joomla-cms/pull/37156 +CREATE TABLE IF NOT EXISTS `#__finder_terms_common` ( `term` varchar(75) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '', `language` char(7) NOT NULL DEFAULT '', `custom` int NOT NULL DEFAULT '0', @@ -292,13 +304,17 @@ ALTER TABLE `#__finder_tokens` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_ ALTER TABLE `#__finder_tokens` CHANGE `language` `language` CHAR(7) NOT NULL DEFAULT '' AFTER `context`; ALTER TABLE `#__finder_tokens` MODIFY `term` varchar(75) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL; ALTER TABLE `#__finder_tokens` MODIFY `stem` varchar(75) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT ''; -ALTER TABLE `#__finder_tokens` ADD INDEX `idx_stem` (`stem`); -ALTER TABLE `#__finder_tokens` ADD INDEX `idx_language` (`language`); +-- The following 2 statements were modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +ALTER TABLE `#__finder_tokens` ADD INDEX `idx_stem` (`stem`) /** CAN FAIL **/; +ALTER TABLE `#__finder_tokens` ADD INDEX `idx_language` (`language`) /** CAN FAIL **/; ALTER TABLE `#__finder_tokens` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; TRUNCATE TABLE `#__finder_tokens_aggregate`; ALTER TABLE `#__finder_tokens_aggregate` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; -ALTER TABLE `#__finder_tokens_aggregate` DROP COLUMN `map_suffix`; +-- The following statement was modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +ALTER TABLE `#__finder_tokens_aggregate` DROP COLUMN `map_suffix` /** CAN FAIL **/; ALTER TABLE `#__finder_tokens_aggregate` CHANGE `language` `language` CHAR(7) NOT NULL DEFAULT '' AFTER `total_weight`; ALTER TABLE `#__finder_tokens_aggregate` MODIFY `term` varchar(75) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL; ALTER TABLE `#__finder_tokens_aggregate` MODIFY `stem` varchar(75) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT ''; 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 320dd3bcdb4e4..f4f75a8d67b79 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 @@ -6,7 +6,9 @@ ALTER TABLE `#__ucm_content` MODIFY `core_publish_up` datetime NULL DEFAULT NULL ALTER TABLE `#__ucm_content` MODIFY `core_publish_down` datetime NULL DEFAULT NULL; -- Only on MySQL: Update empty strings to null date before converting the column from varchar to datetime -UPDATE `#__ucm_content` SET `core_checked_out_time` = '0000-00-00 00:00:00' WHERE `core_checked_out_time` = ''; +-- The following statement was modified for 4.1.1 by adding a check for NULL and a type cast to CHAR. +-- See https://github.com/joomla/joomla-cms/pull/37156 +UPDATE `#__ucm_content` SET `core_checked_out_time` = '0000-00-00 00:00:00' WHERE `core_checked_out_time` IS NOT NULL AND CAST(`core_checked_out_time` AS char) = ''; ALTER TABLE `#__ucm_content` MODIFY `core_checked_out_time` datetime NULL DEFAULT NULL; diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-03-09.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-03-09.sql index 7c0e34b603f2d..9f44d2d965605 100644 --- a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-03-09.sql +++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-03-09.sql @@ -25,7 +25,10 @@ CREATE TABLE IF NOT EXISTS `#__mail_templates` ( 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"]}'); +-- The following statement was modified for 4.1.1 by adding the "IGNORE" keyword. +-- See https://github.com/joomla/joomla-cms/pull/37156 +INSERT IGNORE 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"]}'); -- From 4.0.0-2019-02-03.sql DELETE FROM `#__menu` WHERE `link` = 'index.php?option=com_postinstall' AND `menutype` = 'main'; 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 61c154232e5fe..5286991e56659 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,5 +1,7 @@ -ALTER TABLE `#__menu` ADD COLUMN `publish_up` datetime; -ALTER TABLE `#__menu` ADD COLUMN `publish_down` datetime; +-- The following two statements were modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +ALTER TABLE `#__menu` ADD COLUMN `publish_up` datetime /** CAN FAIL **/; +ALTER TABLE `#__menu` ADD COLUMN `publish_down` datetime /** CAN FAIL **/; ALTER TABLE `#__menu` MODIFY `checked_out_time` datetime NULL DEFAULT NULL; diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-05-20.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-05-20.sql index 7c030af4d2fa7..877147a6055ea 100644 --- a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-05-20.sql +++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-05-20.sql @@ -12,4 +12,6 @@ UPDATE `#__menu` SET `link`='index.php?option=com_tags&view=tags' WHERE `menutyp UPDATE `#__menu` SET `link`='index.php?option=com_associations&view=associations' WHERE `menutype`='main' AND `path`='Multilingual Associations'; -- From 4.0.0-2019-05-20.sql -ALTER TABLE `#__extensions` ADD COLUMN `note` varchar(255) AFTER `state`; +-- The following statement was modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +ALTER TABLE `#__extensions` ADD COLUMN `note` varchar(255) AFTER `state` /** CAN FAIL **/; 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 index 4dc1c3837c36d..bb35e1efa78b9 100644 --- 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 @@ -1,18 +1,24 @@ -- From 4.0.0-2019-07-14.sql -ALTER TABLE `#__contact_details` DROP COLUMN `xreference`; -ALTER TABLE `#__content` DROP COLUMN `xreference`; -ALTER TABLE `#__newsfeeds` DROP COLUMN `xreference`; +-- The following 3 statements were modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +ALTER TABLE `#__contact_details` DROP COLUMN `xreference` /** CAN FAIL **/; +ALTER TABLE `#__content` DROP COLUMN `xreference` /** CAN FAIL **/; +ALTER TABLE `#__newsfeeds` DROP COLUMN `xreference` /** CAN FAIL **/; -- From 4.0.0-2019-07-16.sql -- This has been removed as com_csp has been removed from the final build -- From 4.0.0-2019-08-03.sql -ALTER TABLE `#__update_sites` ADD COLUMN `checked_out` int unsigned NOT NULL DEFAULT 0; -ALTER TABLE `#__update_sites` ADD COLUMN `checked_out_time` datetime NULL DEFAULT NULL; +-- The following two statements were modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +ALTER TABLE `#__update_sites` ADD COLUMN `checked_out` int unsigned NOT NULL DEFAULT 0 /** CAN FAIL **/; +ALTER TABLE `#__update_sites` ADD COLUMN `checked_out_time` datetime NULL DEFAULT NULL /** CAN FAIL **/; -- From 4.0.0-2019-08-20.sql -ALTER TABLE `#__content_frontpage` ADD COLUMN `featured_up` datetime; -ALTER TABLE `#__content_frontpage` ADD COLUMN `featured_down` datetime; +-- The following two statements were modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +ALTER TABLE `#__content_frontpage` ADD COLUMN `featured_up` datetime /** CAN FAIL **/; +ALTER TABLE `#__content_frontpage` ADD COLUMN `featured_down` datetime /** CAN FAIL **/; -- From 4.0.0-2019-08-21.sql INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES @@ -32,5 +38,7 @@ INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`, (0, 'plg_webservices_users', 'plugin', 'users', 'webservices', 0, 1, 1, 0, '', '{}', '', 0, '0000-00-00 00:00:00', 0, 0); -- From 4.0.0-2019-09-13.sql -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`) +-- The following statement was modified for 4.1.1 by adding the "IGNORE" keyword. +-- See https://github.com/joomla/joomla-cms/pull/37156 +INSERT IGNORE 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-2020-03-25.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2020-03-25.sql index 5f72531aef0a6..a11fffdfdce5f 100644 --- a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2020-03-25.sql +++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2020-03-25.sql @@ -1,6 +1,8 @@ -- Add locked field to extensions table. ALTER TABLE `#__extensions` MODIFY `protected` tinyint NOT NULL DEFAULT 0 COMMENT 'Flag to indicate if the extension is protected. Protected extensions cannot be disabled.'; -ALTER TABLE `#__extensions` ADD COLUMN `locked` tinyint NOT NULL DEFAULT 0 COMMENT 'Flag to indicate if the extension is locked. Locked extensions cannot be uninstalled.'; +-- The following statement was modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +ALTER TABLE `#__extensions` ADD COLUMN `locked` tinyint NOT NULL DEFAULT 0 COMMENT 'Flag to indicate if the extension is locked. Locked extensions cannot be uninstalled.' /** CAN FAIL **/; -- Set all core extensions as locked extensions and unprotected them. UPDATE `#__extensions` diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2020-05-29.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2020-05-29.sql index f1b4f6e0c4cb1..8157ec80fb058 100644 --- a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2020-05-29.sql +++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2020-05-29.sql @@ -3,7 +3,9 @@ INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`, (0, 'plg_quickicon_downloadkey', 'plugin', 'downloadkey', 'quickicon', 0, 1, 1, 0, 1, '', '', '', 0, NULL, 0, 0); -- From 4.0.0-2020-04-16.sql -INSERT INTO `#__mail_templates` (`template_id`, `language`, `subject`, `body`, `htmlbody`, `attachments`, `params`) VALUES +-- The following statement was modified for 4.1.1 by adding the "IGNORE" keyword. +-- See https://github.com/joomla/joomla-cms/pull/37156 +INSERT IGNORE INTO `#__mail_templates` (`template_id`, `language`, `subject`, `body`, `htmlbody`, `attachments`, `params`) VALUES ('com_contact.mail', '', 'COM_CONTACT_ENQUIRY_SUBJECT', 'COM_CONTACT_ENQUIRY_TEXT', '', '', '{"tags":["sitename","name","email","subject","body","url","customfields"]}'), ('com_contact.mail.copy', '', 'COM_CONTACT_COPYSUBJECT_OF', 'COM_CONTACT_COPYTEXT_OF', '', '', '{"tags":["sitename","name","email","subject","body","url","customfields"]}'), ('com_users.massmail.mail', '', 'COM_USERS_MASSMAIL_MAIL_SUBJECT', 'COM_USERS_MASSMAIL_MAIL_BODY', '', '', '{"tags":["subject","body","subjectprefix","bodysuffix"]}'), @@ -13,14 +15,16 @@ INSERT INTO `#__mail_templates` (`template_id`, `language`, `subject`, `body`, ` ('plg_user_joomla.mail', '', 'PLG_USER_JOOMLA_NEW_USER_EMAIL_SUBJECT', 'PLG_USER_JOOMLA_NEW_USER_EMAIL_BODY', '', '', '{"tags":["name","sitename","url","username","password","email"]}'); -- From 4.0.0-2020-05-21.sql +-- The following 4 statements were modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 -- Renaming table -RENAME TABLE `#__ucm_history` TO `#__history`; +RENAME TABLE `#__ucm_history` TO `#__history` /** CAN FAIL **/; -- Rename ucm_item_id to item_id as the new primary identifier for the original content item -ALTER TABLE `#__history` CHANGE `ucm_item_id` `item_id` VARCHAR(50) NOT NULL AFTER `version_id`; +ALTER TABLE `#__history` CHANGE `ucm_item_id` `item_id` VARCHAR(50) NOT NULL AFTER `version_id` /** CAN FAIL **/; -- Extend the original field content with the alias of the content type -UPDATE #__history AS h INNER JOIN #__content_types AS c ON h.ucm_type_id = c.type_id SET h.item_id = CONCAT(c.type_alias, '.', h.item_id); +UPDATE #__history AS h INNER JOIN #__content_types AS c ON h.ucm_type_id = c.type_id SET h.item_id = CONCAT(c.type_alias, '.', h.item_id) /** CAN FAIL **/; -- Now we don't need the ucm_type_id anymore and drop it. -ALTER TABLE `#__history` DROP COLUMN `ucm_type_id`; +ALTER TABLE `#__history` DROP COLUMN `ucm_type_id` /** CAN FAIL **/; ALTER TABLE `#__history` MODIFY `save_date` datetime NOT NULL; -- From 4.0.0-2020-05-29.sql diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2020-12-20.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2020-12-20.sql index b7e64d065d352..7b0022e9b039c 100644 --- a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2020-12-20.sql +++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2020-12-20.sql @@ -1,5 +1,7 @@ -- From 4.0.0-2020-12-08.sql -INSERT INTO `#__mail_templates` (`template_id`, `language`, `subject`, `body`, `htmlbody`, `attachments`, `params`) VALUES +-- The following statement was modified for 4.1.1 by adding the "IGNORE" keyword. +-- See https://github.com/joomla/joomla-cms/pull/37156 +INSERT IGNORE INTO `#__mail_templates` (`template_id`, `language`, `subject`, `body`, `htmlbody`, `attachments`, `params`) VALUES ('com_actionlogs.notification', '', 'COM_ACTIONLOGS_EMAIL_SUBJECT', 'COM_ACTIONLOGS_EMAIL_BODY', 'COM_ACTIONLOGS_EMAIL_HTMLBODY', '', '{"tags":["message","date","extension"]}'), ('com_privacy.userdataexport', '', 'COM_PRIVACY_EMAIL_DATA_EXPORT_COMPLETED_BODY', 'COM_PRIVACY_EMAIL_DATA_EXPORT_COMPLETED_SUBJECT', '', '', '{"tags":["sitename","url"]}'), ('com_privacy.notification.export', '', 'COM_PRIVACY_EMAIL_REQUEST_SUBJECT_EXPORT_REQUEST', 'COM_PRIVACY_EMAIL_REQUEST_BODY_EXPORT_REQUEST', '', '', '{"tags":["sitename","url","tokenurl","formurl","token"]}'), diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2021-04-22.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2021-04-22.sql index 8f8a69da7c4f0..ddf5d6b301e8e 100644 --- a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2021-04-22.sql +++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2021-04-22.sql @@ -9,12 +9,16 @@ DELETE FROM `#__postinstall_messages` 'TPL_HATHOR_MESSAGE_POSTINSTALL_TITLE'); -- From 4.0.0-2021-04-11.sql -ALTER TABLE `#__fields` ADD COLUMN `only_use_in_subform` tinyint NOT NULL DEFAULT 0; +-- The following statement was modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +ALTER TABLE `#__fields` ADD COLUMN `only_use_in_subform` tinyint NOT NULL DEFAULT 0 /** CAN FAIL **/; -- From 4.0.0-2021-04-20.sql UPDATE `#__extensions` SET `name` = 'plg_fields_subform', `element` = 'subform' WHERE `name` = 'plg_fields_subfields' AND `type` = 'plugin' AND `element` = 'subfields' AND `folder` = 'fields' AND `client_id` = 0; UPDATE `#__fields` SET `type` = 'subform' WHERE `type` = 'subfields'; -- From 4.0.0-2021-04-22.sql -ALTER TABLE `#__mail_templates` ADD COLUMN `extension` varchar(127) NOT NULL DEFAULT '' AFTER `template_id`; +-- The following statement was modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +ALTER TABLE `#__mail_templates` ADD COLUMN `extension` varchar(127) NOT NULL DEFAULT '' AFTER `template_id` /** CAN FAIL **/; UPDATE `#__mail_templates` SET `extension` = SUBSTRING(`template_id`, 1, POSITION('.' IN `template_id`) - 1); diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2021-05-30.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2021-05-30.sql index 44f1ed73a71a5..8d5c4f31471d3 100644 --- a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2021-05-30.sql +++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2021-05-30.sql @@ -15,7 +15,9 @@ UPDATE `#__mail_templates` WHERE `template_id` = 'com_privacy.userdataexport'; -- From 4.0.0-2021-05-10.sql -ALTER TABLE `#__finder_taxonomy` ADD INDEX `idx_level` (`level`); +-- The following statement was modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +ALTER TABLE `#__finder_taxonomy` ADD INDEX `idx_level` (`level`) /** CAN FAIL **/; -- From 4.0.0-2021-05-21.sql UPDATE `#__modules` diff --git a/administrator/components/com_admin/sql/updates/mysql/4.1.0-2021-11-20.sql b/administrator/components/com_admin/sql/updates/mysql/4.1.0-2021-11-20.sql index a1ae75ba0b248..3997219855907 100644 --- a/administrator/components/com_admin/sql/updates/mysql/4.1.0-2021-11-20.sql +++ b/administrator/components/com_admin/sql/updates/mysql/4.1.0-2021-11-20.sql @@ -56,7 +56,9 @@ INSERT INTO `#__action_log_config` (`type_title`, `type_alias`, `id_holder`, `ti ('task', 'com_scheduler.task', 'id', 'title', '#__scheduler_tasks', 'PLG_ACTIONLOG_JOOMLA'); -- Add mail templates -INSERT INTO `#__mail_templates` (`template_id`, `extension`, `language`, `subject`, `body`, `htmlbody`, `attachments`, `params`) VALUES +-- The following statement was modified for 4.1.1 by adding the "IGNORE" keyword. +-- See https://github.com/joomla/joomla-cms/pull/37156 +INSERT IGNORE INTO `#__mail_templates` (`template_id`, `extension`, `language`, `subject`, `body`, `htmlbody`, `attachments`, `params`) VALUES ('plg_system_tasknotification.failure_mail', 'plg_system_tasknotification', '', 'PLG_SYSTEM_TASK_NOTIFICATION_FAILURE_MAIL_SUBJECT', 'PLG_SYSTEM_TASK_NOTIFICATION_FAILURE_MAIL_BODY', '', '', '{"tags": ["task_id", "task_title", "exit_code", "exec_data_time", "task_output"]}'), ('plg_system_tasknotification.fatal_recovery_mail', 'plg_system_tasknotification', '', 'PLG_SYSTEM_TASK_NOTIFICATION_FATAL_MAIL_SUBJECT', 'PLG_SYSTEM_TASK_NOTIFICATION_FATAL_MAIL_BODY', '', '', '{"tags": ["task_id", "task_title"]}'), ('plg_system_tasknotification.orphan_mail', 'plg_system_tasknotification', '', 'PLG_SYSTEM_TASK_NOTIFICATION_ORPHAN_MAIL_SUBJECT', 'PLG_SYSTEM_TASK_NOTIFICATION_ORPHAN_MAIL_BODY', '', '', '{"tags": ["task_id", "task_title"]}'), diff --git a/administrator/components/com_admin/sql/updates/mysql/4.1.0-2022-01-24.sql b/administrator/components/com_admin/sql/updates/mysql/4.1.0-2022-01-24.sql index 767ef9c33453e..6ab1149630713 100644 --- a/administrator/components/com_admin/sql/updates/mysql/4.1.0-2022-01-24.sql +++ b/administrator/components/com_admin/sql/updates/mysql/4.1.0-2022-01-24.sql @@ -1,2 +1,4 @@ -ALTER TABLE `#__redirect_links` DROP INDEX `idx_link_modifed`; -ALTER TABLE `#__redirect_links` ADD INDEX `idx_link_modified` (`modified_date`); +-- The following two statements were modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +ALTER TABLE `#__redirect_links` DROP INDEX `idx_link_modifed` /** CAN FAIL **/; +ALTER TABLE `#__redirect_links` ADD INDEX `idx_link_modified` (`modified_date`) /** CAN FAIL **/; diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-03-05.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-03-05.sql index ae03fbfcb7f35..783105def8318 100644 --- a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-03-05.sql +++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-03-05.sql @@ -1,7 +1,13 @@ +-- The following statement was moved from below to here and modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +ALTER TABLE "#__extensions" DROP COLUMN "system_data" /** CAN FAIL **/; + -- From 4.0.0-2016-07-03.sql -INSERT INTO "#__extensions" ("name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "custom_data", "system_data", "checked_out", "checked_out_time", "ordering", "state") VALUES -('plg_behaviour_taggable', 'plugin', 'taggable', 'behaviour', 0, 1, 1, 0, '', '{}', '', '', 0, '1970-01-01 00:00:00', 0, 0), -('plg_behaviour_versionable', 'plugin', 'versionable', 'behaviour', 0, 1, 1, 0, '', '{}', '', '', 0, '1970-01-01 00:00:00', 0, 0); +-- The following statement was modified for 4.1.1 by removing the "system_data" column. +-- See https://github.com/joomla/joomla-cms/pull/37156 +INSERT INTO "#__extensions" ("name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "custom_data", "checked_out", "checked_out_time", "ordering", "state") VALUES +('plg_behaviour_taggable', 'plugin', 'taggable', 'behaviour', 0, 1, 1, 0, '', '{}', '', 0, '1970-01-01 00:00:00', 0, 0), +('plg_behaviour_versionable', 'plugin', 'versionable', 'behaviour', 0, 1, 1, 0, '', '{}', '', 0, '1970-01-01 00:00:00', 0, 0); -- From 4.0.0-2016-09-22.sql DELETE FROM "#__extensions" WHERE "type" = 'library' AND "element" = 'phputf8'; @@ -10,17 +16,22 @@ DELETE FROM "#__extensions" WHERE "type" = 'library' AND "element" = 'phputf8'; DELETE FROM "#__extensions" WHERE "type" = 'plugin' AND "element" = 'p3p' AND "folder" = 'system'; -- From 4.0.0-2016-10-02.sql -ALTER TABLE "#__user_keys" DROP COLUMN "invalid"; +-- The following statement was modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +ALTER TABLE "#__user_keys" DROP COLUMN "invalid" /** CAN FAIL **/; -- -- Insert the new templates into the database. Set as home if the old template is the active one -- -INSERT INTO "#__extensions" ("name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "custom_data", "system_data", "checked_out", "checked_out_time", "ordering", "state") VALUES -('atum', 'template', 'atum', '', 1, 1, 1, 0, '{}', '{}', '', '', 0, '1970-01-01 00:00:00', 0, 0), -('cassiopeia', 'template', 'cassiopeia', '', 0, 1, 1, 0, '{}', '{}', '', '', 0, '1970-01-01 00:00:00', 0, 0); + +-- The following statement was modified for 4.1.1 by removing the "system_data" column. +-- See https://github.com/joomla/joomla-cms/pull/37156 +INSERT INTO "#__extensions" ("name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "custom_data", "checked_out", "checked_out_time", "ordering", "state") VALUES +('atum', 'template', 'atum', '', 1, 1, 1, 0, '{}', '{}', '', 0, '1970-01-01 00:00:00', 0, 0), +('cassiopeia', 'template', 'cassiopeia', '', 0, 1, 1, 0, '{}', '{}', '', 0, '1970-01-01 00:00:00', 0, 0); -- The following statement had to be modified for 4.1 by adding the "inheritable" and "parent" columns. --- See https://github.com/joomla/joomla-cms/pull/36585 . +-- See https://github.com/joomla/joomla-cms/pull/36585 INSERT INTO "#__template_styles" ("template", "client_id", "home", "title", "inheritable", "parent", "params") VALUES ('atum', 1, (CASE WHEN (SELECT b."count" FROM (SELECT count(a."id") AS "count" FROM "#__template_styles" a WHERE a."home" = '1' AND a."client_id" = 1 AND a."template" IN ('isis', 'hathor')) AS b) = 0 THEN '0' ELSE '1' END), 'atum - Default', 1, '', '{}'), ('cassiopeia', 0, (CASE WHEN (SELECT d."count" FROM (SELECT count(c."id") AS "count" FROM "#__template_styles" c WHERE c."home" = '1' AND c."client_id" = 0 AND c."template" IN ('protostar', 'beez3')) AS d) = 0 THEN '0' ELSE '1' END), 'cassiopeia - Default', 1, '', '{}'); @@ -49,7 +60,9 @@ DELETE FROM "#__extensions" WHERE "type" = 'template' AND "element" = 'beez3' AN DELETE FROM "#__extensions" WHERE "name" = 'mod_submenu'; -- From 4.0.0-2017-03-18.sql -ALTER TABLE "#__extensions" DROP COLUMN "system_data"; +-- The following statement was moved to the top for 4.1.1. +-- See https://github.com/joomla/joomla-cms/pull/37156 +-- ALTER TABLE "#__extensions" DROP COLUMN "system_data"; -- From 4.0.0-2017-04-25.sql INSERT INTO "#__extensions" ("name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "custom_data", "checked_out", "checked_out_time", "ordering", "state") VALUES @@ -63,8 +76,10 @@ UPDATE "#__menu" SET "link" = 'index.php?option=com_config&view=config' WHERE "l UPDATE "#__menu" SET "link" = 'index.php?option=com_config&view=templates' WHERE "link" = 'index.php?option=com_config&view=templates&controller=config.display.templates'; -- From 4.0.0-2017-06-03.sql -ALTER TABLE "#__extensions" ADD COLUMN "changelogurl" text; -ALTER TABLE "#__updates" ADD COLUMN "changelogurl" text; +-- The following two statements were modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +ALTER TABLE "#__extensions" ADD COLUMN "changelogurl" text /** CAN FAIL **/; +ALTER TABLE "#__updates" ADD COLUMN "changelogurl" text /** CAN FAIL **/; -- From 4.0.0-2017-10-10.sql INSERT INTO "#__extensions" ("name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "custom_data", "checked_out", "checked_out_time", "ordering", "state") VALUES 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 c2fe279465ad7..abf7949d65eef 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 @@ -20,18 +20,23 @@ CREATE TABLE IF NOT EXISTS "#__workflows" ( PRIMARY KEY ("id") ); -CREATE INDEX "#__workflows_idx_asset_id" ON "#__workflows" ("asset_id"); -CREATE INDEX "#__workflows_idx_title" ON "#__workflows" ("title"); -CREATE INDEX "#__workflows_idx_extension" ON "#__workflows" ("extension"); -CREATE INDEX "#__workflows_idx_default" ON "#__workflows" ("default"); -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"); - +-- The following 9 statements were modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +CREATE INDEX "#__workflows_idx_asset_id" ON "#__workflows" ("asset_id") /** CAN FAIL **/; +CREATE INDEX "#__workflows_idx_title" ON "#__workflows" ("title") /** CAN FAIL **/; +CREATE INDEX "#__workflows_idx_extension" ON "#__workflows" ("extension") /** CAN FAIL **/; +CREATE INDEX "#__workflows_idx_default" ON "#__workflows" ("default") /** CAN FAIL **/; +CREATE INDEX "#__workflows_idx_created" ON "#__workflows" ("created") /** CAN FAIL **/; +CREATE INDEX "#__workflows_idx_created_by" ON "#__workflows" ("created_by") /** CAN FAIL **/; +CREATE INDEX "#__workflows_idx_modified" ON "#__workflows" ("modified") /** CAN FAIL **/; +CREATE INDEX "#__workflows_idx_modified_by" ON "#__workflows" ("modified_by") /** CAN FAIL **/; +CREATE INDEX "#__workflows_idx_checked_out" ON "#__workflows" ("checked_out") /** CAN FAIL **/; + +-- The following statement was modified for 4.1.1 by adding the "ON CONFLICT" clause. +-- See https://github.com/joomla/joomla-cms/pull/37156 INSERT INTO "#__workflows" ("id", "asset_id", "published", "title", "description", "extension", "default", "ordering", "created", "created_by", "modified", "modified_by", "checked_out_time", "checked_out") VALUES -(1, 0, 1, 'COM_WORKFLOW_BASIC_WORKFLOW', '', 'com_content.article', 1, 1, CURRENT_TIMESTAMP, 0, CURRENT_TIMESTAMP, 0, NULL, 0); +(1, 0, 1, 'COM_WORKFLOW_BASIC_WORKFLOW', '', 'com_content.article', 1, 1, CURRENT_TIMESTAMP, 0, CURRENT_TIMESTAMP, 0, NULL, 0) +ON CONFLICT DO NOTHING; SELECT setval('#__workflows_id_seq', 2, false); @@ -45,10 +50,12 @@ CREATE TABLE IF NOT EXISTS "#__workflow_associations" ( "extension" varchar(50) NOT NULL, PRIMARY KEY ("item_id", "extension") ); -CREATE INDEX "#__workflow_associations_idx_item_stage_extension" ON "#__workflow_associations" ("item_id", "stage_id", "extension"); -CREATE INDEX "#__workflow_associations_idx_item_id" ON "#__workflow_associations" ("item_id"); -CREATE INDEX "#__workflow_associations_idx_stage_id" ON "#__workflow_associations" ("stage_id"); -CREATE INDEX "#__workflow_associations_idx_extension" ON "#__workflow_associations" ("extension"); +-- The following 4 statements were modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +CREATE INDEX "#__workflow_associations_idx_item_stage_extension" ON "#__workflow_associations" ("item_id", "stage_id", "extension") /** CAN FAIL **/; +CREATE INDEX "#__workflow_associations_idx_item_id" ON "#__workflow_associations" ("item_id") /** CAN FAIL **/; +CREATE INDEX "#__workflow_associations_idx_stage_id" ON "#__workflow_associations" ("stage_id") /** CAN FAIL **/; +CREATE INDEX "#__workflow_associations_idx_extension" ON "#__workflow_associations" ("extension") /** CAN FAIL **/; COMMENT ON COLUMN "#__workflow_associations"."item_id" IS 'Extension table id value'; COMMENT ON COLUMN "#__workflow_associations"."stage_id" IS 'Foreign Key to #__workflow_stages.id'; @@ -70,18 +77,23 @@ CREATE TABLE IF NOT EXISTS "#__workflow_stages" ( "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"); +-- The following 5 statements were modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +CREATE INDEX "#__workflow_stages_idx_workflow_id" ON "#__workflow_stages" ("workflow_id") /** CAN FAIL **/; +CREATE INDEX "#__workflow_stages_idx_title" ON "#__workflow_stages" ("title") /** CAN FAIL **/; +CREATE INDEX "#__workflow_stages_idx_asset_id" ON "#__workflow_stages" ("asset_id") /** CAN FAIL **/; +CREATE INDEX "#__workflow_stages_idx_default" ON "#__workflow_stages" ("default") /** CAN FAIL **/; +CREATE INDEX "#__workflow_stages_idx_checked_out" ON "#__workflow_stages" ("checked_out") /** CAN FAIL **/; -- -- Dumping data for table "#__workflow_stages" -- +-- The following statement was modified for 4.1.1 by adding the "ON CONFLICT" clause. +-- See https://github.com/joomla/joomla-cms/pull/37156 INSERT INTO "#__workflow_stages" ("id", "asset_id", "ordering", "workflow_id", "published", "title", "description", "default", "checked_out_time", "checked_out") VALUES -(1, 0, 1, 1, 1, 'COM_WORKFLOW_BASIC_STAGE', '', 1, NULL, 0); +(1, 0, 1, 1, 1, 'COM_WORKFLOW_BASIC_STAGE', '', 1, NULL, 0) +ON CONFLICT DO NOTHING; SELECT setval('#__workflow_stages_id_seq', 2, false); @@ -104,13 +116,17 @@ CREATE TABLE IF NOT EXISTS "#__workflow_transitions" ( "checked_out" bigint DEFAULT 0 NOT NULL, PRIMARY KEY ("id") ); -CREATE INDEX "#__workflow_transitions_idx_title" ON "#__workflow_transitions" ("title"); -CREATE INDEX "#__workflow_transitions_idx_asset_id" ON "#__workflow_transitions" ("asset_id"); -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"); - +-- The following 6 statements were modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +CREATE INDEX "#__workflow_transitions_idx_title" ON "#__workflow_transitions" ("title") /** CAN FAIL **/; +CREATE INDEX "#__workflow_transitions_idx_asset_id" ON "#__workflow_transitions" ("asset_id") /** CAN FAIL **/; +CREATE INDEX "#__workflow_transitions_idx_from_stage_id" ON "#__workflow_transitions" ("from_stage_id") /** CAN FAIL **/; +CREATE INDEX "#__workflow_transitions_idx_to_stage_id" ON "#__workflow_transitions" ("to_stage_id") /** CAN FAIL **/; +CREATE INDEX "#__workflow_transitions_idx_workflow_id" ON "#__workflow_transitions" ("workflow_id") /** CAN FAIL **/; +CREATE INDEX "#__workflow_transitions_idx_checked_out" ON "#__workflow_transitions" ("checked_out") /** CAN FAIL **/; + +-- The following statement was modified for 4.1.1 by adding the "ON CONFLICT" clause. +-- See https://github.com/joomla/joomla-cms/pull/37156 INSERT INTO "#__workflow_transitions" ("id", "asset_id", "published", "ordering", "workflow_id", "title", "description", "from_stage_id", "to_stage_id", "options", "checked_out_time", "checked_out") VALUES (1, 0, 1, 1, 1, 'Unpublish', '', -1, 1, '{"publishing":"0"}', NULL, 0), (2, 0, 1, 2, 1, 'Publish', '', -1, 1, '{"publishing":"1"}', NULL, 0), @@ -118,7 +134,8 @@ INSERT INTO "#__workflow_transitions" ("id", "asset_id", "published", "ordering" (4, 0, 1, 4, 1, 'Archive', '', -1, 1, '{"publishing":"2"}', NULL, 0), (5, 0, 1, 5, 1, 'Feature', '', -1, 1, '{"featuring":"1"}', NULL, 0), (6, 0, 1, 6, 1, 'Unfeature', '', -1, 1, '{"featuring":"0"}', NULL, 0), -(7, 0, 1, 7, 1, 'Publish & Feature', '', -1, 1, '{"publishing":"1","featuring":"1"}', NULL, 0); +(7, 0, 1, 7, 1, 'Publish & Feature', '', -1, 1, '{"publishing":"1","featuring":"1"}', NULL, 0) +ON CONFLICT DO NOTHING; SELECT setval('#__workflow_transitions_id_seq', 8, false); @@ -139,5 +156,9 @@ INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", -- -- Creating Associations for existing content -- + +-- The following statement was modified for 4.1.1 by adding the "ON CONFLICT" clause. +-- See https://github.com/joomla/joomla-cms/pull/37156 INSERT INTO "#__workflow_associations" ("item_id", "stage_id", "extension") -SELECT "id", 1, 'com_content.article' FROM "#__content"; +SELECT "id", 1, 'com_content.article' FROM "#__content" +ON CONFLICT DO NOTHING; diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-07-19.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-07-19.sql index 57d106caf60d7..1c9f5d31ccc10 100644 --- a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-07-19.sql +++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-07-19.sql @@ -21,8 +21,10 @@ CREATE TABLE IF NOT EXISTS "#__template_overrides" ( "modified_date" timestamp without time zone, PRIMARY KEY ("id") ); -CREATE INDEX "#__template_overrides_idx_template" ON "#__template_overrides" ("template"); -CREATE INDEX "#__template_overrides_idx_extension_id" ON "#__template_overrides" ("extension_id"); +-- The following two statements were modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +CREATE INDEX "#__template_overrides_idx_template" ON "#__template_overrides" ("template") /** CAN FAIL **/; +CREATE INDEX "#__template_overrides_idx_extension_id" ON "#__template_overrides" ("extension_id") /** CAN FAIL **/; INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "custom_data", "checked_out", "checked_out_time", "ordering", "state") VALUES (0, 'plg_installer_override', 'plugin', 'override', 'installer', 0, 1, 1, 1, '', '', '', 0, '1970-01-01 00:00:00', 4, 0), 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 1af74c2bf7323..fab5f9b9a5117 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 @@ -24,33 +24,41 @@ ALTER TABLE "#__finder_links" ALTER COLUMN "start_date" DROP NOT NULL; ALTER TABLE "#__finder_links" ALTER COLUMN "start_date" DROP DEFAULT; ALTER TABLE "#__finder_links" ALTER COLUMN "end_date" DROP NOT NULL; ALTER TABLE "#__finder_links" ALTER COLUMN "end_date" DROP DEFAULT; -CREATE INDEX "#__finder_links_idx_language" on "#__finder_links" ("language"); +-- The following statement was modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +CREATE INDEX "#__finder_links_idx_language" on "#__finder_links" ("language") /** CAN FAIL **/; -CREATE TABLE "#__finder_links_terms" ( +-- The following statement was modified for 4.1.1 by adding the "IF NOT EXISTS" keywords. +-- See https://github.com/joomla/joomla-cms/pull/37156 +CREATE TABLE IF NOT EXISTS "#__finder_links_terms" ( "link_id" bigint NOT NULL, "term_id" bigint NOT NULL, "weight" REAL NOT NULL DEFAULT 0, PRIMARY KEY ("link_id", "term_id") ); -CREATE INDEX "#__finder_links_terms_idx_term_weight" on "#__finder_links_terms" ("term_id", "weight"); -CREATE INDEX "#__finder_links_terms_idx_link_term_weight" on "#__finder_links_terms" ("link_id", "term_id", "weight"); +-- The following two statements were modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +CREATE INDEX "#__finder_links_terms_idx_term_weight" on "#__finder_links_terms" ("term_id", "weight") /** CAN FAIL **/; +CREATE INDEX "#__finder_links_terms_idx_link_term_weight" on "#__finder_links_terms" ("link_id", "term_id", "weight") /** CAN FAIL **/; -DROP TABLE "#__finder_links_terms0" CASCADE; -DROP TABLE "#__finder_links_terms1" CASCADE; -DROP TABLE "#__finder_links_terms2" CASCADE; -DROP TABLE "#__finder_links_terms3" CASCADE; -DROP TABLE "#__finder_links_terms4" CASCADE; -DROP TABLE "#__finder_links_terms5" CASCADE; -DROP TABLE "#__finder_links_terms6" CASCADE; -DROP TABLE "#__finder_links_terms7" CASCADE; -DROP TABLE "#__finder_links_terms8" CASCADE; -DROP TABLE "#__finder_links_terms9" CASCADE; -DROP TABLE "#__finder_links_termsa" CASCADE; -DROP TABLE "#__finder_links_termsb" CASCADE; -DROP TABLE "#__finder_links_termsc" CASCADE; -DROP TABLE "#__finder_links_termsd" CASCADE; -DROP TABLE "#__finder_links_termse" CASCADE; -DROP TABLE "#__finder_links_termsf" CASCADE; +-- The following 16 statements were modified for 4.1.1 by adding the "IF EXISTS" keywords. +-- See https://github.com/joomla/joomla-cms/pull/37156 +DROP TABLE IF EXISTS "#__finder_links_terms0" CASCADE; +DROP TABLE IF EXISTS "#__finder_links_terms1" CASCADE; +DROP TABLE IF EXISTS "#__finder_links_terms2" CASCADE; +DROP TABLE IF EXISTS "#__finder_links_terms3" CASCADE; +DROP TABLE IF EXISTS "#__finder_links_terms4" CASCADE; +DROP TABLE IF EXISTS "#__finder_links_terms5" CASCADE; +DROP TABLE IF EXISTS "#__finder_links_terms6" CASCADE; +DROP TABLE IF EXISTS "#__finder_links_terms7" CASCADE; +DROP TABLE IF EXISTS "#__finder_links_terms8" CASCADE; +DROP TABLE IF EXISTS "#__finder_links_terms9" CASCADE; +DROP TABLE IF EXISTS "#__finder_links_termsa" CASCADE; +DROP TABLE IF EXISTS "#__finder_links_termsb" CASCADE; +DROP TABLE IF EXISTS "#__finder_links_termsc" CASCADE; +DROP TABLE IF EXISTS "#__finder_links_termsd" CASCADE; +DROP TABLE IF EXISTS "#__finder_links_termse" CASCADE; +DROP TABLE IF EXISTS "#__finder_links_termsf" CASCADE; CREATE TABLE IF NOT EXISTS "#__finder_logging" ( "searchterm" character varying(255) NOT NULL DEFAULT '', @@ -60,10 +68,14 @@ CREATE TABLE IF NOT EXISTS "#__finder_logging" ( "results" integer NOT NULL DEFAULT 0, PRIMARY KEY ("md5sum") ); -CREATE INDEX "#__finder_logging_idx_md5sum" on "#__finder_logging" ("md5sum"); -CREATE INDEX "#__finder_logging_idx_searchterm" on "#__finder_logging" ("searchterm"); +-- The following two statements were modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +CREATE INDEX "#__finder_logging_idx_md5sum" on "#__finder_logging" ("md5sum") /** CAN FAIL **/; +CREATE INDEX "#__finder_logging_idx_searchterm" on "#__finder_logging" ("searchterm") /** CAN FAIL **/; -DROP TABLE "#__finder_taxonomy"; +-- The following statement was modified for 4.1.1 by adding the "IF EXISTS" keywords. +-- See https://github.com/joomla/joomla-cms/pull/37156 +DROP TABLE IF EXISTS "#__finder_taxonomy"; CREATE TABLE IF NOT EXISTS "#__finder_taxonomy" ( "id" serial NOT NULL, "parent_id" integer DEFAULT 0 NOT NULL, @@ -78,13 +90,15 @@ CREATE TABLE IF NOT EXISTS "#__finder_taxonomy" ( "language" varchar(7) DEFAULT '' NOT NULL, PRIMARY KEY ("id") ); -CREATE INDEX "#__finder_taxonomy_state" on "#__finder_taxonomy" ("state"); -CREATE INDEX "#__finder_taxonomy_access" on "#__finder_taxonomy" ("access"); -CREATE INDEX "#__finder_taxonomy_path" on "#__finder_taxonomy" ("path"); -CREATE INDEX "#__finder_taxonomy_lft_rgt" on "#__finder_taxonomy" ("lft", "rgt"); -CREATE INDEX "#__finder_taxonomy_alias" on "#__finder_taxonomy" ("alias"); -CREATE INDEX "#__finder_taxonomy_language" on "#__finder_taxonomy" ("language"); -CREATE INDEX "#__finder_taxonomy_idx_parent_published" on "#__finder_taxonomy" ("parent_id", "state", "access"); +-- The following 7 statements were modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +CREATE INDEX "#__finder_taxonomy_state" on "#__finder_taxonomy" ("state") /** CAN FAIL **/; +CREATE INDEX "#__finder_taxonomy_access" on "#__finder_taxonomy" ("access") /** CAN FAIL **/; +CREATE INDEX "#__finder_taxonomy_path" on "#__finder_taxonomy" ("path") /** CAN FAIL **/; +CREATE INDEX "#__finder_taxonomy_lft_rgt" on "#__finder_taxonomy" ("lft", "rgt") /** CAN FAIL **/; +CREATE INDEX "#__finder_taxonomy_alias" on "#__finder_taxonomy" ("alias") /** CAN FAIL **/; +CREATE INDEX "#__finder_taxonomy_language" on "#__finder_taxonomy" ("language") /** CAN FAIL **/; +CREATE INDEX "#__finder_taxonomy_idx_parent_published" on "#__finder_taxonomy" ("parent_id", "state", "access") /** CAN FAIL **/; INSERT INTO "#__finder_taxonomy" ("id", "parent_id", "lft", "rgt", "level", "path", "title", "alias", "state", "access", "language") VALUES (1, 0, 0, 1, 0, '', 'ROOT', 'root', 1, 1, '*'); SELECT setval('#__finder_taxonomy_id_seq', 2, false); @@ -96,19 +110,25 @@ 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"; -ALTER TABLE "#__finder_terms" ADD CONSTRAINT "#__finder_terms_idx_term_language" UNIQUE ("term", "language"); +-- The following 4 statements were modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +CREATE INDEX "#__finder_terms_idx_stem" on "#__finder_terms" ("stem" /** CAN FAIL **/); +CREATE INDEX "#__finder_terms_idx_language" on "#__finder_terms" ("language") /** CAN FAIL **/; +ALTER TABLE "#__finder_terms" DROP CONSTRAINT "#__finder_terms_idx_term" /** CAN FAIL **/; +ALTER TABLE "#__finder_terms" ADD CONSTRAINT "#__finder_terms_idx_term_language" UNIQUE ("term", "language") /** CAN FAIL **/; DROP TABLE IF EXISTS "#__finder_terms_common"; -CREATE TABLE "#__finder_terms_common" ( +-- The following statement was modified for 4.1.1 by adding the "IF NOT EXISTS" keywords. +-- See https://github.com/joomla/joomla-cms/pull/37156 +CREATE TABLE IF NOT EXISTS "#__finder_terms_common" ( "term" varchar(75) NOT NULL, "language" varchar(7) DEFAULT '' NOT NULL, "custom" integer DEFAULT 0 NOT NULL, CONSTRAINT "#__finder_terms_common_idx_term_language" UNIQUE ("term", "language") ); -CREATE INDEX "#__finder_terms_common_idx_lang" on "#__finder_terms_common" ("language"); +-- The following statement was modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +CREATE INDEX "#__finder_terms_common_idx_lang" on "#__finder_terms_common" ("language") /** CAN FAIL **/; INSERT INTO "#__finder_terms_common" ("term", "language", "custom") VALUES ('i', 'en', 0), ('me', 'en', 0), @@ -289,13 +309,17 @@ TRUNCATE TABLE "#__finder_tokens"; 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"); +-- The following two statements were modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +CREATE INDEX "#__finder_tokens_idx_stem" on "#__finder_tokens" ("stem") /** CAN FAIL **/; +CREATE INDEX "#__finder_tokens_idx_language" on "#__finder_tokens" ("language") /** CAN FAIL **/; TRUNCATE TABLE "#__finder_tokens_aggregate"; 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"; +-- The following statement was modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +ALTER TABLE "#__finder_tokens_aggregate" DROP COLUMN "map_suffix" /** CAN FAIL **/; ALTER TABLE "#__finder_tokens_aggregate" ALTER COLUMN "stem" SET DEFAULT ''; ALTER TABLE "#__finder_tokens_aggregate" ALTER COLUMN "term_weight" SET DEFAULT 0; ALTER TABLE "#__finder_tokens_aggregate" ALTER COLUMN "context_weight" SET DEFAULT 0; diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-03-09.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-03-09.sql index dff3c770fe302..4a1c6ac823b12 100644 --- a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-03-09.sql +++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-03-09.sql @@ -24,10 +24,16 @@ CREATE TABLE IF NOT EXISTS "#__mail_templates" ( "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"); +-- The following two statements were modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +CREATE INDEX "#__mail_templates_idx_template_id" ON "#__mail_templates" ("template_id") /** CAN FAIL **/; +CREATE INDEX "#__mail_templates_idx_language" ON "#__mail_templates" ("language") /** CAN FAIL **/; -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"]}'); +-- The following statement was modified for 4.1.1 by adding the "ON CONFLICT" clause. +-- See https://github.com/joomla/joomla-cms/pull/37156 +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"]}') +ON CONFLICT DO NOTHING; -- From 4.0.0-2019-02-03.sql DELETE FROM "#__menu" WHERE "link" = 'index.php?option=com_postinstall' AND "menutype" = 'main'; 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 9601b6b1dd693..441588c4ed0eb 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,5 +1,7 @@ -ALTER TABLE "#__menu" ADD COLUMN "publish_up" timestamp without time zone; -ALTER TABLE "#__menu" ADD COLUMN "publish_down" timestamp without time zone; +-- The following two statements were modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +ALTER TABLE "#__menu" ADD COLUMN "publish_up" timestamp without time zone /** CAN FAIL **/; +ALTER TABLE "#__menu" ADD COLUMN "publish_down" timestamp without time zone /** CAN FAIL **/; ALTER TABLE "#__menu" ALTER COLUMN "checked_out_time" DROP NOT NULL; ALTER TABLE "#__menu" ALTER COLUMN "checked_out_time" DROP DEFAULT; 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 cf5f4ea82778c..1c24f4658b2a1 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 @@ -12,4 +12,6 @@ UPDATE "#__menu" SET "link"='index.php?option=com_tags&view=tags' WHERE "menutyp UPDATE "#__menu" SET "link"='index.php?option=com_associations&view=associations' WHERE "menutype"='main' AND "path"='Multilingual Associations'; -- From 4.0.0-2019-05-20.sql -ALTER TABLE "#__extensions" ADD COLUMN "note" character varying(255); +-- The following statement was modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +ALTER TABLE "#__extensions" ADD COLUMN "note" character varying(255) /** CAN FAIL **/; 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 index 53195188220b7..1c64f1b850eb2 100644 --- 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 @@ -7,7 +7,9 @@ CREATE TABLE IF NOT EXISTS "#__webauthn_credentials" ( PRIMARY KEY ("id") ); -CREATE INDEX "#__webauthn_credentials_user_id" ON "#__webauthn_credentials" ("user_id"); +-- The following statement was modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +CREATE INDEX "#__webauthn_credentials_user_id" ON "#__webauthn_credentials" ("user_id") /** CAN FAIL **/; INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "custom_data", "checked_out", "checked_out_time", "ordering", "state") VALUES (0, 'plg_system_webauthn', 'plugin', 'webauthn', 'system', 0, 1, 1, 0, '', '{}', '', 0, '1970-01-01 00:00:00', 8, 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 index a37435a82574f..d258928b1850a 100644 --- 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 @@ -1,17 +1,23 @@ -- From 4.0.0-2019-07-14.sql -ALTER TABLE "#__contact_details" DROP COLUMN "xreference"; -ALTER TABLE "#__content" DROP COLUMN "xreference"; -ALTER TABLE "#__newsfeeds" DROP COLUMN "xreference"; +-- The following 3 statements were modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +ALTER TABLE "#__contact_details" DROP COLUMN "xreference" /** CAN FAIL **/; +ALTER TABLE "#__content" DROP COLUMN "xreference" /** CAN FAIL **/; +ALTER TABLE "#__newsfeeds" DROP COLUMN "xreference" /** CAN FAIL **/; -- From 4.0.0-2019-07-16.sql -- This has been removed as com_csp has been removed from the final build -- From 4.0.0-2019-08-03.sql -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; +-- The following two statements were modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +ALTER TABLE "#__update_sites" ADD COLUMN "checked_out" bigint DEFAULT 0 NOT NULL /** CAN FAIL **/; +ALTER TABLE "#__update_sites" ADD COLUMN "checked_out_time" timestamp without time zone DEFAULT NULL /** CAN FAIL **/; -- From 4.0.0-2019-08-20.sql -ALTER TABLE "#__content_frontpage" ADD COLUMN "featured_up" timestamp without time zone; -ALTER TABLE "#__content_frontpage" ADD COLUMN "featured_down" timestamp without time zone; +-- The following two statements were modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +ALTER TABLE "#__content_frontpage" ADD COLUMN "featured_up" timestamp without time zone /** CAN FAIL **/; +ALTER TABLE "#__content_frontpage" ADD COLUMN "featured_down" timestamp without time zone /** CAN FAIL **/; -- From 4.0.0-2019-08-21.sql INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "custom_data", "checked_out", "checked_out_time", "ordering", "state") VALUES @@ -31,5 +37,8 @@ INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", (0, 'plg_webservices_users', 'plugin', 'users', 'webservices', 0, 1, 1, 0, '', '{}', '', 0, '1970-01-01 00:00:00', 0, 0); -- From 4.0.0-2019-09-13.sql +-- The following statement was modified for 4.1.1 by adding the "ON CONFLICT" clause. +-- See https://github.com/joomla/joomla-cms/pull/37156 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'; +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' +ON CONFLICT DO NOTHING; diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2020-03-25.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2020-03-25.sql index 0d45c2156d656..04ecfaa368f65 100644 --- a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2020-03-25.sql +++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2020-03-25.sql @@ -1,5 +1,7 @@ -- Add locked field to extensions table. -ALTER TABLE "#__extensions" ADD COLUMN "locked" smallint DEFAULT 0 NOT NULL; +-- The following statement was modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +ALTER TABLE "#__extensions" ADD COLUMN "locked" smallint DEFAULT 0 NOT NULL /** CAN FAIL **/; COMMENT ON COLUMN "#__extensions"."protected" IS 'Flag to indicate if the extension is protected. Protected extensions cannot be disabled.'; COMMENT ON COLUMN "#__extensions"."locked" IS 'Flag to indicate if the extension is locked. Locked extensions cannot be uninstalled.'; diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2020-05-29.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2020-05-29.sql index 6c33b5c3d963a..de130b24f3525 100644 --- a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2020-05-29.sql +++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2020-05-29.sql @@ -3,6 +3,8 @@ INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", (0, 'plg_quickicon_downloadkey', 'plugin', 'downloadkey', 'quickicon', 0, 1, 1, 0, 1, '', '', '', 0, NULL, 0, 0); -- From 4.0.0-2020-04-16.sql +-- The following statement was modified for 4.1.1 by adding the "ON CONFLICT" clause. +-- See https://github.com/joomla/joomla-cms/pull/37156 INSERT INTO "#__mail_templates" ("template_id", "language", "subject", "body", "htmlbody", "attachments", "params") VALUES ('com_contact.mail', '', 'COM_CONTACT_ENQUIRY_SUBJECT', 'COM_CONTACT_ENQUIRY_TEXT', '', '', '{"tags":["sitename","name","email","subject","body","url","customfields"]}'), ('com_contact.mail.copy', '', 'COM_CONTACT_COPYSUBJECT_OF', 'COM_CONTACT_COPYTEXT_OF', '', '', '{"tags":["sitename","name","email","subject","body","url","customfields"]}'), @@ -10,22 +12,31 @@ INSERT INTO "#__mail_templates" ("template_id", "language", "subject", "body", " ('com_users.password_reset', '', 'COM_USERS_EMAIL_PASSWORD_RESET_SUBJECT', 'COM_USERS_EMAIL_PASSWORD_RESET_BODY', '', '', '{"tags":["name","email","sitename","link_text","link_html","token"]}'), ('com_users.reminder', '', 'COM_USERS_EMAIL_USERNAME_REMINDER_SUBJECT', 'COM_USERS_EMAIL_USERNAME_REMINDER_BODY', '', '', '{"tags":["name","username","sitename","email","link_text","link_html"]}'), ('plg_system_updatenotification.mail', '', 'PLG_SYSTEM_UPDATENOTIFICATION_EMAIL_SUBJECT', 'PLG_SYSTEM_UPDATENOTIFICATION_EMAIL_BODY', '', '', '{"tags":["newversion","curversion","sitename","url","link","releasenews"]}'), -('plg_user_joomla.mail', '', 'PLG_USER_JOOMLA_NEW_USER_EMAIL_SUBJECT', 'PLG_USER_JOOMLA_NEW_USER_EMAIL_BODY', '', '', '{"tags":["name","sitename","url","username","password","email"]}'); +('plg_user_joomla.mail', '', 'PLG_USER_JOOMLA_NEW_USER_EMAIL_SUBJECT', 'PLG_USER_JOOMLA_NEW_USER_EMAIL_BODY', '', '', '{"tags":["name","sitename","url","username","password","email"]}') +ON CONFLICT DO NOTHING; -- From 4.0.0-2020-05-21.sql -- Renaming table -ALTER TABLE "#__ucm_history" RENAME TO "#__history"; +-- The following statement was modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +ALTER TABLE "#__ucm_history" RENAME TO "#__history" /** CAN FAIL **/; -- Rename ucm_item_id to item_id as the new primary identifier for the original content item -ALTER TABLE "#__history" RENAME "ucm_item_id" TO "item_id"; +-- The following statement was modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +ALTER TABLE "#__history" RENAME "ucm_item_id" TO "item_id" /** CAN FAIL **/; ALTER TABLE "#__history" ALTER COLUMN "item_id" TYPE character varying(50); ALTER TABLE "#__history" ALTER COLUMN "item_id" SET NOT NULL; ALTER TABLE "#__history" ALTER COLUMN "item_id" DROP DEFAULT; -- Extend the original field content with the alias of the content type -UPDATE "#__history" AS h SET "item_id" = CONCAT(c."type_alias", '.', "item_id") FROM "#__content_types" AS c WHERE h."ucm_type_id" = c."type_id"; +-- The following statement was modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +UPDATE "#__history" AS h SET "item_id" = CONCAT(c."type_alias", '.', "item_id") FROM "#__content_types" AS c WHERE h."ucm_type_id" = c."type_id" /** CAN FAIL **/; -- Now we don't need the ucm_type_id anymore and drop it. -ALTER TABLE "#__history" DROP COLUMN "ucm_type_id"; +-- The following statement was modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +ALTER TABLE "#__history" DROP COLUMN "ucm_type_id" /** CAN FAIL **/; ALTER TABLE "#__history" ALTER COLUMN "save_date" DROP DEFAULT; -- From 4.0.0-2020-05-29.sql diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2020-12-20.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2020-12-20.sql index 2fe434b7a42e6..3955d94200f98 100644 --- a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2020-12-20.sql +++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2020-12-20.sql @@ -1,4 +1,6 @@ -- From 4.0.0-2020-12-08.sql +-- The following statement was modified for 4.1.1 by adding the "ON CONFLICT" clause. +-- See https://github.com/joomla/joomla-cms/pull/37156 INSERT INTO "#__mail_templates" ("template_id", "language", "subject", "body", "htmlbody", "attachments", "params") VALUES ('com_actionlogs.notification', '', 'COM_ACTIONLOGS_EMAIL_SUBJECT', 'COM_ACTIONLOGS_EMAIL_BODY', 'COM_ACTIONLOGS_EMAIL_HTMLBODY', '', '{"tags":["message","date","extension"]}'), ('com_privacy.userdataexport', '', 'COM_PRIVACY_EMAIL_DATA_EXPORT_COMPLETED_BODY', 'COM_PRIVACY_EMAIL_DATA_EXPORT_COMPLETED_SUBJECT', '', '', '{"tags":["sitename","url"]}'), @@ -17,7 +19,7 @@ INSERT INTO "#__mail_templates" ("template_id", "language", "subject", "body", " ('com_users.registration.admin.verification_request', '', 'COM_USERS_EMAIL_ACTIVATE_WITH_ADMIN_ACTIVATION_SUBJECT', 'COM_USERS_EMAIL_ACTIVATE_WITH_ADMIN_ACTIVATION_BODY', '', '', '{"tags":["name","sitename","email","username","activate"]}'), ('plg_system_privacyconsent.request.reminder', '', 'PLG_SYSTEM_PRIVACYCONSENT_EMAIL_REMIND_SUBJECT', 'PLG_SYSTEM_PRIVACYCONSENT_EMAIL_REMIND_BODY', '', '', '{"tags":["sitename","url","tokenurl","formurl","token"]}'), ('com_messages.new_message', '', 'COM_MESSAGES_NEW_MESSAGE', 'COM_MESSAGES_NEW_MESSAGE_BODY', '', '', '{"tags":["subject","message","fromname","sitename","siteurl","fromemail","toname","toemail"]}') -; +ON CONFLICT DO NOTHING; -- From 4.0.0-2020-12-19.sql UPDATE "#__banners" SET "created" = '1980-01-01 00:00:00' WHERE "created" = '1970-01-01 00:00:00'; diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2021-04-22.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2021-04-22.sql index 7c84bf0f7a7cd..d72d4b8e29e3f 100644 --- a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2021-04-22.sql +++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2021-04-22.sql @@ -9,12 +9,16 @@ DELETE FROM "#__postinstall_messages" 'TPL_HATHOR_MESSAGE_POSTINSTALL_TITLE'); -- From 4.0.0-2021-04-11.sql -ALTER TABLE "#__fields" ADD COLUMN "only_use_in_subform" smallint DEFAULT 0 NOT NULL; +-- The following statement was modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +ALTER TABLE "#__fields" ADD COLUMN "only_use_in_subform" smallint DEFAULT 0 NOT NULL /** CAN FAIL **/; -- From 4.0.0-2021-04-20.sql UPDATE "#__extensions" SET "name" = 'plg_fields_subform', "element" = 'subform' WHERE "name" = 'plg_fields_subfields' AND "type" = 'plugin' AND "element" = 'subfields' AND "folder" = 'fields' AND "client_id" = 0; UPDATE "#__fields" SET "type" = 'subform' WHERE "type" = 'subfields'; -- From 4.0.0-2021-04-22.sql -ALTER TABLE "#__mail_templates" ADD COLUMN "extension" VARCHAR(127) NOT NULL DEFAULT ''; +-- The following statement was modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +ALTER TABLE "#__mail_templates" ADD COLUMN "extension" VARCHAR(127) NOT NULL DEFAULT '' /** CAN FAIL **/; UPDATE "#__mail_templates" SET "extension" = SUBSTRING("template_id", 1, POSITION('.' IN "template_id") - 1); diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2021-05-30.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2021-05-30.sql index 05029036df592..e3770d3e0bf5a 100644 --- a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2021-05-30.sql +++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2021-05-30.sql @@ -15,7 +15,9 @@ UPDATE "#__mail_templates" WHERE "template_id" = 'com_privacy.userdataexport'; -- From 4.0.0-2021-05-10.sql -CREATE INDEX "#__finder_taxonomy_level" ON "#__finder_taxonomy" ("level"); +-- The following statement was modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +CREATE INDEX "#__finder_taxonomy_level" ON "#__finder_taxonomy" ("level") /** CAN FAIL **/; -- From 4.0.0-2021-05-21.sql UPDATE "#__modules" diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.1.0-2021-11-20.sql b/administrator/components/com_admin/sql/updates/postgresql/4.1.0-2021-11-20.sql index 02ab2e7033278..eef427c92feac 100644 --- a/administrator/components/com_admin/sql/updates/postgresql/4.1.0-2021-11-20.sql +++ b/administrator/components/com_admin/sql/updates/postgresql/4.1.0-2021-11-20.sql @@ -28,14 +28,16 @@ CREATE TABLE IF NOT EXISTS "#__scheduler_tasks" ( PRIMARY KEY ("id") ); -CREATE INDEX "#__scheduler_tasks_idx_type" ON "#__scheduler_tasks" ("type"); -CREATE INDEX "#__scheduler_tasks_idx_state" ON "#__scheduler_tasks" ("state"); -CREATE INDEX "#__scheduler_tasks_idx_last_exit" ON "#__scheduler_tasks" ("last_exit_code"); -CREATE INDEX "#__scheduler_tasks_idx_next_exec" ON "#__scheduler_tasks" ("next_execution"); -CREATE INDEX "#__scheduler_tasks_idx_locked" ON "#__scheduler_tasks" ("locked"); -CREATE INDEX "#__scheduler_tasks_idx_priority" ON "#__scheduler_tasks" ("priority"); -CREATE INDEX "#__scheduler_tasks_idx_cli_exclusive" ON "#__scheduler_tasks" ("cli_exclusive"); -CREATE INDEX "#__scheduler_tasks_idx_checked_out" ON "#__scheduler_tasks" ("checked_out"); +-- The following 8 statements were modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +CREATE INDEX "#__scheduler_tasks_idx_type" ON "#__scheduler_tasks" ("type") /** CAN FAIL **/; +CREATE INDEX "#__scheduler_tasks_idx_state" ON "#__scheduler_tasks" ("state") /** CAN FAIL **/; +CREATE INDEX "#__scheduler_tasks_idx_last_exit" ON "#__scheduler_tasks" ("last_exit_code") /** CAN FAIL **/; +CREATE INDEX "#__scheduler_tasks_idx_next_exec" ON "#__scheduler_tasks" ("next_execution") /** CAN FAIL **/; +CREATE INDEX "#__scheduler_tasks_idx_locked" ON "#__scheduler_tasks" ("locked") /** CAN FAIL **/; +CREATE INDEX "#__scheduler_tasks_idx_priority" ON "#__scheduler_tasks" ("priority") /** CAN FAIL **/; +CREATE INDEX "#__scheduler_tasks_idx_cli_exclusive" ON "#__scheduler_tasks" ("cli_exclusive") /** CAN FAIL **/; +CREATE INDEX "#__scheduler_tasks_idx_checked_out" ON "#__scheduler_tasks" ("checked_out") /** CAN FAIL **/; -- Add "com_scheduler" to "#__extensions" INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "locked", "manifest_cache", "params", "custom_data", "ordering", "state") VALUES @@ -57,8 +59,11 @@ INSERT INTO "#__action_log_config" ("type_title", "type_alias", "id_holder", "ti ('task', 'com_scheduler.task', 'id', 'title', '#__scheduler_tasks', 'PLG_ACTIONLOG_JOOMLA'); -- Add mail templates +-- The following statement was modified for 4.1.1 by adding the "ON CONFLICT" clause. +-- See https://github.com/joomla/joomla-cms/pull/37156 INSERT INTO "#__mail_templates" ("template_id", "extension", "language", "subject", "body", "htmlbody", "attachments", "params") VALUES ('plg_system_tasknotification.failure_mail', 'plg_system_tasknotification', '', 'PLG_SYSTEM_TASK_NOTIFICATION_FAILURE_MAIL_SUBJECT', 'PLG_SYSTEM_TASK_NOTIFICATION_FAILURE_MAIL_BODY', '', '', '{"tags": ["task_id", "task_title", "exit_code", "exec_data_time", "task_output"]}'), ('plg_system_tasknotification.fatal_recovery_mail', 'plg_system_tasknotification', '', 'PLG_SYSTEM_TASK_NOTIFICATION_FATAL_MAIL_SUBJECT', 'PLG_SYSTEM_TASK_NOTIFICATION_FATAL_MAIL_BODY', '', '', '{"tags": ["task_id", "task_title"]}'), ('plg_system_tasknotification.orphan_mail', 'plg_system_tasknotification', '', 'PLG_SYSTEM_TASK_NOTIFICATION_ORPHAN_MAIL_SUBJECT', 'PLG_SYSTEM_TASK_NOTIFICATION_ORPHAN_MAIL_BODY', '', '', '{"tags": ["task_id", "task_title"]}'), -('plg_system_tasknotification.success_mail', 'plg_system_tasknotification', '', 'PLG_SYSTEM_TASK_NOTIFICATION_SUCCESS_MAIL_SUBJECT', 'PLG_SYSTEM_TASK_NOTIFICATION_SUCCESS_MAIL_BODY', '', '', '{"tags":["task_id", "task_title", "exec_data_time", "task_output"]}'); +('plg_system_tasknotification.success_mail', 'plg_system_tasknotification', '', 'PLG_SYSTEM_TASK_NOTIFICATION_SUCCESS_MAIL_SUBJECT', 'PLG_SYSTEM_TASK_NOTIFICATION_SUCCESS_MAIL_BODY', '', '', '{"tags":["task_id", "task_title", "exec_data_time", "task_output"]}') +ON CONFLICT DO NOTHING; diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.1.0-2022-01-24.sql b/administrator/components/com_admin/sql/updates/postgresql/4.1.0-2022-01-24.sql index 4da6473ffb8c9..804c4f17aa9f2 100644 --- a/administrator/components/com_admin/sql/updates/postgresql/4.1.0-2022-01-24.sql +++ b/administrator/components/com_admin/sql/updates/postgresql/4.1.0-2022-01-24.sql @@ -1,2 +1,4 @@ DROP INDEX IF EXISTS "#__redirect_links_idx_link_modifed"; -CREATE INDEX "#__redirect_links_idx_link_modified" ON "#__redirect_links" ("modified_date"); +-- The following statement was modified for 4.1.1 by adding the "/** CAN FAIL **/" installer hint. +-- See https://github.com/joomla/joomla-cms/pull/37156 +CREATE INDEX "#__redirect_links_idx_link_modified" ON "#__redirect_links" ("modified_date") /** CAN FAIL **/; diff --git a/administrator/components/com_associations/tmpl/associations/default.php b/administrator/components/com_associations/tmpl/associations/default.php index baddfd2a0016e..fd7879f38d399 100644 --- a/administrator/components/com_associations/tmpl/associations/default.php +++ b/administrator/components/com_associations/tmpl/associations/default.php @@ -18,8 +18,9 @@ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->document->getWebAssetManager(); -$wa->useScript('multiselect') - ->useScript('com_associations.admin-associations-default'); +$wa->useScript('com_associations.admin-associations-default') + ->useScript('table.columns') + ->useScript('multiselect'); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); diff --git a/administrator/components/com_banners/tmpl/banners/default.php b/administrator/components/com_banners/tmpl/banners/default.php index 836270689a6a7..22ec2c5d1310e 100644 --- a/administrator/components/com_banners/tmpl/banners/default.php +++ b/administrator/components/com_banners/tmpl/banners/default.php @@ -19,9 +19,10 @@ /** @var \Joomla\Component\Banners\Administrator\View\Banners\HtmlView $this */ -/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->document->getWebAssetManager(); -$wa->useScript('multiselect'); +$wa->useScript('table.columns') + ->useScript('multiselect'); $user = Factory::getUser(); $userId = $user->get('id'); diff --git a/administrator/components/com_banners/tmpl/clients/default.php b/administrator/components/com_banners/tmpl/clients/default.php index 4ff67de57d86a..31da558bd75b3 100644 --- a/administrator/components/com_banners/tmpl/clients/default.php +++ b/administrator/components/com_banners/tmpl/clients/default.php @@ -18,9 +18,10 @@ /** @var \Joomla\Component\Banners\Administrator\View\Clients\HtmlView $this */ -/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->document->getWebAssetManager(); -$wa->useScript('multiselect'); +$wa->useScript('table.columns') + ->useScript('multiselect'); $purchaseTypes = [ '1' => 'UNLIMITED', diff --git a/administrator/components/com_banners/tmpl/tracks/default.php b/administrator/components/com_banners/tmpl/tracks/default.php index 5ec45ffdd5546..0e0113ec16c77 100644 --- a/administrator/components/com_banners/tmpl/tracks/default.php +++ b/administrator/components/com_banners/tmpl/tracks/default.php @@ -14,6 +14,10 @@ use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; +/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->document->getWebAssetManager(); +$wa->useScript('table.columns'); + /** @var \Joomla\Component\Banners\Administrator\View\Tracks\HtmlView $this */ $listOrder = $this->escape($this->state->get('list.ordering')); diff --git a/administrator/components/com_cache/tmpl/cache/default.php b/administrator/components/com_cache/tmpl/cache/default.php index 9f53205a111c2..be12a200d1979 100644 --- a/administrator/components/com_cache/tmpl/cache/default.php +++ b/administrator/components/com_cache/tmpl/cache/default.php @@ -22,6 +22,7 @@ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->document->getWebAssetManager(); $wa->useScript('keepalive') + ->useScript('table.columns') ->useScript('multiselect') ->useScript('com_cache.admin-cache'); diff --git a/administrator/components/com_categories/tmpl/categories/default.php b/administrator/components/com_categories/tmpl/categories/default.php index 73dca08484de2..e4ad8677615e6 100644 --- a/administrator/components/com_categories/tmpl/categories/default.php +++ b/administrator/components/com_categories/tmpl/categories/default.php @@ -18,9 +18,10 @@ use Joomla\CMS\Session\Session; use Joomla\String\Inflector; -/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->document->getWebAssetManager(); -$wa->useScript('multiselect'); +$wa->useScript('table.columns') + ->useScript('multiselect'); $user = Factory::getUser(); $userId = $user->get('id'); diff --git a/administrator/components/com_config/src/Model/ApplicationModel.php b/administrator/components/com_config/src/Model/ApplicationModel.php index c907e1bbb4435..77d70c8669785 100644 --- a/administrator/components/com_config/src/Model/ApplicationModel.php +++ b/administrator/components/com_config/src/Model/ApplicationModel.php @@ -93,7 +93,7 @@ public function getData() $data = ArrayHelper::fromObject($config); // Get the correct driver at runtime - $data['dbtype'] = Factory::getDbo()->getName(); + $data['dbtype'] = $this->getDatabase()->getName(); // Prime the asset_id for the rules. $data['asset_id'] = 1; @@ -502,11 +502,12 @@ public function save($data) // Purge the database session table if we are changing to the database handler. if ($prev['session_handler'] != 'database' && $data['session_handler'] == 'database') { - $query = $this->_db->getQuery(true) - ->delete($this->_db->quoteName('#__session')) - ->where($this->_db->quoteName('time') . ' < ' . (time() - 1)); - $this->_db->setQuery($query); - $this->_db->execute(); + $db = $this->getDatabase(); + $query = $db->getQuery(true) + ->delete($db->quoteName('#__session')) + ->where($db->quoteName('time') . ' < ' . (time() - 1)); + $db->setQuery($query); + $db->execute(); } // Purge the database session table if we are disabling session metadata @@ -1170,16 +1171,19 @@ public function storePermissions($permission = null) try { + // The database instance + $db = $this->getDatabase(); + // Get the asset id by the name of the component. - $query = $this->_db->getQuery(true) - ->select($this->_db->quoteName('id')) - ->from($this->_db->quoteName('#__assets')) - ->where($this->_db->quoteName('name') . ' = :component') + $query = $db->getQuery(true) + ->select($db->quoteName('id')) + ->from($db->quoteName('#__assets')) + ->where($db->quoteName('name') . ' = :component') ->bind(':component', $permission['component']); - $this->_db->setQuery($query); + $db->setQuery($query); - $assetId = (int) $this->_db->loadResult(); + $assetId = (int) $db->loadResult(); // Fetch the parent asset id. $parentAssetId = null; @@ -1196,38 +1200,38 @@ public function storePermissions($permission = null) { // In this case we need to get the component rules too. $query->clear() - ->select($this->_db->quoteName('parent_id')) - ->from($this->_db->quoteName('#__assets')) - ->where($this->_db->quoteName('id') . ' = :assetid') + ->select($db->quoteName('parent_id')) + ->from($db->quoteName('#__assets')) + ->where($db->quoteName('id') . ' = :assetid') ->bind(':assetid', $assetId, ParameterType::INTEGER); - $this->_db->setQuery($query); + $db->setQuery($query); - $parentAssetId = (int) $this->_db->loadResult(); + $parentAssetId = (int) $db->loadResult(); } // Get the group parent id of the current group. $rule = (int) $permission['rule']; $query->clear() - ->select($this->_db->quoteName('parent_id')) - ->from($this->_db->quoteName('#__usergroups')) - ->where($this->_db->quoteName('id') . ' = :rule') + ->select($db->quoteName('parent_id')) + ->from($db->quoteName('#__usergroups')) + ->where($db->quoteName('id') . ' = :rule') ->bind(':rule', $rule, ParameterType::INTEGER); - $this->_db->setQuery($query); + $db->setQuery($query); - $parentGroupId = (int) $this->_db->loadResult(); + $parentGroupId = (int) $db->loadResult(); // Count the number of child groups of the current group. $query->clear() - ->select('COUNT(' . $this->_db->quoteName('id') . ')') - ->from($this->_db->quoteName('#__usergroups')) - ->where($this->_db->quoteName('parent_id') . ' = :rule') + ->select('COUNT(' . $db->quoteName('id') . ')') + ->from($db->quoteName('#__usergroups')) + ->where($db->quoteName('parent_id') . ' = :rule') ->bind(':rule', $rule, ParameterType::INTEGER); - $this->_db->setQuery($query); + $db->setQuery($query); - $totalChildGroups = (int) $this->_db->loadResult(); + $totalChildGroups = (int) $db->loadResult(); } catch (\Exception $e) { diff --git a/administrator/components/com_contact/tmpl/contacts/default.php b/administrator/components/com_contact/tmpl/contacts/default.php index cc1ddbd14a036..e4f20893ee730 100644 --- a/administrator/components/com_contact/tmpl/contacts/default.php +++ b/administrator/components/com_contact/tmpl/contacts/default.php @@ -18,9 +18,10 @@ use Joomla\CMS\Router\Route; use Joomla\CMS\Session\Session; -/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->document->getWebAssetManager(); -$wa->useScript('multiselect'); +$wa->useScript('table.columns') + ->useScript('multiselect'); $user = Factory::getUser(); $userId = $user->get('id'); diff --git a/administrator/components/com_content/tmpl/articles/default.php b/administrator/components/com_content/tmpl/articles/default.php index c28750896fbee..599b0ec92372b 100644 --- a/administrator/components/com_content/tmpl/articles/default.php +++ b/administrator/components/com_content/tmpl/articles/default.php @@ -24,6 +24,11 @@ use Joomla\Component\Content\Administrator\Helper\ContentHelper; use Joomla\Utilities\ArrayHelper; +/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->document->getWebAssetManager(); +$wa->useScript('table.columns') + ->useScript('multiselect'); + $app = Factory::getApplication(); $user = Factory::getUser(); $userId = $user->get('id'); @@ -54,10 +59,6 @@ HTMLHelper::_('draggablelist.draggable'); } -/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); -$wa->useScript('multiselect'); - $workflow_enabled = ComponentHelper::getParams('com_content')->get('workflow_enabled'); $workflow_state = false; $workflow_featured = false; diff --git a/administrator/components/com_content/tmpl/featured/default.php b/administrator/components/com_content/tmpl/featured/default.php index 1325d13bd5e20..5ca431d64fe21 100644 --- a/administrator/components/com_content/tmpl/featured/default.php +++ b/administrator/components/com_content/tmpl/featured/default.php @@ -24,6 +24,11 @@ use Joomla\Component\Content\Administrator\Helper\ContentHelper; use Joomla\Utilities\ArrayHelper; +/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->document->getWebAssetManager(); +$wa->useScript('table.columns') + ->useScript('multiselect'); + $app = Factory::getApplication(); $user = Factory::getUser(); $userId = $user->get('id'); @@ -55,10 +60,6 @@ HTMLHelper::_('draggablelist.draggable'); } -/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); -$wa->useScript('multiselect'); - $workflow_enabled = ComponentHelper::getParams('com_content')->get('workflow_enabled'); $workflow_state = false; $workflow_featured = false; diff --git a/administrator/components/com_fields/tmpl/fields/default.php b/administrator/components/com_fields/tmpl/fields/default.php index a790d7f058cba..e1a382071cde6 100644 --- a/administrator/components/com_fields/tmpl/fields/default.php +++ b/administrator/components/com_fields/tmpl/fields/default.php @@ -18,9 +18,10 @@ use Joomla\CMS\Session\Session; use Joomla\Component\Fields\Administrator\Helper\FieldsHelper; -/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->document->getWebAssetManager(); -$wa->useScript('multiselect'); +$wa->useScript('table.columns') + ->useScript('multiselect'); $app = Factory::getApplication(); $user = Factory::getUser(); diff --git a/administrator/components/com_fields/tmpl/groups/default.php b/administrator/components/com_fields/tmpl/groups/default.php index 5bce2520a9ac2..ecc9a5bf4b0e2 100644 --- a/administrator/components/com_fields/tmpl/groups/default.php +++ b/administrator/components/com_fields/tmpl/groups/default.php @@ -17,9 +17,10 @@ use Joomla\CMS\Session\Session; use Joomla\Component\Fields\Administrator\Helper\FieldsHelper; -/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->document->getWebAssetManager(); -$wa->useScript('multiselect'); +$wa->useScript('table.columns') + ->useScript('multiselect'); $app = Factory::getApplication(); $user = Factory::getUser(); diff --git a/administrator/components/com_finder/tmpl/filters/default.php b/administrator/components/com_finder/tmpl/filters/default.php index 47a06806570bf..3b38e40eec239 100644 --- a/administrator/components/com_finder/tmpl/filters/default.php +++ b/administrator/components/com_finder/tmpl/filters/default.php @@ -24,8 +24,9 @@ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->document->getWebAssetManager(); -$wa->useScript('multiselect') - ->useScript('com_finder.filters'); +$wa->useScript('com_finder.filters') + ->useScript('table.columns') + ->useScript('multiselect'); ?>
diff --git a/administrator/components/com_finder/tmpl/index/default.php b/administrator/components/com_finder/tmpl/index/default.php index b0013d19450df..56dbeb757b737 100644 --- a/administrator/components/com_finder/tmpl/index/default.php +++ b/administrator/components/com_finder/tmpl/index/default.php @@ -26,8 +26,9 @@ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->document->getWebAssetManager(); -$wa->useScript('multiselect') - ->useScript('com_finder.index'); +$wa->useScript('com_finder.index') + ->useScript('multiselect') + ->useScript('table.columns'); ?> diff --git a/administrator/components/com_finder/tmpl/maps/default.php b/administrator/components/com_finder/tmpl/maps/default.php index de3c55e03d805..305e92d67867f 100644 --- a/administrator/components/com_finder/tmpl/maps/default.php +++ b/administrator/components/com_finder/tmpl/maps/default.php @@ -26,8 +26,9 @@ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->document->getWebAssetManager(); -$wa->useScript('multiselect') - ->useScript('com_finder.maps'); +$wa->useScript('com_finder.maps') + ->useScript('table.columns') + ->useScript('multiselect'); ?> diff --git a/administrator/components/com_installer/tmpl/database/default.php b/administrator/components/com_installer/tmpl/database/default.php index d6351455f586a..ff27f5666d25c 100644 --- a/administrator/components/com_installer/tmpl/database/default.php +++ b/administrator/components/com_installer/tmpl/database/default.php @@ -14,9 +14,10 @@ use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; -/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->document->getWebAssetManager(); -$wa->useScript('multiselect'); +$wa->useScript('table.columns') + ->useScript('multiselect'); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirection = $this->escape($this->state->get('list.direction')); diff --git a/administrator/components/com_installer/tmpl/languages/default.php b/administrator/components/com_installer/tmpl/languages/default.php index bf329b4d3ba08..e14f69e07d226 100644 --- a/administrator/components/com_installer/tmpl/languages/default.php +++ b/administrator/components/com_installer/tmpl/languages/default.php @@ -15,9 +15,10 @@ use Joomla\CMS\Router\Route; use Joomla\CMS\Version; -/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->document->getWebAssetManager(); -$wa->useScript('multiselect'); +$wa->useScript('table.columns') + ->useScript('multiselect'); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); diff --git a/administrator/components/com_installer/tmpl/manage/default.php b/administrator/components/com_installer/tmpl/manage/default.php index a68c49b132656..83f9f94d08ddd 100644 --- a/administrator/components/com_installer/tmpl/manage/default.php +++ b/administrator/components/com_installer/tmpl/manage/default.php @@ -16,8 +16,9 @@ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->document->getWebAssetManager(); -$wa->useScript('multiselect') - ->useScript('com_installer.changelog'); +$wa->useScript('com_installer.changelog') + ->useScript('table.columns') + ->useScript('multiselect'); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); diff --git a/administrator/components/com_installer/tmpl/updatesites/default.php b/administrator/components/com_installer/tmpl/updatesites/default.php index 40371a32b7666..ec4d156125b72 100644 --- a/administrator/components/com_installer/tmpl/updatesites/default.php +++ b/administrator/components/com_installer/tmpl/updatesites/default.php @@ -15,9 +15,10 @@ use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; -/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->document->getWebAssetManager(); -$wa->useScript('multiselect'); +$wa->useScript('table.columns') + ->useScript('multiselect'); $user = Factory::getApplication()->getIdentity(); $userId = $user->get('id'); @@ -93,7 +94,7 @@ editor, $item->checked_out_time, 'updatesites.', $canCheckin); ?> - diff --git a/administrator/components/com_joomlaupdate/tmpl/upload/default.php b/administrator/components/com_joomlaupdate/tmpl/upload/default.php index 2636caa30961a..6294be1376ffb 100644 --- a/administrator/components/com_joomlaupdate/tmpl/upload/default.php +++ b/administrator/components/com_joomlaupdate/tmpl/upload/default.php @@ -83,13 +83,13 @@
- +
- + diff --git a/administrator/components/com_languages/tmpl/installed/default.php b/administrator/components/com_languages/tmpl/installed/default.php index 19cd82a360939..fc58225bfd116 100644 --- a/administrator/components/com_languages/tmpl/installed/default.php +++ b/administrator/components/com_languages/tmpl/installed/default.php @@ -17,6 +17,10 @@ use Joomla\CMS\String\PunycodeHelper; use Joomla\CMS\Version; +/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->document->getWebAssetManager(); +$wa->useScript('table.columns'); + $user = Factory::getUser(); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); diff --git a/administrator/components/com_languages/tmpl/languages/default.php b/administrator/components/com_languages/tmpl/languages/default.php index 600aefa596c57..d41787d26e461 100644 --- a/administrator/components/com_languages/tmpl/languages/default.php +++ b/administrator/components/com_languages/tmpl/languages/default.php @@ -16,9 +16,10 @@ use Joomla\CMS\Router\Route; use Joomla\CMS\Session\Session; -/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->document->getWebAssetManager(); -$wa->useScript('multiselect'); +$wa->useScript('table.columns') + ->useScript('multiselect'); $user = Factory::getUser(); $listOrder = $this->escape($this->state->get('list.ordering')); diff --git a/administrator/components/com_languages/tmpl/overrides/default.php b/administrator/components/com_languages/tmpl/overrides/default.php index e50b4500b0952..7b4081d370457 100644 --- a/administrator/components/com_languages/tmpl/overrides/default.php +++ b/administrator/components/com_languages/tmpl/overrides/default.php @@ -16,9 +16,10 @@ use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; -/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->document->getWebAssetManager(); -$wa->useScript('multiselect'); +$wa->useScript('table.columns') + ->useScript('multiselect'); $client = $this->state->get('filter.client') == 'site' ? Text::_('JSITE') : Text::_('JADMINISTRATOR'); $language = $this->state->get('filter.language'); diff --git a/administrator/components/com_mails/tmpl/templates/default.php b/administrator/components/com_mails/tmpl/templates/default.php index 772904f6c4972..d0c3d023b9a08 100644 --- a/administrator/components/com_mails/tmpl/templates/default.php +++ b/administrator/components/com_mails/tmpl/templates/default.php @@ -16,6 +16,10 @@ HTMLHelper::_('bootstrap.dropdown', '.dropdown-toggle'); +/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->document->getWebAssetManager(); +$wa->useScript('table.columns'); + $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); ?> diff --git a/administrator/components/com_media/resources/scripts/app/Api.es6.js b/administrator/components/com_media/resources/scripts/app/Api.es6.js index 697204b733e16..d9d14895f0be2 100644 --- a/administrator/components/com_media/resources/scripts/app/Api.es6.js +++ b/administrator/components/com_media/resources/scripts/app/Api.es6.js @@ -27,6 +27,9 @@ class Api { this.videoExtensions = options.videoExtensions; this.documentExtensions = options.documentExtensions; this.mediaVersion = (new Date().getTime()).toString(); + this.canCreate = options.canCreate || false; + this.canEdit = options.canEdit || false; + this.canDelete = options.canDelete || false; } /** diff --git a/administrator/components/com_media/resources/scripts/components/browser/actionItems/actionItemsContainer.vue b/administrator/components/com_media/resources/scripts/components/browser/actionItems/actionItemsContainer.vue index ecdc2ae0bb4cf..630322a1ce93b 100644 --- a/administrator/components/com_media/resources/scripts/components/browser/actionItems/actionItemsContainer.vue +++ b/administrator/components/com_media/resources/scripts/components/browser/actionItems/actionItemsContainer.vue @@ -28,7 +28,7 @@ :main-action="openPreview" :closing-action="hideActions" @keyup.up="$refs.actionDelete.$el.focus()" - @keyup.down="$refs.actionDownload.$el.focus()" + @keyup.down="$refs.actionDelete.$el.previousElementSibling.focus()" />
  • @@ -39,11 +39,12 @@ :main-action="download" :closing-action="hideActions" @keyup.up="$refs.actionPreview.$el.focus()" - @keyup.down="$refs.actionRename.$el.focus()" + @keyup.down="$refs.actionPreview.$el.previousElementSibling.focus()" />
  • @@ -83,13 +84,14 @@ @keyup.up=" canEdit ? $refs.actionEdit.$el.focus() - : $refs.actionRename.$el.focus() + : $refs.actionEdit.$el.previousElementSibling.focus() " @keyup.down="$refs.actionDelete.$el.focus()" />
  • @@ -113,6 +115,7 @@ diff --git a/administrator/components/com_media/resources/scripts/components/browser/items/image.vue b/administrator/components/com_media/resources/scripts/components/browser/items/image.vue index 9b25d92967d85..98822dd030013 100644 --- a/administrator/components/com_media/resources/scripts/components/browser/items/image.vue +++ b/administrator/components/com_media/resources/scripts/components/browser/items/image.vue @@ -9,10 +9,16 @@ :title="item.name" >
    -
    + :src="getURL" + :alt="altTag" + loading="lazy" + :width="width" + :height="height" + > +
    1 + ? `${this.item.thumb_path}?${api.mediaVersion}` + : `${this.item.thumb_path}`; + }, + width() { + return this.item.width; + }, + height() { + return this.item.height; + }, + altTag() { + return this.item.name; }, }, methods: { - /* Check if the item is a document to edit */ + /* Check if the item is an image to edit */ canEdit() { return ['jpg', 'jpeg', 'png'].includes(this.item.extension.toLowerCase()); }, diff --git a/administrator/components/com_media/resources/scripts/components/modals/rename-modal.vue b/administrator/components/com_media/resources/scripts/components/modals/rename-modal.vue index 4d3bee44458cc..af36a5a2a0e4f 100644 --- a/administrator/components/com_media/resources/scripts/components/modals/rename-modal.vue +++ b/administrator/components/com_media/resources/scripts/components/modals/rename-modal.vue @@ -116,7 +116,7 @@ export default { // Rename the item this.$store.dispatch('renameItem', { - path: this.item.path, + item: this.item, newPath: newPath + newName, newName, }); diff --git a/administrator/components/com_media/resources/scripts/store/actions.es6.js b/administrator/components/com_media/resources/scripts/store/actions.es6.js index 58db65fc97919..30825caec04fe 100644 --- a/administrator/components/com_media/resources/scripts/store/actions.es6.js +++ b/administrator/components/com_media/resources/scripts/store/actions.es6.js @@ -129,6 +129,9 @@ export const toggleBrowserItemSelect = (context, payload) => { * @param payload object with the new folder name and its parent directory */ export const createDirectory = (context, payload) => { + if (!api.canCreate) { + return; + } context.commit(types.SET_IS_LOADING, true); api.createDirectory(payload.name, payload.parent) .then((folder) => { @@ -150,6 +153,9 @@ export const createDirectory = (context, payload) => { * @param payload object with the new folder name and its parent directory */ export const uploadFile = (context, payload) => { + if (!api.canCreate) { + return; + } context.commit(types.SET_IS_LOADING, true); api.upload(payload.name, payload.parent, payload.content, payload.override || false) .then((file) => { @@ -172,15 +178,22 @@ export const uploadFile = (context, payload) => { /** * Rename an item * @param context - * @param payload object: the old and the new path + * @param payload object: the item and the new path */ export const renameItem = (context, payload) => { + if (!api.canEdit) { + return; + } + + if (typeof payload.item.canEdit !== 'undefined' && payload.item.canEdit === false) { + return; + } context.commit(types.SET_IS_LOADING, true); - api.rename(payload.path, payload.newPath) + api.rename(payload.item.path, payload.newPath) .then((item) => { context.commit(types.RENAME_SUCCESS, { item, - oldPath: payload.path, + oldPath: payload.item.path, newName: payload.newName, }); context.commit(types.HIDE_RENAME_MODAL); @@ -199,11 +212,17 @@ export const renameItem = (context, payload) => { * @param context */ export const deleteSelectedItems = (context) => { + if (!api.canDelete) { + return; + } context.commit(types.SET_IS_LOADING, true); // Get the selected items from the store const { selectedItems } = context.state; if (selectedItems.length > 0) { selectedItems.forEach((item) => { + if (typeof item.canDelete !== 'undefined' && item.canDelete === false) { + return; + } api.delete(item.path) .then(() => { context.commit(types.DELETE_SUCCESS, item); diff --git a/administrator/components/com_media/tmpl/media/default.php b/administrator/components/com_media/tmpl/media/default.php index aff6f9b1f0dd4..94d219bc82a6c 100644 --- a/administrator/components/com_media/tmpl/media/default.php +++ b/administrator/components/com_media/tmpl/media/default.php @@ -14,8 +14,10 @@ use Joomla\CMS\Toolbar\Toolbar; use Joomla\CMS\Uri\Uri; +$app = Factory::getApplication(); $params = ComponentHelper::getParams('com_media'); -$input = Factory::getApplication()->input; +$input = $app->input; +$user = $app->getIdentity(); /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->document->getWebAssetManager(); @@ -39,7 +41,7 @@ $mediaTypes = '&mediatypes=' . $input->getString('mediatypes', '0,1,2,3'); // Populate the media config -$config = array( +$config = [ 'apiBaseUrl' => Uri::base() . 'index.php?option=com_media&format=json' . $mediaTypes, 'csrfToken' => Session::getFormToken(), 'filePath' => $params->get('file_path', 'images'), @@ -54,7 +56,10 @@ 'providers' => (array) $this->providers, 'currentPath' => $this->currentPath, 'isModal' => $tmpl === 'component', -); + 'canCreate' => $user->authorise('core.create', 'com_media'), + 'canEdit' => $user->authorise('core.edit', 'com_media'), + 'canDelete' => $user->authorise('core.delete', 'com_media'), +]; $this->document->addScriptOptions('com_media', $config); ?>
    diff --git a/administrator/components/com_menus/tmpl/items/default.php b/administrator/components/com_menus/tmpl/items/default.php index e8a78caea1834..7b8a79ba495f3 100644 --- a/administrator/components/com_menus/tmpl/items/default.php +++ b/administrator/components/com_menus/tmpl/items/default.php @@ -18,9 +18,10 @@ use Joomla\CMS\Router\Route; use Joomla\CMS\Session\Session; -/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->document->getWebAssetManager(); -$wa->useScript('multiselect'); +$wa->useScript('table.columns') + ->useScript('multiselect'); $user = Factory::getUser(); $app = Factory::getApplication(); diff --git a/administrator/components/com_menus/tmpl/menus/default.php b/administrator/components/com_menus/tmpl/menus/default.php index 6ce6fc3234e0e..29d4da506d5da 100644 --- a/administrator/components/com_menus/tmpl/menus/default.php +++ b/administrator/components/com_menus/tmpl/menus/default.php @@ -15,6 +15,12 @@ use Joomla\CMS\Router\Route; use Joomla\CMS\Uri\Uri; +/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->document->getWebAssetManager(); +$wa->useScript('table.columns') + ->useScript('multiselect') + ->useScript('com_menus.admin-menus'); + $uri = Uri::getInstance(); $return = base64_encode($uri); $user = Factory::getUser(); @@ -32,12 +38,6 @@ } $this->document->addScriptOptions('menus-default', ['items' => $itemIds]); - -/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); -$wa->useScript('multiselect') - ->useScript('com_menus.admin-menus'); - ?>
    diff --git a/administrator/components/com_modules/tmpl/modules/default.php b/administrator/components/com_modules/tmpl/modules/default.php index d45f5c49748c3..c3bccaa60f501 100644 --- a/administrator/components/com_modules/tmpl/modules/default.php +++ b/administrator/components/com_modules/tmpl/modules/default.php @@ -18,9 +18,10 @@ use Joomla\CMS\Router\Route; use Joomla\CMS\Session\Session; -/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->document->getWebAssetManager(); -$wa->useScript('multiselect'); +$wa->useScript('table.columns') + ->useScript('multiselect'); $clientId = (int) $this->state->get('client_id', 0); $user = Factory::getUser(); diff --git a/administrator/components/com_newsfeeds/tmpl/newsfeeds/default.php b/administrator/components/com_newsfeeds/tmpl/newsfeeds/default.php index a2b183359f47a..7611fe76a8789 100644 --- a/administrator/components/com_newsfeeds/tmpl/newsfeeds/default.php +++ b/administrator/components/com_newsfeeds/tmpl/newsfeeds/default.php @@ -18,9 +18,10 @@ use Joomla\CMS\Router\Route; use Joomla\CMS\Session\Session; -/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->document->getWebAssetManager(); -$wa->useScript('multiselect'); +$wa->useScript('table.columns') + ->useScript('multiselect'); $user = Factory::getUser(); $listOrder = $this->escape($this->state->get('list.ordering')); diff --git a/administrator/components/com_plugins/tmpl/plugins/default.php b/administrator/components/com_plugins/tmpl/plugins/default.php index 5973a9d9053d2..541fd8e0f351f 100644 --- a/administrator/components/com_plugins/tmpl/plugins/default.php +++ b/administrator/components/com_plugins/tmpl/plugins/default.php @@ -16,9 +16,10 @@ use Joomla\CMS\Router\Route; use Joomla\CMS\Session\Session; -/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->document->getWebAssetManager(); -$wa->useScript('multiselect'); +$wa->useScript('table.columns') + ->useScript('multiselect'); $user = Factory::getUser(); $listOrder = $this->escape($this->state->get('list.ordering')); diff --git a/administrator/components/com_privacy/tmpl/consents/default.php b/administrator/components/com_privacy/tmpl/consents/default.php index d004d7ad632df..f4240c1933ea2 100644 --- a/administrator/components/com_privacy/tmpl/consents/default.php +++ b/administrator/components/com_privacy/tmpl/consents/default.php @@ -18,9 +18,10 @@ /** @var \Joomla\Component\Privacy\Administrator\View\Consents\HtmlView $this */ -/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->document->getWebAssetManager(); -$wa->useScript('multiselect'); +$wa->useScript('table.columns') + ->useScript('multiselect'); $user = Factory::getUser(); $listOrder = $this->escape($this->state->get('list.ordering')); diff --git a/administrator/components/com_privacy/tmpl/requests/default.php b/administrator/components/com_privacy/tmpl/requests/default.php index 31a300e90714c..9c7a9fa19fcd6 100644 --- a/administrator/components/com_privacy/tmpl/requests/default.php +++ b/administrator/components/com_privacy/tmpl/requests/default.php @@ -19,9 +19,10 @@ /** @var \Joomla\Component\Privacy\Administrator\View\Request\HtmlView $this */ -/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->document->getWebAssetManager(); -$wa->useScript('multiselect'); +$wa->useScript('table.columns') + ->useScript('multiselect'); $user = Factory::getUser(); $listOrder = $this->escape($this->state->get('list.ordering')); diff --git a/administrator/components/com_redirect/tmpl/links/default.php b/administrator/components/com_redirect/tmpl/links/default.php index 70b150d643f1a..8be568281c1e4 100644 --- a/administrator/components/com_redirect/tmpl/links/default.php +++ b/administrator/components/com_redirect/tmpl/links/default.php @@ -16,9 +16,10 @@ use Joomla\CMS\Router\Route; use Joomla\CMS\Uri\Uri; -/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->document->getWebAssetManager(); -$wa->useScript('multiselect'); +$wa->useScript('table.columns') + ->useScript('multiselect'); $user = Factory::getUser(); $listOrder = $this->escape($this->state->get('list.ordering')); diff --git a/administrator/components/com_scheduler/tmpl/tasks/default.php b/administrator/components/com_scheduler/tmpl/tasks/default.php index ec377f9dc30af..d292d8fb6b928 100644 --- a/administrator/components/com_scheduler/tmpl/tasks/default.php +++ b/administrator/components/com_scheduler/tmpl/tasks/default.php @@ -22,6 +22,13 @@ /** @var HtmlView $this*/ +/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ +$wa = $this->document->getWebAssetManager(); +$wa->useScript('table.columns') + ->useScript('multiselect') + ->useScript('com_scheduler.test-task') + ->useStyle('com_scheduler.admin-view-tasks-css'); + Text::script('COM_SCHEDULER_TEST_RUN_TITLE'); Text::script('COM_SCHEDULER_TEST_RUN_TASK'); Text::script('COM_SCHEDULER_TEST_RUN_DURATION'); @@ -60,12 +67,6 @@ } $this->document->addScriptOptions('com_scheduler.test-task.token', Session::getFormToken()); - -/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); -$wa->useScript('multiselect') - ->useScript('com_scheduler.test-task') - ->useStyle('com_scheduler.admin-view-tasks-css'); ?> document->getWebAssetManager(); -$wa->useScript('multiselect'); +$wa->useScript('table.columns') + ->useScript('multiselect'); $app = Factory::getApplication(); $user = Factory::getUser(); diff --git a/administrator/components/com_templates/tmpl/styles/default.php b/administrator/components/com_templates/tmpl/styles/default.php index 68b3e91f97b3c..a610932134949 100644 --- a/administrator/components/com_templates/tmpl/styles/default.php +++ b/administrator/components/com_templates/tmpl/styles/default.php @@ -16,9 +16,10 @@ use Joomla\CMS\Router\Route; use Joomla\CMS\Session\Session; -/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->document->getWebAssetManager(); -$wa->useScript('multiselect'); +$wa->useScript('table.columns') + ->useScript('multiselect'); $user = Factory::getUser(); $clientId = (int) $this->state->get('client_id', 0); diff --git a/administrator/components/com_templates/tmpl/templates/default.php b/administrator/components/com_templates/tmpl/templates/default.php index 9e0515b5001ae..42959af23cca7 100644 --- a/administrator/components/com_templates/tmpl/templates/default.php +++ b/administrator/components/com_templates/tmpl/templates/default.php @@ -15,9 +15,10 @@ use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; -/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->document->getWebAssetManager(); -$wa->useScript('multiselect'); +$wa->useScript('table.columns') + ->useScript('multiselect'); $user = Factory::getUser(); $listOrder = $this->escape($this->state->get('list.ordering')); diff --git a/administrator/components/com_users/tmpl/groups/default.php b/administrator/components/com_users/tmpl/groups/default.php index fa183349a1eb7..def943cd56c4b 100644 --- a/administrator/components/com_users/tmpl/groups/default.php +++ b/administrator/components/com_users/tmpl/groups/default.php @@ -24,8 +24,9 @@ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->document->getWebAssetManager(); -$wa->useScript('multiselect') - ->useScript('com_users.admin-users-groups'); +$wa->useScript('com_users.admin-users-groups') + ->useScript('multiselect') + ->useScript('table.columns'); ?> diff --git a/administrator/components/com_users/tmpl/levels/default.php b/administrator/components/com_users/tmpl/levels/default.php index 2aa16ad339ccf..73fa1285dbfda 100644 --- a/administrator/components/com_users/tmpl/levels/default.php +++ b/administrator/components/com_users/tmpl/levels/default.php @@ -18,9 +18,10 @@ use Joomla\CMS\Session\Session; use Joomla\Component\Users\Administrator\Helper\UsersHelper; -/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->document->getWebAssetManager(); -$wa->useScript('multiselect'); +$wa->useScript('table.columns') + ->useScript('multiselect'); $user = Factory::getUser(); $listOrder = $this->escape($this->state->get('list.ordering')); diff --git a/administrator/components/com_users/tmpl/notes/default.php b/administrator/components/com_users/tmpl/notes/default.php index a252b4dcdfb9c..07586c547a7d5 100644 --- a/administrator/components/com_users/tmpl/notes/default.php +++ b/administrator/components/com_users/tmpl/notes/default.php @@ -15,9 +15,10 @@ use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; -/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->document->getWebAssetManager(); -$wa->useScript('multiselect'); +$wa->useScript('table.columns') + ->useScript('multiselect'); $user = Factory::getUser(); $listOrder = $this->escape($this->state->get('list.ordering')); diff --git a/administrator/components/com_users/tmpl/users/default.php b/administrator/components/com_users/tmpl/users/default.php index 10c73a62bad55..874bbf9b9c605 100644 --- a/administrator/components/com_users/tmpl/users/default.php +++ b/administrator/components/com_users/tmpl/users/default.php @@ -18,9 +18,10 @@ use Joomla\CMS\Router\Route; use Joomla\CMS\String\PunycodeHelper; -/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->document->getWebAssetManager(); -$wa->useScript('multiselect'); +$wa->useScript('table.columns') + ->useScript('multiselect'); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); diff --git a/administrator/components/com_workflow/tmpl/stages/default.php b/administrator/components/com_workflow/tmpl/stages/default.php index da72551232e03..48c4a7969a085 100644 --- a/administrator/components/com_workflow/tmpl/stages/default.php +++ b/administrator/components/com_workflow/tmpl/stages/default.php @@ -16,9 +16,10 @@ use Joomla\CMS\Router\Route; use Joomla\CMS\Session\Session; -/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->document->getWebAssetManager(); -$wa->useScript('multiselect'); +$wa->useScript('table.columns') + ->useScript('multiselect'); $user = Factory::getUser(); $userId = $user->id; diff --git a/administrator/components/com_workflow/tmpl/transitions/default.php b/administrator/components/com_workflow/tmpl/transitions/default.php index 225da1b591a75..6cc6eee815d58 100644 --- a/administrator/components/com_workflow/tmpl/transitions/default.php +++ b/administrator/components/com_workflow/tmpl/transitions/default.php @@ -16,9 +16,10 @@ use Joomla\CMS\Router\Route; use Joomla\CMS\Session\Session; -/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->document->getWebAssetManager(); -$wa->useScript('multiselect'); +$wa->useScript('table.columns') + ->useScript('multiselect'); $user = Factory::getUser(); diff --git a/administrator/components/com_workflow/tmpl/workflows/default.php b/administrator/components/com_workflow/tmpl/workflows/default.php index e8ccd81b41c8b..449445fae312d 100644 --- a/administrator/components/com_workflow/tmpl/workflows/default.php +++ b/administrator/components/com_workflow/tmpl/workflows/default.php @@ -16,9 +16,10 @@ use Joomla\CMS\Router\Route; use Joomla\CMS\Session\Session; -/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ +/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->document->getWebAssetManager(); -$wa->useScript('multiselect'); +$wa->useScript('table.columns') + ->useScript('multiselect'); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); diff --git a/administrator/language/en-GB/install.xml b/administrator/language/en-GB/install.xml index b0d4b74a17a28..48f468c044850 100644 --- a/administrator/language/en-GB/install.xml +++ b/administrator/language/en-GB/install.xml @@ -2,7 +2,7 @@ English (en-GB) en-GB - 4.1.3 + 4.2.0 March 2022 Joomla! Project admin@joomla.org diff --git a/administrator/language/en-GB/joomla.ini b/administrator/language/en-GB/joomla.ini index b14b1967f7179..5f96f9bbab9ec 100644 --- a/administrator/language/en-GB/joomla.ini +++ b/administrator/language/en-GB/joomla.ini @@ -386,6 +386,7 @@ JGLOBAL_CHOOSE_COMPONENT_DESC="Choose a component from the list." JGLOBAL_CHOOSE_COMPONENT_LABEL="Choose a component" JGLOBAL_CLICK_TO_SORT_THIS_COLUMN="Select to sort by this column" JGLOBAL_CLICK_TO_TOGGLE_STATE="Select icon to toggle state." +JGLOBAL_COLUMNS="Columns" JGLOBAL_CONFIRM_DELETE="Are you sure you want to delete? Confirming will permanently delete the selected item(s)!" JGLOBAL_COPY="(copy)" JGLOBAL_CREATED="Created" diff --git a/administrator/language/en-GB/langmetadata.xml b/administrator/language/en-GB/langmetadata.xml index 790f020788d0a..17e38aab3b667 100644 --- a/administrator/language/en-GB/langmetadata.xml +++ b/administrator/language/en-GB/langmetadata.xml @@ -1,7 +1,7 @@ English (en-GB) - 4.1.3 + 4.2.0 March 2022 Joomla! Project admin@joomla.org diff --git a/administrator/language/en-GB/lib_joomla.ini b/administrator/language/en-GB/lib_joomla.ini index 3b9134ff58901..a0b9eda76f124 100644 --- a/administrator/language/en-GB/lib_joomla.ini +++ b/administrator/language/en-GB/lib_joomla.ini @@ -347,7 +347,7 @@ JLIB_FORM_VALUE_CACHE_APCU="APC User Cache" JLIB_FORM_VALUE_CACHE_FILE="File" JLIB_FORM_VALUE_CACHE_MEMCACHED="Memcached (Experimental)" JLIB_FORM_VALUE_CACHE_REDIS="Redis" -JLIB_FORM_VALUE_CACHE_WINCACHE="Windows Cache" +JLIB_FORM_VALUE_CACHE_WINCACHE="Windows Cache (deprecated)" JLIB_FORM_VALUE_FROM_TEMPLATE="From Template" JLIB_FORM_VALUE_INHERITED="Inherited" JLIB_FORM_VALUE_SESSION_APCU="APC User Cache" @@ -355,7 +355,7 @@ JLIB_FORM_VALUE_SESSION_DATABASE="Database" JLIB_FORM_VALUE_SESSION_FILESYSTEM="Filesystem" JLIB_FORM_VALUE_SESSION_MEMCACHED="Memcached (Experimental)" JLIB_FORM_VALUE_SESSION_REDIS="Redis" -JLIB_FORM_VALUE_SESSION_WINCACHE="Windows Cache" +JLIB_FORM_VALUE_SESSION_WINCACHE="Windows Cache (deprecated)" JLIB_FORM_VALUE_TIMEZONE_UTC="Universal Time, Coordinated (UTC)" JLIB_HTML_ACCESS_MODIFY_DESC_CAPTION_ACL="ACL" JLIB_HTML_ACCESS_MODIFY_DESC_CAPTION_TABLE="Table" diff --git a/administrator/manifests/files/joomla.xml b/administrator/manifests/files/joomla.xml index ded6b256eef15..62403174b252f 100644 --- a/administrator/manifests/files/joomla.xml +++ b/administrator/manifests/files/joomla.xml @@ -6,7 +6,7 @@ www.joomla.org (C) 2019 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt - 4.1.3-dev + 4.2.0-alpha2-dev March 2022 FILES_JOOMLA_XML_DESCRIPTION diff --git a/administrator/manifests/packages/pkg_en-GB.xml b/administrator/manifests/packages/pkg_en-GB.xml index 08fb1db813b0e..6a791c88f139d 100644 --- a/administrator/manifests/packages/pkg_en-GB.xml +++ b/administrator/manifests/packages/pkg_en-GB.xml @@ -2,7 +2,7 @@ English (en-GB) Language Pack en-GB - 4.1.3.1 + 4.2.0.1 March 2022 Joomla! Project admin@joomla.org diff --git a/api/components/com_content/src/Controller/ArticlesController.php b/api/components/com_content/src/Controller/ArticlesController.php index 691a64936022b..bf616d451a866 100644 --- a/api/components/com_content/src/Controller/ArticlesController.php +++ b/api/components/com_content/src/Controller/ArticlesController.php @@ -75,6 +75,18 @@ public function displayList() $this->modelState->set('filter.language', $filter->clean($apiFilterInfo['language'], 'STRING')); } + $apiListInfo = $this->input->get('list', [], 'array'); + + if (array_key_exists('ordering', $apiListInfo)) + { + $this->modelState->set('list.ordering', $filter->clean($apiListInfo['ordering'], 'STRING')); + } + + if (array_key_exists('direction', $apiListInfo)) + { + $this->modelState->set('list.direction', $filter->clean($apiListInfo['direction'], 'STRING')); + } + return parent::displayList(); } diff --git a/api/language/en-GB/install.xml b/api/language/en-GB/install.xml index c5dff0cdb9584..10fb3c512d09e 100644 --- a/api/language/en-GB/install.xml +++ b/api/language/en-GB/install.xml @@ -2,7 +2,7 @@ English (en-GB) en-GB - 4.1.3 + 4.2.0 March 2022 Joomla! Project admin@joomla.org diff --git a/api/language/en-GB/langmetadata.xml b/api/language/en-GB/langmetadata.xml index bfe7388494b0e..9f2920531a8b8 100644 --- a/api/language/en-GB/langmetadata.xml +++ b/api/language/en-GB/langmetadata.xml @@ -1,7 +1,7 @@ English (en-GB) - 4.1.3 + 4.2.0 March 2022 Joomla! Project admin@joomla.org diff --git a/build.xml b/build.xml index eca54ed52ef28..02218eaf40946 100644 --- a/build.xml +++ b/build.xml @@ -85,7 +85,7 @@ - + diff --git a/build/media_source/com_installer/js/installer.es6.js b/build/media_source/com_installer/js/installer.es6.js index caa8ca66df49f..2af938ff76f76 100644 --- a/build/media_source/com_installer/js/installer.es6.js +++ b/build/media_source/com_installer/js/installer.es6.js @@ -11,12 +11,12 @@ const installer = document.getElementById('installer-install'); if (loading && installer) { - loading.style.top = parseInt(installer.offsetTop - window.pageYOffset, 10); + loading.style.position = 'absolute'; + loading.style.top = 0; loading.style.left = 0; loading.style.width = '100%'; loading.style.height = '100%'; loading.classList.add('hidden'); - loading.style.marginTop = '-10px'; } }); })(); diff --git a/build/media_source/com_joomlaupdate/js/default.es6.js b/build/media_source/com_joomlaupdate/js/default.es6.js index ce4398ad1badb..cad9bef335a43 100644 --- a/build/media_source/com_joomlaupdate/js/default.es6.js +++ b/build/media_source/com_joomlaupdate/js/default.es6.js @@ -44,6 +44,7 @@ Joomla = window.Joomla || {}; }; document.addEventListener('DOMContentLoaded', () => { + const uploadForm = document.getElementById('uploadForm'); const uploadButton = document.getElementById('uploadButton'); const uploadField = document.getElementById('install_package'); const installButton = document.querySelector('.emptystate-btnadd', document.getElementById('joomlaupdate-wrapper')); @@ -52,9 +53,28 @@ Joomla = window.Joomla || {}; const task = form ? form.querySelector('[name=task]', form) : null; if (uploadButton) { uploadButton.addEventListener('click', Joomla.submitbuttonUpload); + updateCheck.addEventListener('change', () => { + uploadButton.disabled = !updateCheck.checked; + }); } if (uploadField) { uploadField.addEventListener('change', Joomla.installpackageChange); + uploadField.addEventListener('change', () => { + const fileSize = uploadForm.install_package.files[0].size; + const allowedSize = uploadForm.max_upload_size.value; + if (fileSize <= allowedSize && updateCheck.disabled) { + updateCheck.disabled = !updateCheck.disabled; + } else if (fileSize <= allowedSize && !updateCheck.disabled && !updateCheck.checked) { + updateCheck.disabled = false; + } else if (fileSize <= allowedSize && updateCheck.checked) { + updateCheck.checked = false; + uploadButton.disabled = true; + } else if (fileSize > allowedSize && !updateCheck.disabled) { + updateCheck.disabled = !updateCheck.disabled; + updateCheck.checked = false; + uploadButton.disabled = true; + } + }); } // Trigger (re-) install (including checkbox confirm if we update) if (installButton && installButton.getAttribute('href') === '#' && task) { diff --git a/build/media_source/com_media/scss/components/_media-browser.scss b/build/media_source/com_media/scss/components/_media-browser.scss index 9d0cbed5acb55..b6bcfa75231d0 100644 --- a/build/media_source/com_media/scss/components/_media-browser.scss +++ b/build/media_source/com_media/scss/components/_media-browser.scss @@ -204,13 +204,23 @@ } .image-cropped { - padding-bottom: 100%; - background-repeat: no-repeat; - background-position: center; - background-size: contain; + aspect-ratio: 1/1; + max-width: 100%; + height: auto; + object-fit: contain; border-radius: $grid-item-border-radius; } +.image-placeholder { + display: flex; + align-items: center; + justify-content: center; + aspect-ratio: 1/1; + max-width: 100%; + height: auto; + color: #9d9d9d; +} + .file-background, .folder-background { padding-bottom: 100%; background-color: hsl(var(--hue), 20%, 97%); diff --git a/build/media_source/system/joomla.asset.json b/build/media_source/system/joomla.asset.json index e4d8a65543529..56bb579487c6a 100644 --- a/build/media_source/system/joomla.asset.json +++ b/build/media_source/system/joomla.asset.json @@ -150,6 +150,19 @@ "type": "style", "uri": "system/fields/switcher.min.css" }, + { + "name": "table.columns", + "type": "script", + "class": "TableColumnsAssetItem", + "uri": "system/table-columns.min.js", + "dependencies": [ + "core" + ], + "attributes": { + "defer": true, + "type": "module" + } + }, { "name": "form.validate", "type": "script", diff --git a/build/media_source/system/js/multiselect.es6.js b/build/media_source/system/js/multiselect.es6.js index 038c871e433ff..5ac631e6db782 100644 --- a/build/media_source/system/js/multiselect.es6.js +++ b/build/media_source/system/js/multiselect.es6.js @@ -14,7 +14,7 @@ this.tableEl = document.querySelector(formElement); if (this.tableEl) { - this.boxes = [].slice.call(this.tableEl.querySelectorAll('input[type=checkbox]')); + this.boxes = [].slice.call(this.tableEl.querySelectorAll('td input[type=checkbox]')); this.rows = [].slice.call(document.querySelectorAll('tr[class^="row"]')); this.checkallToggle = document.querySelector('[name="checkall-toggle"]'); diff --git a/build/media_source/system/js/table-columns.es6.js b/build/media_source/system/js/table-columns.es6.js new file mode 100644 index 0000000000000..a233c0fb103df --- /dev/null +++ b/build/media_source/system/js/table-columns.es6.js @@ -0,0 +1,204 @@ +/** + * TableColumns class for toggle visibility of columns. + */ +class TableColumns { + constructor($table, tableName) { + this.$table = $table; + this.tableName = tableName; + this.storageKey = `joomla-tablecolumns-${this.tableName}`; + + this.$headers = [].slice.call($table.querySelector('thead tr').children); + this.$rows = [].slice.call($table.querySelectorAll('tbody tr')); + this.listOfHidden = []; + + // Load previous state + this.loadState(); + + // Find protected columns + this.protectedCols = [0]; + if (this.$rows[0]) { + [].slice.call(this.$rows[0].children).forEach(($el, index) => { + if ($el.nodeName === 'TH') { + this.protectedCols.push(index); + + // Make sure it's not in the list of hidden + const ih = this.listOfHidden.indexOf(index); + if (ih !== -1) { + this.listOfHidden.splice(ih, 1); + } + } + }); + } + + // Set up toggle menu + this.createControls(); + + // Restore state + this.listOfHidden.forEach((index) => { + this.toggleColumn(index, true); + }); + } + + /** + * Create a controls to select visible columns + */ + createControls() { + const $divouter = document.createElement('div'); + $divouter.setAttribute('class', 'dropdown float-end pb-2'); + + const $divinner = document.createElement('div'); + $divinner.setAttribute('class', 'dropdown-menu dropdown-menu-end'); + $divinner.setAttribute('data-bs-popper', 'static'); + + // Create a toggle button + const $button = document.createElement('button'); + $button.type = 'button'; + $button.textContent = Joomla.Text._('JGLOBAL_COLUMNS'); + $button.classList.add('btn', 'btn-primary', 'btn-sm', 'dropdown-toggle'); + $button.setAttribute('data-bs-toggle', 'dropdown'); + $button.setAttribute('data-bs-auto-close', 'false'); + $button.setAttribute('aria-haspopup', 'true'); + $button.setAttribute('aria-expanded', 'false'); + + const $ul = document.createElement('ul'); + $ul.setAttribute('class', 'list-unstyled p-2'); + $ul.setAttribute('id', 'columnList'); + + // Collect a list of headers for dropdown + this.$headers.forEach(($el, index) => { + // Skip the first column, unless it's a th, as we don't want to display the checkboxes + if (index === 0 && $el.nodeName !== 'TH') return; + + const $li = document.createElement('li'); + const $label = document.createElement('label'); + const $input = document.createElement('input'); + $input.classList.add('form-check-input', 'me-1'); + $input.type = 'checkbox'; + $input.name = 'table[column][]'; + $input.checked = this.listOfHidden.indexOf(index) === -1; + $input.disabled = this.protectedCols.indexOf(index) !== -1; + $input.value = index; + + // Find the header name + let $titleEl = $el.querySelector('span'); + let title = $titleEl ? $titleEl.textContent.trim() : ''; + + if (!title) { + $titleEl = $el.querySelector('span.visually-hidden') || $el; + title = $titleEl.textContent.trim(); + } + + if (title.includes(':')) { + title = title.split(':', 2)[1].trim(); + } + + $label.textContent = title; + $label.insertAdjacentElement('afterbegin', $input); + $li.appendChild($label); + $ul.appendChild($li); + }); + + this.$table.insertAdjacentElement('beforebegin', $divouter); + $divouter.appendChild($button); + $divouter.appendChild($divinner); + $divinner.appendChild($ul); + + // Listen to checkboxes change + $ul.addEventListener('change', (event) => { + this.toggleColumn(parseInt(event.target.value, 10)); + this.saveState(); + }); + + // Remove "media query" classes, which may prevent toggling from working. + this.$headers.forEach(($el) => { + $el.classList.remove('d-none', 'd-md-table-cell', 'd-lg-table-cell', 'd-xl-table-cell'); + }); + this.$rows.forEach(($row) => { + [].slice.call($row.children).forEach(($el) => { + $el.classList.remove('d-none', 'd-md-table-cell', 'd-lg-table-cell', 'd-xl-table-cell'); + }); + }); + + this.$button = $button; + this.$menu = $ul; + this.updateCounter(); + } + + /** + * Update button text + */ + updateCounter() { + // Don't count the checkboxes column in the total + const total = this.$headers.length - 1; + const visible = total - this.listOfHidden.length; + + this.$button.textContent = `${visible}/${total} ${Joomla.Text._('JGLOBAL_COLUMNS')}`; + } + + /** + * Toggle column visibility + * + * @param {Number} index The column index + * @param {Boolean} force To force hide + */ + toggleColumn(index, force) { + // Skip incorrect index + if (!this.$headers[index]) return; + + // Skip the protected columns + if (this.protectedCols.indexOf(index) !== -1) return; + + const i = this.listOfHidden.indexOf(index); + + if (i === -1) { + this.listOfHidden.push(index); + } else if (force !== true) { + this.listOfHidden.splice(i, 1); + } + + this.$headers[index].classList.toggle('d-none', force); + + this.$rows.forEach(($col) => { + $col.children[index].classList.toggle('d-none', force); + }); + + this.updateCounter(); + } + + /** + * Save state, list of hidden columns + */ + saveState() { + window.localStorage.setItem(this.storageKey, this.listOfHidden.join(',')); + } + + /** + * Load state, list of hidden columns + */ + loadState() { + const stored = window.localStorage.getItem(this.storageKey); + + if (stored) { + this.listOfHidden = stored.split(',').map((val) => parseInt(val, 10)); + } + } +} + +if (window.innerWidth > 992) { + // Look for dataset name else page-title + [...document.querySelectorAll('table')].forEach(($table) => { + const tableName = ($table.dataset.name ? $table.dataset.name : document.querySelector('.page-title') + .textContent.trim() + .replace(/[^a-z0-9]/gi, '-') + .toLowerCase() + ); + + // Skip unnamed table + if (!tableName) { + return; + } + + /* eslint-disable-next-line no-new */ + new TableColumns($table, tableName); + }); +} diff --git a/components/com_content/src/Controller/ArticleController.php b/components/com_content/src/Controller/ArticleController.php index 2c440673ce2ee..b6005eb5b9a98 100644 --- a/components/com_content/src/Controller/ArticleController.php +++ b/components/com_content/src/Controller/ArticleController.php @@ -367,6 +367,12 @@ protected function getReturnPage() public function save($key = null, $urlVar = 'a_id') { $result = parent::save($key, $urlVar); + + if (\in_array($this->getTask(), ['save2copy', 'apply'], true)) + { + return $result; + } + $app = Factory::getApplication(); $articleId = $app->input->getInt('a_id'); diff --git a/components/com_content/tmpl/form/edit.php b/components/com_content/tmpl/form/edit.php index 5b5865023f31e..1437c88d14546 100644 --- a/components/com_content/tmpl/form/edit.php +++ b/components/com_content/tmpl/form/edit.php @@ -157,10 +157,14 @@
    - + showSaveAsCopy) : ?>