Skip to content

Commit 02427ae

Browse files
authored
Merge pull request #424 from JoomShaper/dev
Fixed: Default value behavior in settings checkbox fields now functioning as expected
2 parents 1bd067e + 6ec1288 commit 02427ae

File tree

7 files changed

+68
-16
lines changed

7 files changed

+68
-16
lines changed

gulpfile.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ const config = {
1414
srcPath: path.resolve(__dirname),
1515
buildPath: path.resolve(__dirname, './package/'),
1616
qsPath: path.resolve(__dirname, './package/helix_ultimate_quickstart/'),
17-
qsPackageName: 'helixultimate_quickstart_j4_2.1.1.zip',
18-
packageName: 'helixultimate_template_v2.1.1.zip',
19-
pluginPackageName: 'plg_system_helixultimate_v2.1.1.zip',
17+
qsPackageName: 'helixultimate_quickstart_j5_2.1.2.zip',
18+
packageName: 'helixultimate_template_v2.1.2.zip',
19+
pluginPackageName: 'plg_system_helixultimate_v2.1.2.zip',
2020
templateFileExtensions: 'xml, json, php, png, scss, js, ico, svg, jpg, eot, ttf, woff, woff2, otf, css, html',
2121
pluginFileExtensions: function () {
2222
return this.templateFileExtensions + ', ini';

plugins/system/helixultimate/composer.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugins/system/helixultimate/helixultimate.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
<name>System - Helix Ultimate Framework</name>
77
<author>JoomShaper.com</author>
88
<creationDate>Feb 2018</creationDate>
9-
<copyright>Copyright (C) 2010 - 2023 JoomShaper. All rights reserved.</copyright>
9+
<copyright>Copyright (C) 2010 - 2025 JoomShaper. All rights reserved.</copyright>
1010
<license>http://www.gnu.org/licenses/gpl-2.0.html GPLv2 or later</license>
1111
<authorEmail>[email protected]</authorEmail>
1212
<authorUrl>www.joomshaper.com</authorUrl>
13-
<version>2.1.1</version>
13+
<version>2.1.2</version>
1414
<description>Helix Ultimate Framework - Joomla Template Framework by JoomShaper</description>
1515

1616
<updateservers>

plugins/system/helixultimate/overrides/layouts/joomla/form/field/calendar.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@
1111
use HelixUltimate\Framework\Platform\Helper;
1212
use Joomla\CMS\Factory;
1313
use Joomla\CMS\HTML\HTMLHelper;
14+
use Joomla\CMS\Language\Text;
1415
use Joomla\Utilities\ArrayHelper;
1516

1617
extract($displayData);
1718

1819
// Get some system objects.
1920
$document = Factory::getDocument();
21+
$lang = Factory::getApplication()->getLanguage();
2022

2123
$inputvalue = '';
2224

@@ -54,6 +56,36 @@
5456
$localesPath = $localesPath ?? '';
5557
$helperPath = $helperPath ?? '';
5658

59+
// Add language strings
60+
$strings = [
61+
// Days
62+
'SUNDAY', 'MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY',
63+
// Short days
64+
'SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT',
65+
// Months
66+
'JANUARY', 'FEBRUARY', 'MARCH', 'APRIL', 'MAY', 'JUNE', 'JULY', 'AUGUST', 'SEPTEMBER', 'OCTOBER', 'NOVEMBER', 'DECEMBER',
67+
// Short months
68+
'JANUARY_SHORT', 'FEBRUARY_SHORT', 'MARCH_SHORT', 'APRIL_SHORT', 'MAY_SHORT', 'JUNE_SHORT',
69+
'JULY_SHORT', 'AUGUST_SHORT', 'SEPTEMBER_SHORT', 'OCTOBER_SHORT', 'NOVEMBER_SHORT', 'DECEMBER_SHORT',
70+
// Buttons
71+
'JCLOSE', 'JCLEAR', 'JLIB_HTML_BEHAVIOR_TODAY',
72+
// Miscellaneous
73+
'JLIB_HTML_BEHAVIOR_WK',
74+
];
75+
76+
foreach ($strings as $c) {
77+
Text::script($c);
78+
}
79+
80+
// These are new strings. Make sure they exist. Can be generalised at later time: eg in 4.1 version.
81+
if ($lang->hasKey('JLIB_HTML_BEHAVIOR_AM')) {
82+
Text::script('JLIB_HTML_BEHAVIOR_AM');
83+
}
84+
85+
if ($lang->hasKey('JLIB_HTML_BEHAVIOR_PM')) {
86+
Text::script('JLIB_HTML_BEHAVIOR_PM');
87+
}
88+
5789
if (JVERSION < 4)
5890
{
5991
// The static assets for the calendar

plugins/system/helixultimate/src/Platform/Settings.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,25 @@ protected function prepareSettingsFormData()
171171
*/
172172
$formXml = $this->form->getXml();
173173

174+
// In Joomla 5.2.4, a bug was introduced where checkbox fields with a default value of '0'
175+
// behave incorrectly. As a workaround, we set any '0' default values to an empty string.
176+
// @since 2.1.2 & joomla 5.2.4
177+
if (!empty($formXml))
178+
{
179+
foreach ($formXml->fieldset as $fieldset)
180+
{
181+
foreach ($fieldset->field as $field)
182+
{
183+
$fieldType = (string) $field['type'];
184+
185+
if ($fieldType === 'checkbox' && strval($field['default'] ?? '') === '0')
186+
{
187+
$field['default'] = '';
188+
}
189+
}
190+
}
191+
}
192+
174193
if (!empty($formXml))
175194
{
176195
for ($i = 0; $i < $formXml->count(); ++$i)

plugins/system/helixultimate/src/fields/helixfont.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ protected function getInput()
6464
$webfonts = json_decode($json ?? "");
6565
$items = $webfonts->items;
6666
$value = json_decode($this->value ?? "");
67+
$font = null;
6768

6869
if (isset($value->fontFamily))
6970
{

templates/shaper_helixultimate/templateDetails.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
<author>JoomShaper.com</author>
99
<authorEmail>[email protected]</authorEmail>
1010
<authorUrl>http://www.joomshaper.com</authorUrl>
11-
<copyright>Copyright (C) 2010 - 2023 JoomShaper.com. All rights reserved.</copyright>
11+
<copyright>Copyright (C) 2010 - 2025 JoomShaper.com. All rights reserved.</copyright>
1212
<license>http://www.gnu.org/licenses/gpl-2.0.html GPLv2 or later</license>
13-
<version>2.1.1</version>
13+
<version>2.1.2</version>
1414
<description>Helix Ultimate - Starter Template of Helix Ultimate Framework</description>
1515

1616
<updateservers>

0 commit comments

Comments
 (0)