area17 / twill

Twill is an open source CMS toolkit for Laravel that helps developers rapidly create a custom admin console that is intuitive, powerful and flexible. Chat with us on Discord at https://discord.gg/cnWk7EFv8R.
https://twillcms.com
Apache License 2.0
3.72k stars 568 forks source link

fix: Table builder Browser column overrides parent module field #2506

Closed zeezo887 closed 3 months ago

zeezo887 commented 6 months ago

Description

This PR overrides the base TableColumn class getKey() to prepend the browser's name to the browser key.

public function getKey(): string
    {
        if ($this->key === null) {
            throw new ColumnMissingPropertyException();
        }

        if (null === $this->browser) {
            throw new ColumnMissingPropertyException('Browser column missing browser value: ' . $this->field);
        }

        return "$this->browser.$this->key";
    }

Related Issues

Fixes #2284

Tofandel commented 6 months ago

Isn't it possible for two browsers to also have the same name?

zeezo887 commented 6 months ago

Browsers can use the same module, but cannot have the same name within the same form.