is there an easy way to disable (readonly) fields in the backend for ALL users and roles (also superadmin).

I already found a module -> https://www.drupal.org/project/disable_field but this module allows superadmins to edit the fields.

Why do i need this?

Because the 5star rating module isn't ported to D8 yet i need a solution to realize a 5star voting in D8 with the vote data (5star rating) from an old drupal installation.

My thought was to work with a field collection, where i want to import the main 5star rating values from the old site into the new installation.

Afterwards i want to build a custom 5star voting.

The users should not be able to change this values in the field collection.

Any ideas?



  • What about removing the fields in Manage form display of the field collection? If you want to be sure, you can set $form['field_name']['#access'] = FALSE; in a form alter hook.
    – 4k4
    Sep 21 '16 at 13:01
  • ahhhhhhhhhh sounds nice... i've totally forgotten that i could handle it this way! thx for the hint! i'll give it a try :)
    – themca
    Sep 21 '16 at 13:05

I don't know why would you need to disable any fields in the first place (that's not turns out from your post), but if you need 5 voting field, you could easily create it:

You may need just a part of them or all of them:

Creating a custom Field

  • It's quite easy: Disabeling the fields therefore, that nobody can change the vote results. I don't want to add a new field, i want to work with existing fields, like text etc. combined with the field collection module. Now it looks like this: dropbox.com/s/7xp3xyx8o5m5vai/…
    – themca
    Sep 21 '16 at 12:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.