Merge #15779 - Fix #15136 - Hex converter giving invalid results

Fix: #15136
Pull-request: #15779
Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
William Desportes 2020-05-14 13:52:53 +02:00
commit 291eb002af
No known key found for this signature in database
GPG Key ID: 90A0EF1B8251A889
2 changed files with 14 additions and 0 deletions

View File

@ -504,6 +504,8 @@ $javascriptMessages = [
'strYes' => __('Yes'),
'strCopyEncryptionKey' => __('Do you want to copy encryption key?'),
'strEncryptionKey' => __('Encryption key'),
/* l10n: Tip for HEX conversion of Integers */
'HexConversionInfo' => __('The HEX function will treat the integer as a string while calculating the hexadecimal value'),
/* For Tip to be shown on Time field */
'strMysqlAllowedValuesTipTime' => __(

View File

@ -279,6 +279,18 @@ function verificationsAfterFieldChange (urlField, multiEdit, theType) {
});
}
if (target.value === 'HEX' && theType.substring(0,3) === 'int') {
// Add note when HEX function is selected on a int
var newHexInfo = '<br><p id="note' + target.id + '">' + Messages.HexConversionInfo + '</p>';
if (!$('#note' + target.id).length) {
$thisInput.after(newHexInfo);
}
} else {
$('#note' + target.id)
.prev('br')
.remove();
$('#note' + target.id).remove();
}
// Unchecks the corresponding "NULL" control
$('input[name=\'fields_null[multi_edit][' + multiEdit + '][' + urlField + ']\']').prop('checked', false);