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

[Bug]: Data Object field of type Select is returning 'Display Value' instead of 'Value' #15151

Open
kaurov opened this issue May 9, 2023 · 3 comments
Assignees

Comments

@kaurov
Copy link
Contributor

kaurov commented May 9, 2023

Pimcore version

v.10.5.13

Steps to reproduce

  • Create a Data Object Class named 'Obj' using menu Settings -> Data Objects -> Classses -> New
  • and add 2 fields:
    • 'mySelect' using Add Data Components -> Select -> Select
    • 'myMultiselection' using Add Data Components -> Select -> Multiselection
  • add the same selection options to both fields:
    • Display name; Value
    • European Union Currency ; EUR
    • United States Currency ; USD
  • Create a Data Object of class 'Obj', e.g. ID 12, and select 'USD' in both select boxes fields.
  • try to get values from both fields and see that 'Multiselection' works as expected and 'Select' attribute is working vice versa:

actual behavior

$obj = Obj::gebById(12);
var_dump($obj->getMySelect()); // returns 'United States Currency'
var_dump($obj->getMyMultiselection()); // returns ['USD']

Expected behavior

Select or Multiselection are expected return to similar:

$obj = Obj::gebById(12);
var_dump($obj->getMySelect()); // returns 'USD'
var_dump($obj->getMyMultiselection()); // returns ['USD']
@kaurov kaurov added the Bug label May 9, 2023
@kaurov
Copy link
Contributor Author

kaurov commented May 9, 2023

btw, if to look in definition_Obj then we can see

Pimcore\Model\DataObject\ClassDefinition\Data\Multiselect::__set_state(array(
                 'fieldtype' => 'multiselect',
                 'options' => 
                array (
                  0 => 
                  array (
                    'key' => 'European Union Currency',
                    'value' => 'EUR',
                  ),
                  1 => 
                  array (
                    'key' => 'United States Currency',
                    'value' => 'USD',
                  ),

So I do not know which component is working properly, Select or Multiselection, but I definetely want them to work the same: to return 'key' and to show 'value' in drop-down.

@robertSt7 robertSt7 self-assigned this May 17, 2023
@robertSt7
Copy link
Contributor

Hi @kaurov thanks for reporting this issue. I couldn't reproduce it on the version 10.5.23. Could you please also try it with the latest version and provide more information? Thanks

@github-actions
Copy link

github-actions bot commented Jun 9, 2023

Thanks a lot for reporting the issue. We did not consider the issue as "Priority" or "Backlog", so we're not going to work on that anytime soon. Please create a pull request to fix the issue if this is a bug report. We'll then review it as quickly as possible. If you're interested in contributing a feature, please contact us first here before creating a pull request. We'll then decide whether we'd accept it or not. Thanks for your understanding.

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

2 participants