#576·unopim

[Bug]: Product editing page - Selects are broken

Author: JaxxCCreated Jul 29, 2026Updated Aug 3, 2026
LabelsBug

Pre-submission checklist

  • I have searched the existing issues and this bug has not already been reported.

UnoPim Version(s) affected

2.1.6

Issue Description

2.1.6 version change fields for attribute options required for selects as expects dynamic-attribute-fields template

php
$selectedValue[] = [
    'id'               => $option->id,
    'code'             => $option->code,
    'swatch_value'     => $option->swatch_value,
    'swatch_value_url' => $option->swatch_value_url,
    'attribute'        => [
        'swatch_type' => $field->swatch_type,
    ],
    'label'            => ! empty($translatedOptionLabel)
        ? $translatedOptionLabel
        : "[{$option->code}]",
];

there must be 'attribute' field. But AjaxOptionsController does not have this field in response

php
$formattedOptions[] = [
                'id'    => $option->id,
                'code'  => $option->code,
                'label' => ! empty($translatedOptionLabel) ? $translatedOptionLabel : "[{$option->code}]",
                ...$option->makeHidden(['translations', 'label'])->toArray(),
            ];

And as result, options not shown in select after fetch, got error instead - "Cannot read properties of undefined (reading 'swatch_type')". And Product editing page broken

Preconditions (environment)

  • PHP version: 8.3
  • Database (MySQL/PostgreSQL + version): MySQL
  • Elasticsearch version (or "not used"): latest
  • Web server: Octane
  • OS: Ubuntu
  • Browser: Chrome

Steps to reproduce

  1. Go to 'Catalog->Products->edit'
  2. Click on 'any select'
  3. See error in console and no options loaded

Expected Result

Select works as expected

Actual Result

Select oiptions not displayed, and error appears

Screenshots

No response

Additional Context

No response