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

Investigate adding rule to detect FormField types from dataFieldByValue #3

Open
silbinarywolf opened this issue Jul 2, 2017 · 3 comments

Comments

@silbinarywolf
Copy link
Contributor

silbinarywolf commented Jul 2, 2017

Currently get errors like:

Call to an undefined method FormField::getConfig().

When using $fields->dataFieldByValue('Name'); wherein 'Name' is a GridField.
Would like to see if I can add some complex checks so that the correct type can be determined.

EDIT: I might look into executing scaffoldFormFields directly on a singleton() so that the exact form fields and structure are retained.

@silbinarywolf silbinarywolf self-assigned this Jul 2, 2017
silbinarywolf added a commit that referenced this issue Apr 21, 2018
silbinarywolf added a commit that referenced this issue Apr 25, 2018
@silbinarywolf silbinarywolf modified the milestone: 0.5.0 Apr 25, 2018
silbinarywolf added a commit that referenced this issue May 16, 2018
silbinarywolf added a commit that referenced this issue May 16, 2018
silbinarywolf added a commit that referenced this issue May 20, 2018
silbinarywolf added a commit that referenced this issue May 20, 2018
@nglasl
Copy link
Contributor

nglasl commented Jan 7, 2019

@silbinarywolf can you please confirm if this is still an issue? I noticed heaps of commit references above, but they seem unrelated?

@nglasl
Copy link
Contributor

nglasl commented Jan 7, 2019

Confirmed on #1 and #18.

@sminnee
Copy link
Contributor

sminnee commented Feb 26, 2021

Incidentally this discussion relates: silverstripe/silverstripe-framework#9659

In the end it seems like doing this was preferred to adding more code to core for this:

$field = $fieldList->fieldByName('MyTable');
assert($field instanceof GridField);
$field->getConfig()->bla...

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

No branches or pull requests

3 participants