Skip to content

Commit 9221077

Browse files
authored
[6.0] Fix default values for position and currency. (#46433)
* Change default symbol value to an empty string * Change default position parameter from 2 to 0 aligning the default position to the default of the params xml * Modify plg_fields_number entry in base.sql Updated the 'plg_fields_number' entry to include a 'symbol' property. * Update plg_fields_number entry in base.sql added missing symbol param
1 parent 58b6461 commit 9221077

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

installation/sql/mysql/base.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`,
299299
(0, 'plg_fields_list', 'plugin', 'list', 'fields', 0, 1, 1, 0, 1, '', '', '', 7, 0),
300300
(0, 'plg_fields_media', 'plugin', 'media', 'fields', 0, 1, 1, 0, 1, '', '', '', 8, 0),
301301
(0, 'plg_fields_note', 'plugin', 'note', 'fields', 0, 1, 1, 0, 1, '', '{"class":"alert alert-info","heading":"h4"}', '', 9, 0),
302-
(0, 'plg_fields_number', 'plugin', 'number', 'fields', 0, 1, 1, 0, 1, '', '{"min":"1.0","max":"100.0","step":"0.1","currency":"0","position":"0","decimals":"2"}', '', 10, 0),
302+
(0, 'plg_fields_number', 'plugin', 'number', 'fields', 0, 1, 1, 0, 1, '', '{"min":"1.0","max":"100.0","step":"0.1","currency":"0","symbol":"","position":"0","decimals":"2"}', '', 10, 0),
303303
(0, 'plg_fields_radio', 'plugin', 'radio', 'fields', 0, 1, 1, 0, 1, '', '', '', 11, 0),
304304
(0, 'plg_fields_sql', 'plugin', 'sql', 'fields', 0, 1, 1, 0, 1, '', '', '', 12, 0),
305305
(0, 'plg_fields_subform', 'plugin', 'subform', 'fields', 0, 1, 1, 0, 1, '', '', '', 13, 0),

installation/sql/postgresql/base.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder",
305305
(0, 'plg_fields_list', 'plugin', 'list', 'fields', 0, 1, 1, 0, 1, '', '', '', 7, 0),
306306
(0, 'plg_fields_media', 'plugin', 'media', 'fields', 0, 1, 1, 0, 1, '', '', '', 8, 0),
307307
(0, 'plg_fields_note', 'plugin', 'note', 'fields', 0, 1, 1, 0, 1, '', '{"class":"alert alert-info","heading":"h4"}', '', 9, 0),
308-
(0, 'plg_fields_number', 'plugin', 'number', 'fields', 0, 1, 1, 0, 1, '', '{"min":"1.0","max":"100.0","step":"0.1","currency":"0","position":"0","decimals":"2"}', '', 10, 0),
308+
(0, 'plg_fields_number', 'plugin', 'number', 'fields', 0, 1, 1, 0, 1, '', '{"min":"1.0","max":"100.0","step":"0.1","currency":"0","symbol":"","position":"0","decimals":"2"}', '', 10, 0),
309309
(0, 'plg_fields_radio', 'plugin', 'radio', 'fields', 0, 1, 1, 0, 1, '', '', '', 11, 0),
310310
(0, 'plg_fields_sql', 'plugin', 'sql', 'fields', 0, 1, 1, 0, 1, '', '', '', 12, 0),
311311
(0, 'plg_fields_subform', 'plugin', 'subform', 'fields', 0, 1, 1, 0, 1, '', '', '', 13, 0),

plugins/fields/number/tmpl/number.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
$min = $field->fieldparams->get('min', null);
1717
$currency = $field->fieldparams->get('currency', 0);
1818
$decimals = $field->fieldparams->get('decimals', 2);
19-
$symbol = $field->fieldparams->get('symbol', 2);
20-
$position = $field->fieldparams->get('position', 2);
19+
$symbol = $field->fieldparams->get('symbol', '');
20+
$position = $field->fieldparams->get('position', 0);
2121

2222
if (is_numeric($value)) {
2323
$value = (float)$value;

0 commit comments

Comments
 (0)