Motivation
I want to disable a widget based on the value of another field in the entity being edited. I wan to do it with a HOOK_form_editablefields_form_alter() but I have small context about what I'm altering since the field_name and the entity are protected properties of the form object.
Proposed resolution
Add getEntity and getFieldName getters to the Form class.
Remaining tasks
Code
User interface changes
API changes
Data model changes
Issue fork editablefields-3421169
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
rodrigoaguileraComment #4
gilmordHi @rodrigoaguilera, good idea
A couple of suggestions:
- implement getter for protected $form_mode
- move getters above buildForm method, so we have all getters in one place
Thanks!
Comment #5
rodrigoaguileraSure
Comment #7
gilmordThanks, looks good, works good, merged