Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datasource string values with leading zeros are converted to Integer when parsing the dataValue field in PHP wrappers #5384

Closed
mparvanov opened this issue Nov 4, 2019 · 0 comments
Assignees

Comments

@mparvanov
Copy link
Contributor

mparvanov commented Nov 4, 2019

Bug report

Datasource string values with leading zeros are converted to Integer when parsing the dataValue field. The issue is related to the following code in the wrappers, which returns the value without the leading zeros:

Reproduction of the problem

Use the following datasource setup with multicolumncombobox for example:


<?php
require_once '../lib/DataSourceResult.php';
require_once '../lib/Kendo/Autoload.php';
require_once '../include/header.php';
$multicolumncomboBox = new \Kendo\UI\MultiColumnComboBox('combobox');
$multicolumncomboBox->dataTextField('text')
         ->dataValueField('value')
         ->dataSource(array(
            array('text' => 'Item 1', 'value' => '01'),
            array('text' => 'Item 2', 'value' => '002'),
            array('text' => 'Item 3', 'value' => '099')
         ))
         ->addColumn(
            array('field' => 'text', 'title' => 'Text'),
            array('field' => 'value', 'title' => 'Value')
           )
         ->filter('startswith')
         ->attr('style', 'width: 100%;');
?>
<?php
echo $multicolumncomboBox->render();
?>
</div>

Open the dropdown.

Current behavior

The third value is 99

Expected/desired behavior

The third value is 099

note: the issue is caused by the internal usage of json_encode($value, JSON_NUMERIC_CHECK )

Environment

  • Kendo UI version: 2019.3.1023

Feedback Item: https://feedback.telerik.com/php-ui/1440151-multiselect-setvalue-seems-to-convert-strings-with-leading-zeros-to-integer-when-parsing-the-key-field

@kendo-bot kendo-bot added the FP: Unplanned Sync status with associated Feedback Item label Nov 4, 2019
@gyankov gyankov self-assigned this Jan 7, 2020
@kendo-bot kendo-bot removed the FP: Unplanned Sync status with associated Feedback Item label Jan 7, 2020
@nenchef nenchef added the FP: Planned Sync status with associated Feedback Item label Jan 13, 2020
@kendo-bot kendo-bot added FP: In Development Sync status with associated Feedback Item and removed FP: Planned Sync status with associated Feedback Item labels Jan 13, 2020
@kendo-bot kendo-bot added FP: Completed Sync status with associated Feedback Item and removed FP: In Development Sync status with associated Feedback Item labels Jan 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants