"readOnly" disable more than the specified relation

Hi,

 Event::listen('backend.form.extendFields', function ($widget) {

            if (!$widget->getController() instanceof \RainLab\User\Controllers\Users) {
                return;
            }

            if (!$widget->model instanceof \RainLab\User\Models\User) {
                return;
            }

            if (!$widget->model->exists) {
                return;
            }

            UserProfile::getFromUser($widget->model);

            $widget->addTabFields([
                'dealers' => [
                    'label' => 'larnet.osm::lang.backend.user.form.dealers',
                    'tab' => 'Attached dealers',
                    'type' => 'relation',
                    'readOnly' => true
                ],
            ]);
        });

Adding the ‘readOnly’ to true, it will also put the ‘Groups’ relation disabled (it shouldn’t).

image

Hi @apinard

There was some fixes related to this in v3.3.9

  • Fixes trigger API leaking to other checkbox lists

Are you using this version (or above)?

Hi @daft ,

I’m not sure what version I had.

Now, with 3.3.11, it’s fine :+1:

Thank you.

1 Like