diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 9df1f82be5060..0f0f125f38d3b 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -19,7 +19,6 @@ There are other branches available which serve specific purposes. | Branch | Purpose | | ------ | ------- | -| staging | Current codebase. | +| staging | Current codebase. Branch for the next minor Joomla version. New backward compatible features go into this branch. | | master | Each commit made to staging gets tested if it passes unit tests and codestyle rules. It is then merged into master. This is done automatically. | -| 2.5.x | Branch for the Joomla 2.5.x series. Support for this version has ended, no patches are accepted here. | -| 3.6.x | Branch for the next minor Joomla version. New backward compatible features go into this branch. Commits to staging will be applied to this branch as well. | +| 4.0-dev | Branch for the next major Joomla version. New backward incompatible features go into this branch. Commits to staging will be applied to this branch as well. | diff --git a/.travis.yml b/.travis.yml index 183a163597d01..e5be82a2e6ddc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,7 +48,6 @@ matrix: - redis-server env: INSTALL_APCU_BC_BETA="no" INSTALL_MEMCACHE="no" INSTALL_MEMCACHED="no" # Disabled items that currently do not work in travis-ci hhvm allow_failures: - - php: 7.1 - php: hhvm - node_js: 6.1 diff --git a/README.md b/README.md index d1f2bafc8ab75..1f1ee778ac0c7 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ What is this? What is Joomla? --------------------- * [Joomla!](https://www.joomla.org/about-joomla.html) is a **Content Management System** (CMS) which enables you to build websites and powerful online applications. -* It is a simple and powerful web server application which requires a server with PHP and either MySQL, PostgreSQL or SQL Server to run. You can find [full technical requirements here](https://www.joomla.org/about-joomla/technical-requirements.html). +* It is a simple and powerful web server application which requires a server with PHP and either MySQL, PostgreSQL or SQL Server to run. You can find [full technical requirements here](https://downloads.joomla.org/technical-requirements). * Joomla! is **free and Open Source software** distributed under the GNU General Public License version 2 or later. Is Joomla! for you? @@ -50,14 +50,14 @@ Is it easy to change the layout display? Ready to install Joomla? --------------------- -* Check the [minimum requirements](https://www.joomla.org/about-joomla/technical-requirements.html). +* Check the [minimum requirements](https://downloads.joomla.org/technical-requirements). * How do you [install Joomla](https://docs.joomla.org/J3.x:Installing_Joomla)? * You could start your Joomla! experience by [building your site on a local test server](https://docs.joomla.org/Installing_Joomla_locally). When ready, it can be moved to an online hosting account of your choice. Updates are free! --------------------- -* Always use the [latest version](https://www.joomla.org/download.html). +* Always use the [latest version](https://downloads.joomla.org/latest). Where can you get support and help? --------------------- diff --git a/README.txt b/README.txt index 467eeec1a24d0..163410ea2498f 100644 --- a/README.txt +++ b/README.txt @@ -8,7 +8,7 @@ * Joomla! is a Content Management System (CMS) which enables you to build Web sites and powerful online applications. * It's a free and Open Source software, distributed under the GNU General Public License version 2 or later. * This is a simple and powerful web server application and it requires a server with PHP and either MySQL, PostgreSQL or SQL Server to run. - You can find full technical requirements here: https://www.joomla.org/about-joomla/technical-requirements.html. + You can find full technical requirements here: https://downloads.joomla.org/technical-requirements. 3- Is Joomla! for you? * Joomla! is the right solution for most content web projects: https://docs.joomla.org/Portal:Learn_More @@ -35,14 +35,14 @@ * Check out the template management information: https://docs.joomla.org/Portal:Template_Management 8- Ready to install Joomla? - * Check the minimum requirements here: https://www.joomla.org/about-joomla/technical-requirements.html + * Check the minimum requirements here: https://downloads.joomla.org/technical-requirements * How do you install Joomla - https://docs.joomla.org/J3.x:Installing_Joomla * You could start your Joomla! experience building your site on a local test server. When ready it can be moved to an online hosting account of your choice. See the tutorial: https://docs.joomla.org/Installing_Joomla_locally 9- Updates are free! - * Always use the latest version: https://www.joomla.org/download.html + * Always use the latest version: https://downloads.joomla.org/latest 10- Where can you get support and help? * The Joomla! Documentation: https://docs.joomla.org/Main_Page diff --git a/administrator/components/com_admin/postinstall/joomla40checks.php b/administrator/components/com_admin/postinstall/joomla40checks.php new file mode 100644 index 0000000000000..9ddd31b98c859 --- /dev/null +++ b/administrator/components/com_admin/postinstall/joomla40checks.php @@ -0,0 +1,50 @@ +getServerType(); + $serverVersion = $db->getVersion(); + + if ($serverType == 'mssql') + { + // MS SQL support will be dropped + return true; + } + + if ($serverType == 'postgresql' && version_compare($serverVersion, '9.2', 'lt')) + { + // PostgreSQL minimum version is 9.2 + return true; + } + + + if ($serverType == 'mysql' && version_compare($serverVersion, '5.5.3', 'lt')) + { + // MySQL minimum version is 5.5.3 + return true; + } + + // PHP minimum version is 5.5 + return version_compare(PHP_VERSION, '5.5.9', 'lt'); +} diff --git a/administrator/components/com_admin/script.php b/administrator/components/com_admin/script.php index e27036715fb5d..5c4fc2a73a68d 100644 --- a/administrator/components/com_admin/script.php +++ b/administrator/components/com_admin/script.php @@ -242,6 +242,7 @@ protected function updateManifestCaches() array('component', 'com_contenthistory', '', 1), array('component', 'com_postinstall', '', 1), array('component', 'com_joomlaupdate', '', 1), + array('component', 'com_fields', '', 1), // Libraries array('library', 'phputf8', '', 0), @@ -349,6 +350,8 @@ protected function updateManifestCaches() array('plugin', 'phpversioncheck', 'quickicon', 0), array('plugin', 'menu', 'editors-xtd', 0), array('plugin', 'contact', 'editors-xtd', 0), + array('plugin', 'fields', 'system', 0), + array('plugin', 'gallery', 'fields', 0), // Templates array('template', 'beez3', '', 0), @@ -1449,7 +1452,7 @@ public function deleteUnexistingFiles() '/media/editors/tinymce/plugins/compat3x/editable_selects.js', '/media/editors/tinymce/plugins/compat3x/form_utils.js', '/media/editors/tinymce/plugins/compat3x/mctabs.js', - '/media/editors/tinymce/plugins/compat3x/tiny_mce_popup.js', + '/media/editors/tinymce/plugins/compat3x/tiny_mce_popup.js', '/media/editors/tinymce/plugins/compat3x/validate.js', '/libraries/vendor/symfony/yaml/Symfony/Component/Yaml/Dumper.php', '/libraries/vendor/symfony/yaml/Symfony/Component/Yaml/Escaper.php', @@ -1516,6 +1519,33 @@ public function deleteUnexistingFiles() '/administrator/components/com_redirect/views/links/tmpl/default_batch.php', '/administrator/components/com_tags/views/tags/tmpl/default_batch.php', '/administrator/components/com_users/views/users/tmpl/default_batch.php', + '/components/com_contact/metadata.xml', + '/components/com_contact/views/category/metadata.xml', + '/components/com_contact/views/contact/metadata.xml', + '/components/com_contact/views/featured/metadata.xml', + '/components/com_content/metadata.xml', + '/components/com_content/views/archive/metadata.xml', + '/components/com_content/views/article/metadata.xml', + '/components/com_content/views/categories/metadata.xml', + '/components/com_content/views/category/metadata.xml', + '/components/com_content/views/featured/metadata.xml', + '/components/com_content/views/form/metadata.xml', + '/components/com_finder/views/search/metadata.xml', + '/components/com_mailto/views/mailto/metadata.xml', + '/components/com_mailto/views/sent/metadata.xml', + '/components/com_newsfeeds/metadata.xml', + '/components/com_newsfeeds/views/category/metadata.xml', + '/components/com_newsfeeds/views/newsfeed/metadata.xml', + '/components/com_search/views/search/metadata.xml', + '/components/com_tags/metadata.xml', + '/components/com_tags/views/tag/metadata.xml', + '/components/com_users/metadata.xml', + '/components/com_users/views/login/metadata.xml', + '/components/com_users/views/profile/metadata.xml', + '/components/com_users/views/registration/metadata.xml', + '/components/com_users/views/remind/metadata.xml', + '/components/com_users/views/reset/metadata.xml', + '/components/com_wrapper/metadata.xml', ); // TODO There is an issue while deleting folders using the ftp mode @@ -1695,7 +1725,8 @@ public function updateAssets() 'com_tags', 'com_contenthistory', 'com_ajax', - 'com_postinstall' + 'com_postinstall', + 'com_fields', ); foreach ($newComponents as $component) diff --git a/administrator/components/com_admin/sql/updates/mysql/3.7.0-2016-08-29.sql b/administrator/components/com_admin/sql/updates/mysql/3.7.0-2016-08-29.sql new file mode 100644 index 0000000000000..bbe6de6f98aa3 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.7.0-2016-08-29.sql @@ -0,0 +1,56 @@ +CREATE TABLE IF NOT EXISTS `#__fields` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `asset_id` int(10) NOT NULL DEFAULT 0, + `context` varchar(255) NOT NULL DEFAULT '', + `catid` int(10) NOT NULL DEFAULT 0, + `assigned_cat_ids` varchar(255) NOT NULL DEFAULT '', + `title` varchar(255) NOT NULL DEFAULT '', + `alias` varchar(255) NOT NULL DEFAULT '', + `label` varchar(255) NOT NULL DEFAULT '', + `default_value` text NOT NULL DEFAULT '', + `type` varchar(255) NOT NULL DEFAULT 'text', + `options` varchar(255) NOT NULL DEFAULT '', + `note` varchar(255) NOT NULL DEFAULT '', + `description` text NOT NULL, + `state` tinyint(1) NOT NULL DEFAULT '0', + `required` tinyint(1) NOT NULL DEFAULT '0', + `checked_out` int(11) NOT NULL DEFAULT '0', + `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `ordering` int(11) NOT NULL DEFAULT '0', + `params` text NOT NULL, + `fieldparams` text NOT NULL, + `attributes` text NOT NULL, + `language` char(7) NOT NULL DEFAULT '', + `created_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `created_user_id` int(10) unsigned NOT NULL DEFAULT '0', + `created_by_alias` varchar(255) NOT NULL DEFAULT '', + `modified_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `modified_by` int(10) unsigned NOT NULL DEFAULT '0', + `publish_up` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `publish_down` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `access` int(11) NOT NULL DEFAULT '1', + PRIMARY KEY (`id`), + KEY `idx_checkout` (`checked_out`), + KEY `idx_state` (`state`), + KEY `idx_created_user_id` (`created_user_id`), + KEY `idx_access` (`access`), + KEY `idx_context` (`context`), + KEY `idx_language` (`language`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; + +CREATE TABLE IF NOT EXISTS `#__fields_values` ( + `field_id` int(10) unsigned NOT NULL, + `context` varchar(255) NOT NULL, + `item_id` varchar(255) NOT NULL COMMENT 'Allow references to items which have strings as ids, eg. none db systems.', + `value` text NOT NULL DEFAULT '', + KEY (`field_id`), + KEY (`context`), + KEY (`item_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; + +INSERT INTO `#__extensions` (`extension_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `system_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES +(33, 'com_fields', 'component', 'com_fields', '', 1, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0); +INSERT INTO `#__extensions` (`extension_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `system_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES +(461, 'plg_system_fields', 'plugin', 'fields', 'system', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0); +INSERT INTO `#__extensions` (`extension_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `system_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES +(462, 'plg_fields_gallery', 'plugin', 'gallery', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/mysql/3.7.0-2016-09-29.sql b/administrator/components/com_admin/sql/updates/mysql/3.7.0-2016-09-29.sql new file mode 100644 index 0000000000000..6ee23ef7b0d3c --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.7.0-2016-09-29.sql @@ -0,0 +1,3 @@ +INSERT INTO `#__postinstall_messages` (`extension_id`, `title_key`, `description_key`, `action_key`, `language_extension`, `language_client_id`, `type`, `action_file`, `action`, `condition_file`, `condition_method`, `version_introduced`, `enabled`) +VALUES +(700, 'COM_CPANEL_MSG_JOOMLA40_PRE_CHECKS_TITLE', 'COM_CPANEL_MSG_JOOMLA40_PRE_CHECKS_BODY', '', 'com_cpanel', 1, 'message', '', '', 'admin://components/com_admin/postinstall/joomla40checks.php', 'admin_postinstall_joomla40checks_condition', '3.7.0', 1); diff --git a/administrator/components/com_admin/sql/updates/mysql/3.7.0-2016-11-04.sql b/administrator/components/com_admin/sql/updates/mysql/3.7.0-2016-11-04.sql new file mode 100644 index 0000000000000..0281c97232aaa --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.7.0-2016-11-04.sql @@ -0,0 +1 @@ +ALTER TABLE `#__extensions` CHANGE `enabled` `enabled` TINYINT(3) NOT NULL DEFAULT '0'; \ No newline at end of file diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-08-29.sql b/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-08-29.sql new file mode 100644 index 0000000000000..cc13bcb67b178 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-08-29.sql @@ -0,0 +1,61 @@ +-- +-- Table: #__fields +-- +CREATE TABLE "#__fields" ( + "id" serial NOT NULL, + "asset_id" bigint DEFAULT 0 NOT NULL, + "context" varchar(255) DEFAULT '' NOT NULL, + "catid" bigint DEFAULT 0 NOT NULL, + "assigned_cat_ids" varchar(255) DEFAULT '' NOT NULL, + "title" varchar(255) DEFAULT '' NOT NULL, + "alias" varchar(255) DEFAULT '' NOT NULL, + "label" varchar(255) DEFAULT '' NOT NULL, + "default_value" text DEFAULT '' NOT NULL, + "type" varchar(255) DEFAULT 'text' NOT NULL, + "options" varchar(255) DEFAULT '' NOT NULL, + "note" varchar(255) DEFAULT '' NOT NULL, + "description" text DEFAULT '' NOT NULL, + "state" smallint DEFAULT 0 NOT NULL, + "required" smallint DEFAULT 0 NOT NULL, + "checked_out" integer DEFAULT 0 NOT NULL, + "checked_out_time" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL, + "ordering" bigint DEFAULT 0 NOT NULL, + "params" text DEFAULT '' NOT NULL, + "fieldparams" text DEFAULT '' NOT NULL, + "attributes" text DEFAULT '' NOT NULL, + "language" varchar(7) DEFAULT '' NOT NULL, + "created_time" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL, + "created_user_id" bigint DEFAULT 0 NOT NULL, + "created_by_alias" varchar(255) DEFAULT '' NOT NULL, + "modified_time" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL, + "modified_by" bigint DEFAULT 0 NOT NULL, + "publish_up" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL, + "publish_down" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL, + "access" bigint DEFAULT 0 NOT NULL, + PRIMARY KEY ("id") +); +CREATE INDEX "#__fields_idx_checked_out" ON "#__fields" ("checked_out"); +CREATE INDEX "#__fields_idx_state" ON "#__fields" ("state"); +CREATE INDEX "#__fields_idx_created_user_id" ON "#__fields" ("created_user_id"); +CREATE INDEX "#__fields_idx_access" ON "#__fields" ("access"); +CREATE INDEX "#__fields_idx_context" ON "#__fields" ("context"); +CREATE INDEX "#__fields_idx_language" ON "#__fields" ("language"); + +-- +-- Table: #__fields_values +-- +CREATE TABLE "#__fields_values" ( +"field_id" bigint DEFAULT 0 NOT NULL, +"item_id" varchar(255) DEFAULT '' NOT NULL, +"context" varchar(255) DEFAULT '' NOT NULL, +"value" text DEFAULT '' NOT NULL +); +CREATE INDEX "#__fields_values_idx_field_id" ON "#__fields_values" ("field_id"); +CREATE INDEX "#__fields_values_idx_context" ON "#__fields_values" ("context"); +CREATE INDEX "#__fields_values_idx_item_id" ON "#__fields_values" ("item_id"); + +INSERT INTO "#__extensions" ("extension_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "custom_data", "system_data", "checked_out", "checked_out_time", "ordering", "state") VALUES +(33, 'com_fields', 'component', 'com_fields', '', 1, 1, 1, 1, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0), +(461, 'plg_system_fields', 'plugin', 'fields', 'system', 0, 1, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0), +(462, 'plg_fields_gallery', 'plugin', 'gallery', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0); + diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-09-29.sql b/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-09-29.sql new file mode 100644 index 0000000000000..4bfd02b6a7e36 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-09-29.sql @@ -0,0 +1,3 @@ +INSERT INTO "#__postinstall_messages" ("extension_id", "title_key", "description_key", "action_key", "language_extension", "language_client_id", "type", "action_file", "action", "condition_file", "condition_method", "version_introduced", "enabled") +VALUES +(700, 'COM_CPANEL_MSG_JOOMLA40_PRE_CHECKS_TITLE', 'COM_CPANEL_MSG_JOOMLA40_PRE_CHECKS_BODY', '', 'com_cpanel', 1, 'message', '', '', 'admin://components/com_admin/postinstall/joomla40checks.php', 'admin_postinstall_joomla40checks_condition', '3.7.0', 1); diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-11-04.sql b/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-11-04.sql new file mode 100644 index 0000000000000..f423add87448a --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-11-04.sql @@ -0,0 +1 @@ +ALTER TABLE "#__extensions" ALTER COLUMN "enabled" SET DEFAULT 0; \ No newline at end of file diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2016-09-29.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2016-09-29.sql new file mode 100644 index 0000000000000..9da07dbbff1a8 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2016-09-29.sql @@ -0,0 +1,6 @@ +SET IDENTITY_INSERT [#__postinstall_messages] ON; + +INSERT INTO [#__postinstall_messages] ([extension_id], [title_key], [description_key], [action_key], [language_extension], [language_client_id], [type], [action_file], [action], [condition_file], [condition_method], [version_introduced], [enabled]) +SELECT 700, 'COM_CPANEL_MSG_JOOMLA40_PRE_CHECKS_TITLE', 'COM_CPANEL_MSG_JOOMLA40_PRE_CHECKS_BODY', '', 'com_cpanel', 1, 'message', '', '', 'admin://components/com_admin/postinstall/joomla40checks.php', 'admin_postinstall_joomla40checks_condition', '3.7.0', 1; + +SET IDENTITY_INSERT [#__postinstall_messages] OFF; \ No newline at end of file diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2016-11-04.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2016-11-04.sql new file mode 100644 index 0000000000000..9b77ec2d3520c --- /dev/null +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2016-11-04.sql @@ -0,0 +1 @@ +ALTER TABLE [#__extensions] ALTER COLUMN [enabled] DEFAULT 0; \ No newline at end of file diff --git a/administrator/components/com_admin/views/help/view.html.php b/administrator/components/com_admin/views/help/view.html.php index c24445530c572..d379ad41f26f6 100644 --- a/administrator/components/com_admin/views/help/view.html.php +++ b/administrator/components/com_admin/views/help/view.html.php @@ -54,7 +54,7 @@ class AdminViewHelp extends JViewLegacy * @var string * @since 1.6 */ - protected $latest_version_check = 'https://www.joomla.org/download.html'; + protected $latest_version_check = 'https://downloads.joomla.org/latest'; /** * URL for the start here link diff --git a/administrator/components/com_banners/models/fields/bannerclient.php b/administrator/components/com_banners/models/fields/bannerclient.php index ec9281ed9a341..1351a2afa1827 100644 --- a/administrator/components/com_banners/models/fields/bannerclient.php +++ b/administrator/components/com_banners/models/fields/bannerclient.php @@ -9,8 +9,6 @@ defined('JPATH_BASE') or die; -JFormHelper::loadFieldClass('list'); - JLoader::register('BannersHelper', JPATH_ADMINISTRATOR . '/components/com_banners/helpers/banners.php'); /** @@ -18,7 +16,7 @@ * * @since 1.6 */ -class JFormFieldBannerClient extends JFormFieldList +class JFormFieldBannerClient extends JFormAbstractlist { /** * The form field type. diff --git a/administrator/components/com_banners/views/banner/tmpl/edit.php b/administrator/components/com_banners/views/banner/tmpl/edit.php index 6e9a81075794e..f3d9b3415517f 100644 --- a/administrator/components/com_banners/views/banner/tmpl/edit.php +++ b/administrator/components/com_banners/views/banner/tmpl/edit.php @@ -13,7 +13,8 @@ JHtml::_('jquery.framework'); JHtml::_('behavior.formvalidator'); -JHtml::_('formbehavior.chosen', 'select', null, array('disable_search_threshold' => 0 )); +JHtml::_('formbehavior.chosen', '#jform_catid', null, array('disable_search_threshold' => 0 )); +JHtml::_('formbehavior.chosen', 'select'); JFactory::getDocument()->addScriptDeclaration(' Joomla.submitbutton = function(task) diff --git a/administrator/components/com_categories/models/categories.php b/administrator/components/com_categories/models/categories.php index 12436c0824bb2..8a40d397e9c35 100644 --- a/administrator/components/com_categories/models/categories.php +++ b/administrator/components/com_categories/models/categories.php @@ -370,13 +370,19 @@ public function getItems() */ public function countItems(&$items, $extension) { - $parts = explode('.', $extension); + $parts = explode('.', $extension, 2); $component = $parts[0]; $section = null; if (count($parts) > 1) { $section = $parts[1]; + + // If the section ends with .fields, then the category belongs to com_fields + if (substr($section, -strlen('.fields')) === '.fields') + { + $component = 'com_fields'; + } } // Try to find the component helper. diff --git a/administrator/components/com_categories/models/category.php b/administrator/components/com_categories/models/category.php index 9be579027461c..31218a3f869ca 100644 --- a/administrator/components/com_categories/models/category.php +++ b/administrator/components/com_categories/models/category.php @@ -271,9 +271,11 @@ public function getForm($data = array(), $loadData = true) $data['extension'] = $extension; } - $user = JFactory::getUser(); + $categoryId = $jinput->get('id'); + $parts = explode('.', $extension); + $assetKey = $categoryId ? $extension . '.category.' . $categoryId : $parts[0]; - if (!$user->authorise('core.edit.state', $extension . '.category.' . $jinput->get('id'))) + if (!JFactory::getUser()->authorise('core.edit.state', $assetKey)) { // Disable fields for display. $form->setFieldAttribute('ordering', 'disabled', 'true'); @@ -425,28 +427,25 @@ protected function preprocessForm(JForm $form, $data, $group = 'content') $form->setFieldAttribute('rules', 'section', $name); // Association category items - $assoc = $this->getAssoc(); - - if ($assoc) + if ($this->getAssoc()) { - $languages = JLanguageHelper::getLanguages('lang_code'); - $addform = new SimpleXMLElement('
'); - $fields = $addform->addChild('fields'); - $fields->addAttribute('name', 'associations'); - $fieldset = $fields->addChild('fieldset'); - $fieldset->addAttribute('name', 'item_associations'); - $fieldset->addAttribute('description', 'COM_CATEGORIES_ITEM_ASSOCIATIONS_FIELDSET_DESC'); - $add = false; - - foreach ($languages as $tag => $language) + $languages = JLanguageHelper::getContentLanguages(false, true, null, 'ordering', 'asc'); + + if (count($languages) > 1) { - if (empty($data->language) || $tag != $data->language) + $addform = new SimpleXMLElement(''); + $fields = $addform->addChild('fields'); + $fields->addAttribute('name', 'associations'); + $fieldset = $fields->addChild('fieldset'); + $fieldset->addAttribute('name', 'item_associations'); + $fieldset->addAttribute('description', 'COM_CATEGORIES_ITEM_ASSOCIATIONS_FIELDSET_DESC'); + + foreach ($languages as $language) { - $add = true; $field = $fieldset->addChild('field'); - $field->addAttribute('name', $tag); + $field->addAttribute('name', $language->lang_code); $field->addAttribute('type', 'modal_category'); - $field->addAttribute('language', $tag); + $field->addAttribute('language', $language->lang_code); $field->addAttribute('label', $language->title); $field->addAttribute('translate_label', 'false'); $field->addAttribute('extension', $extension); @@ -455,10 +454,7 @@ protected function preprocessForm(JForm $form, $data, $group = 'content') $field->addAttribute('edit', 'true'); $field->addAttribute('clear', 'true'); } - } - if ($add) - { $form->load($addform, false); } } diff --git a/administrator/components/com_categories/models/fields/categoryedit.php b/administrator/components/com_categories/models/fields/categoryedit.php index 5b7fc7ce90dfb..8adbe0508ea3b 100644 --- a/administrator/components/com_categories/models/fields/categoryedit.php +++ b/administrator/components/com_categories/models/fields/categoryedit.php @@ -11,14 +11,12 @@ use Joomla\Utilities\ArrayHelper; -JFormHelper::loadFieldClass('list'); - /** * Form Field class for the Joomla Framework. * * @since 1.6 */ -class JFormFieldCategoryEdit extends JFormFieldList +class JFormFieldCategoryEdit extends JFormAbstractlist { /** * To allow creation of new categories. diff --git a/administrator/components/com_categories/models/fields/categoryparent.php b/administrator/components/com_categories/models/fields/categoryparent.php index bbb4954f7e81a..67e36f0704bba 100644 --- a/administrator/components/com_categories/models/fields/categoryparent.php +++ b/administrator/components/com_categories/models/fields/categoryparent.php @@ -9,14 +9,12 @@ defined('JPATH_BASE') or die; -JFormHelper::loadFieldClass('list'); - /** * Form Field class for the Joomla Framework. * * @since 1.6 */ -class JFormFieldCategoryParent extends JFormFieldList +class JFormFieldCategoryParent extends JFormAbstractlist { /** * The form field type. diff --git a/administrator/components/com_categories/models/fields/modal/category.php b/administrator/components/com_categories/models/fields/modal/category.php index f1ae9a2d9d82f..fa5b311d3a779 100644 --- a/administrator/components/com_categories/models/fields/modal/category.php +++ b/administrator/components/com_categories/models/fields/modal/category.php @@ -58,7 +58,7 @@ protected function getInput() // Add the modal field script to the document head. JHtml::_('jquery.framework'); - JHtml::_('script', 'system/modal-fields.js', false, true); + JHtml::_('script', 'system/modal-fields.js', array('version' => 'auto', 'relative' => true)); // Script to proxy the select modal function to the modal-fields.js file. if ($allowSelect) @@ -265,4 +265,16 @@ function jSelectCategory_" . $this->id . "(id, title, object) { return $html; } + + /** + * Method to get the field label markup. + * + * @return string The field label markup. + * + * @since __DEPLOY_VERSION__ + */ + protected function getLabel() + { + return str_replace($this->id, $this->id . '_id', parent::getLabel()); + } } diff --git a/administrator/components/com_categories/views/categories/tmpl/default.php b/administrator/components/com_categories/views/categories/tmpl/default.php index aa388b7289bac..da9fec00f58da 100644 --- a/administrator/components/com_categories/views/categories/tmpl/default.php +++ b/administrator/components/com_categories/views/categories/tmpl/default.php @@ -25,7 +25,7 @@ $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); $saveOrder = ($listOrder == 'a.lft' && strtolower($listDirn) == 'asc'); -$parts = explode('.', $extension); +$parts = explode('.', $extension, 2); $component = $parts[0]; $section = null; $columns = 7; @@ -40,6 +40,13 @@ { $section = $inflector->toPlural($section); } + + // If the section ends with .fields, then the category belongs to com_fields + if (substr($section, -strlen('.fields')) === '.fields') + { + $component = 'com_fields'; + $section = 'fields&context=' . str_replace('.fields', '', implode('.', $parts)); + } } if ($saveOrder) diff --git a/administrator/components/com_categories/views/categories/view.html.php b/administrator/components/com_categories/views/categories/view.html.php index 925cff302649b..6b2c516fa8de1 100644 --- a/administrator/components/com_categories/views/categories/view.html.php +++ b/administrator/components/com_categories/views/categories/view.html.php @@ -146,7 +146,6 @@ protected function addToolbar() $section = $this->state->get('filter.section'); $canDo = JHelperContent::getActions($component, 'category', $categoryId); $user = JFactory::getUser(); - $extension = JFactory::getApplication()->input->get('extension', '', 'word'); // Get the toolbar object instance $bar = JToolbar::getInstance('toolbar'); @@ -182,7 +181,7 @@ protected function addToolbar() } // Load specific css component - JHtml::_('stylesheet', $component . '/administrator/categories.css', array(), true); + JHtml::_('stylesheet', $component . '/administrator/categories.css', array('version' => 'auto', 'relative' => true)); // Prepare the toolbar. JToolbarHelper::title($title, 'folder categories ' . substr($component, 4) . ($section ? "-$section" : '') . '-categories'); @@ -210,9 +209,9 @@ protected function addToolbar() } // Add a batch button - if ($user->authorise('core.create', $extension) - && $user->authorise('core.edit', $extension) - && $user->authorise('core.edit.state', $extension)) + if ($canDo->get('core.create') + && $canDo->get('core.edit') + && $canDo->get('core.edit.state')) { $title = JText::_('JTOOLBAR_BATCH'); diff --git a/administrator/components/com_categories/views/category/view.html.php b/administrator/components/com_categories/views/category/view.html.php index 0885a62b96793..b96585e0aebc8 100644 --- a/administrator/components/com_categories/views/category/view.html.php +++ b/administrator/components/com_categories/views/category/view.html.php @@ -80,27 +80,18 @@ public function display($tpl = null) JFactory::getApplication()->input->set('hidemainmenu', true); - if ($this->getLayout() == 'modal') + // If we are forcing a language in modal (used for associations). + if ($this->getLayout() === 'modal' && $forcedLanguage = JFactory::getApplication()->input->get('forcedLanguage', '', 'cmd')) { - // If we are forcing a language in modal (used for associations). - if ($forcedLanguage = JFactory::getApplication()->input->get('forcedLanguage', '', 'cmd')) - { - // Set the language field to the forcedLanguage and disable changing it. - $this->form->setValue('language', null, $forcedLanguage); - $this->form->setFieldAttribute('language', 'readonly', 'true'); + // Set the language field to the forcedLanguage and disable changing it. + $this->form->setValue('language', null, $forcedLanguage); + $this->form->setFieldAttribute('language', 'readonly', 'true'); - // Only allow to select categories with All language or with the forced language. - $this->form->setFieldAttribute('parent_id', 'language', '*,' . $forcedLanguage); + // Only allow to select categories with All language or with the forced language. + $this->form->setFieldAttribute('parent_id', 'language', '*,' . $forcedLanguage); - // Only allow to select tags with All language or with the forced language. - $this->form->setFieldAttribute('tags', 'language', '*,' . $forcedLanguage); - } - } - // If not in associations modal, block the language change if in edit modal, language not All, associations enabled and some association. - elseif ($this->item->id && $this->form->getValue('language', null, '*') != '*' && JLanguageAssociations::isEnabled() - && count($this->item->associations) > 0) - { - $this->form->setFieldAttribute('language', 'readonly', 'true'); + // Only allow to select tags with All language or with the forced language. + $this->form->setFieldAttribute('tags', 'language', '*,' . $forcedLanguage); } $this->addToolbar(); @@ -170,7 +161,7 @@ protected function addToolbar() } // Load specific css component - JHtml::_('stylesheet', $component . '/administrator/categories.css', array(), true); + JHtml::_('stylesheet', $component . '/administrator/categories.css', array('version' => 'auto', 'relative' => true)); // Prepare the toolbar. JToolbarHelper::title( diff --git a/administrator/components/com_config/model/application.php b/administrator/components/com_config/model/application.php index 4d39b71995bb2..cf25b55cba5d2 100644 --- a/administrator/components/com_config/model/application.php +++ b/administrator/components/com_config/model/application.php @@ -143,7 +143,7 @@ public function save($data) // If available in HTTPS check also the status code. if (!in_array($response->code, array(200, 503, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 401), true)) { - throw new RuntimeException('HTTPS version of the site returned an invalid HTTP status code.'); + throw new RuntimeException(JText::_('COM_CONFIG_ERROR_SSL_NOT_AVAILABLE_HTTP_CODE')); } } catch (RuntimeException $e) @@ -154,7 +154,7 @@ public function save($data) $app->setUserState('com_config.config.global.data.force_ssl', 0); // Inform the user - $app->enqueueMessage(JText::_('COM_CONFIG_ERROR_SSL_NOT_AVAILABLE'), 'warning'); + $app->enqueueMessage(JText::sprintf('COM_CONFIG_ERROR_SSL_NOT_AVAILABLE', $e->getMessage()), 'warning'); } } diff --git a/administrator/components/com_config/model/form/application.xml b/administrator/components/com_config/model/form/application.xml index 0e60be69d120b..d5387811c40d2 100644 --- a/administrator/components/com_config/model/form/application.xml +++ b/administrator/components/com_config/model/form/application.xml @@ -3,17 +3,7 @@ +