Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
This was also proposed by mariusm here. I don't have any plans on adding support for this in the near future. You could do this manually using your own custom form_alter as described in this post. If there is a higher demand for this, or someone writes a patch, I will consider adding this feature. Marking as "postponed" for now.
I've been searching for a module that compliments the entity reference pre-populate module for ages.
A great module but to make full use of it I do really need to be able to (in my case) disable all the pre-filled fields selected. As a Drupal newbie, implementing mariusm's solution is a bit beyond my capabilities, at the moment!
Any help, ideas or suggestions would be very much appreciated.
Hello, I spend a lot of time to get the filled fields read-only and not working yet. Pleas can you help whit this issue?
The module "field_readonly" don't work fore me because it is depend on module "Field Permissions" witch only alter the fields regardless where they pop up. And I want different behavior from the same field in different bundles.
The module "field_extrawidgets" is exactly what I need bud don't work as expected, or don't work at all.
Then I (mis)use "Field Conditional State" and "Conditional Fields". This modules come close to what I want, bud it is a work- around and don't work good enough. What I see is I can make a field read- only, bud when a value comes in via "Entity reference autofill" then the state of the field is the state of the field witch comes in (=editable :-( ).
My case is:
There are 3 tables. Table A: are fields from table B and C pulled in whit "Entity reference autofill". Table B and C has the same fields (has to be in order to get working with "Entity reference autofill").
Table B is provided and the user may not change the values. Table C can be filled by the user.
With Entity reference autofill I can list table B and C (same fields) and the user can pick a value from it and Entity reference autofill will make a copy of the fields desired to table A. Works fine.
Bud the fields in table A may NOT changed by the user. That is the problem. I can make the field read-only bud then the field in table C are also read only (this is the case with module "field_readonly").
And if I manage to set the field to read- only (with the ugly work- arrond with Field Conditional State or Conditional Fields modules), then when the value comes in (via Entity reference autofill), the field state becomes editable again. Grrrr....
So I'm stuck...
I think this is only going to work within this module. Because this is the only module witch can control the state of the value comes in; and it has set to be (in my case) 'read-only'.
(You need to enable rules forms for the Page node form)
This will permanently disable the field. I haven't played around much with it, but you should be able disable it conditionally depending on other form values.
Comments
Comment #1
jgullstr commentedHi eosrei,
This was also proposed by mariusm here. I don't have any plans on adding support for this in the near future. You could do this manually using your own custom form_alter as described in this post. If there is a higher demand for this, or someone writes a patch, I will consider adding this feature. Marking as "postponed" for now.
//Josef
Comment #2
mas0h commentedThis will be great feature if you decided to do it, and it will much greater if we can decide which fields will be disabled and which will not.
Comment #3
readermoeba commentedI've been searching for a module that compliments the entity reference pre-populate module for ages.
A great module but to make full use of it I do really need to be able to (in my case) disable all the pre-filled fields selected. As a Drupal newbie, implementing mariusm's solution is a bit beyond my capabilities, at the moment!
Any help, ideas or suggestions would be very much appreciated.
Comment #4
mas0h commentedYou can use Rules forms module to disable node form fields.
Comment #5
mlzrHi,
I will be happy also if it is possible to disable the filled fields.
Comment #6
mlzrMaybe Rules forms is not working: https://www.drupal.org/node/1780272
Comment #7
mlzrHello, I spend a lot of time to get the filled fields read-only and not working yet. Pleas can you help whit this issue?
The module "field_readonly" don't work fore me because it is depend on module "Field Permissions" witch only alter the fields regardless where they pop up. And I want different behavior from the same field in different bundles.
The module "field_extrawidgets" is exactly what I need bud don't work as expected, or don't work at all.
Then I (mis)use "Field Conditional State" and "Conditional Fields". This modules come close to what I want, bud it is a work- around and don't work good enough. What I see is I can make a field read- only, bud when a value comes in via "Entity reference autofill" then the state of the field is the state of the field witch comes in (=editable :-( ).
My case is:
There are 3 tables. Table A: are fields from table B and C pulled in whit "Entity reference autofill". Table B and C has the same fields (has to be in order to get working with "Entity reference autofill").
Table B is provided and the user may not change the values. Table C can be filled by the user.
With Entity reference autofill I can list table B and C (same fields) and the user can pick a value from it and Entity reference autofill will make a copy of the fields desired to table A. Works fine.
Bud the fields in table A may NOT changed by the user. That is the problem. I can make the field read-only bud then the field in table C are also read only (this is the case with module "field_readonly").
And if I manage to set the field to read- only (with the ugly work- arrond with Field Conditional State or Conditional Fields modules), then when the value comes in (via Entity reference autofill), the field state becomes editable again. Grrrr....
So I'm stuck...
I think this is only going to work within this module. Because this is the only module witch can control the state of the value comes in; and it has set to be (in my case) 'read-only'.
Comment #8
jgullstr commentedHi marchellodepello,
Rules forms works fine for disabling fields, here's an example disabling the Body field on the standard profile's "Page" content type:
(You need to enable rules forms for the Page node form)
This will permanently disable the field. I haven't played around much with it, but you should be able disable it conditionally depending on other form values.
//Josef
Comment #9
mlzr//Josef
thank you for this super- reply!