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]: The select field is displayed as [object Object] #16351

Open
kingjia90 opened this issue Dec 7, 2023 Discussed in #16348 · 1 comment · May be fixed by pimcore/admin-ui-classic-bundle#402
Open

[Bug]: The select field is displayed as [object Object] #16351

kingjia90 opened this issue Dec 7, 2023 Discussed in #16348 · 1 comment · May be fixed by pimcore/admin-ui-classic-bundle#402

Comments

@kingjia90
Copy link
Contributor

Discussed in #16348

Originally posted by ziggurad December 7, 2023
Hi!

I need a little help ;)

I used OptionsProvider in the select field. Unfortunately, the grid view shows [object Object]. Does anyone have an idea what the cause could be?

Pimcore v11.1.1

<?php

declare(strict_types=1);

namespace App\OptionsProvider;

use Pimcore\Model\DataObject\ClassDefinition\Data;
use Pimcore\Model\DataObject\ClassDefinition\DynamicOptionsProvider\SelectOptionsProviderInterface;

class InvoiceStatusOptionsProvider implements SelectOptionsProviderInterface
{

    public function getOptions(array $context, Data $fieldDefinition): array
    {
        return [
            [
                'key' => 'Nowa',
                'value' => 'new',
            ],
            [
                'key' => 'Poprawna',
                'value' => 'correct',
            ],
        ];
    }

    public function hasStaticOptions(array $context, Data $fieldDefinition): bool
    {
        return true;
    }

    public function getDefaultValue(array $context, Data $fieldDefinition): ?string
    {
        return 'new';
    }
}

pimcore

pimcore2

@kingjia90 kingjia90 added the Bug label Dec 7, 2023
Copy link

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
1 participant