8000 Dropdown with model->hasOne() doesn't work · Issue #742 · atk4/atk4 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Jul 25, 2022. It is now read-only.

Dropdown with model->hasOne() doesn't work #742

Open
Eizens opened this issue Jul 24, 2018 · 0 comments
Open

Dropdown with model->hasOne() doesn't work #742

Eizens opened this issue Jul 24, 2018 · 0 comments

Comments

@Eizens
Copy link
Contributor
Eizens commented Jul 24, 2018

So I have a model that has a hasOne() reference some other model.
If I create a form or use crud (edit/add window) with this model, the following error appears:

AbstractObject.php:459]Illegal offset type in isset or empty

I'm using branch 4.4

Investigating it the problem is with the Dropdown field or more precisely with getValueList() function in lib/Form/Field/ValueList.php:113

The title cannot be determined correctly here:
$title = $this->model->getElement($this->model->title_field);

Quickly reverting this line back to the one in 4.3, it works fine:
$title = $this->model->getTitleField();

Also issue 741 could be related to this one.

I could create a pull request, but the thing is that I'm not sure why this change was made in first place.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0