From 24288ae8c1212228c58f1fb0f16863f54ad2b210 Mon Sep 17 00:00:00 2001 From: Jean-Marie Simonet Date: Tue, 26 Dec 2017 09:49:59 +0100 Subject: [PATCH 1/2] Raise minimum version to 3.8.0 part2 --- .../language/en-GB/en-GB.com_localise.ini | 1 + component/admin/models/fields/releases.php | 23 +++++++++++-------- component/admin/views/languages/view.html.php | 9 ++++++++ component/admin/views/packages/view.html.php | 9 ++++++++ .../admin/views/translations/view.html.php | 9 ++++++++ install.php | 6 ++--- 6 files changed, 45 insertions(+), 12 deletions(-) diff --git a/component/admin/language/en-GB/en-GB.com_localise.ini b/component/admin/language/en-GB/en-GB.com_localise.ini index 2cb407a3..b1a9051f 100644 --- a/component/admin/language/en-GB/en-GB.com_localise.ini +++ b/component/admin/language/en-GB/en-GB.com_localise.ini @@ -15,6 +15,7 @@ COM_LOCALISE_ACCESS_DELETE="Delete" COM_LOCALISE_ACCESS_DELETE_DESC="Delete description" COM_LOCALISE_ACCESS_EDIT="Edit" COM_LOCALISE_ACCESS_EDIT_DESC="Edit description" +COM_LOCALISE_ERROR_INSTALL_JVERSION="The Localise component requires version %s or newer of Joomla!" COM_LOCALISE_FIELDSET_FTP="FTP" COM_LOCALISE_FIELDSET_FTP_DESC="For modifying files, Joomla! will most likely need your FTP account details. Please enter them in the form fields below." COM_LOCALISE_HEADER_MANAGER="Localisation Manager: %s" diff --git a/component/admin/models/fields/releases.php b/component/admin/models/fields/releases.php index c3dd4d34..5885f036 100644 --- a/component/admin/models/fields/releases.php +++ b/component/admin/models/fields/releases.php @@ -83,10 +83,6 @@ protected function getOptions() $gh_project . '/releases' ); - // Allowed tricks. - // Configured to 0 the 2.5.x series are not allowed. Configured to 1 it is allowed. - $allow_25x = 1; - foreach ($releases as $release) { $tag_name = $release->tag_name; @@ -94,14 +90,23 @@ protected function getOptions() $undoted = str_replace('.', '', $tag_name); $excluded = 0; - if ($tag_part[0] == '2' && $allow_25x == '0') + if (version_compare(JVERSION, '3', 'ge')) { - $excluded = 1; + if ($tag_part[0] != '3') + { + $excluded = 1; + } } - elseif ($tag_part[0] != '3' && $tag_part[0] != '2') + elseif (version_compare(JVERSION, '4', 'ge')) { - // Exclude platforms or similar stuff. - $excluded = 1; + if ($tag_part[0] == '4' || $tag_part[0] == '3') + { + $excluded = 0; + } + else + { + $excluded = 1; + } } // Filtering by "is_numeric" disable betas or similar releases. diff --git a/component/admin/views/languages/view.html.php b/component/admin/views/languages/view.html.php index 2a7a2c10..2f662aa2 100644 --- a/component/admin/views/languages/view.html.php +++ b/component/admin/views/languages/view.html.php @@ -27,6 +27,8 @@ class LocaliseViewLanguages extends JViewLegacy protected $form; + protected $minCmsVersion = '3.8'; + /** * Display the view * @@ -42,6 +44,13 @@ public function display($tpl = null) $this->state = $this->get('State'); $this->form = $this->get('Form'); + if (version_compare(JVERSION, $this->minCmsVersion, 'lt')) + { + JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_LOCALISE_ERROR_INSTALL_JVERSION', $this->minCmsVersion), 'warning'); + + return false; + } + LocaliseHelper::addSubmenu('languages'); // Check for errors. diff --git a/component/admin/views/packages/view.html.php b/component/admin/views/packages/view.html.php index 278313e1..0af865a4 100644 --- a/component/admin/views/packages/view.html.php +++ b/component/admin/views/packages/view.html.php @@ -27,6 +27,8 @@ class LocaliseViewPackages extends JViewLegacy protected $state; + protected $minCmsVersion = '3.8'; + /** * Display the view * @@ -44,6 +46,13 @@ public function display($tpl = null) $this->form = $this->get('Form'); $this->file = $app->input->get('file'); + if (version_compare(JVERSION, $this->minCmsVersion, 'lt')) + { + JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_LOCALISE_ERROR_INSTALL_JVERSION', $this->minCmsVersion), 'warning'); + + return false; + } + LocaliseHelper::addSubmenu('packages'); // Check for errors. diff --git a/component/admin/views/translations/view.html.php b/component/admin/views/translations/view.html.php index 250e48ec..ee2ca53d 100644 --- a/component/admin/views/translations/view.html.php +++ b/component/admin/views/translations/view.html.php @@ -27,6 +27,8 @@ class LocaliseViewTranslations extends JViewLegacy protected $state; + protected $minCmsVersion = '3.8'; + /** * Display the view * @@ -45,6 +47,13 @@ public function display($tpl = null) $this->filterForm = $this->get('FilterForm'); $this->activeFilters = $this->get('ActiveFilters'); + if (version_compare(JVERSION, $this->minCmsVersion, 'lt')) + { + JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_LOCALISE_ERROR_INSTALL_JVERSION', $this->minCmsVersion), 'warning'); + + return false; + } + LocaliseHelper::addSubmenu('translations'); // Check for errors. diff --git a/install.php b/install.php index 006714d9..46c0cbf8 100644 --- a/install.php +++ b/install.php @@ -23,21 +23,21 @@ class Com_LocaliseInstallerScript extends InstallerScript * The extension name. This should be set in the installer script. * * @var string - * @since 4.0.31 + * @since 4.0.32 */ protected $extension = 'com_localise'; /** * Minimum PHP version required to install the extension * * @var string - * @since 4.0.31 + * @since 4.0.32 */ protected $minimumPhp = '5.3.10'; /** * Minimum Joomla! version required to install the extension * * @var string - * @since 4.0.31 + * @since 4.0.32 */ protected $minimumJoomla = '3.8.0'; } From cc76fce8cec58bffe7ba6eaddbccd7e8412d6b90 Mon Sep 17 00:00:00 2001 From: Jean-Marie Simonet Date: Tue, 26 Dec 2017 16:57:11 +0100 Subject: [PATCH 2/2] Changing default branch to staging as master is not used anymore --- component/admin/config.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/component/admin/config.xml b/component/admin/config.xml index 9c49bd64..adf548ef 100644 --- a/component/admin/config.xml +++ b/component/admin/config.xml @@ -193,7 +193,7 @@ name="gh_branch" type="text" class="ltr" - default="master" + default="staging" label="COM_LOCALISE_LABEL_GITHUB_BRANCH" description="COM_LOCALISE_LABEL_GITHUB_BRANCH_DESC" />