Field UI has been added as a dependency in #2848213: Give warning when wrong datetime field widget is set.
The only reason it's needed is to print out a message when a wrong widget type is chosen and link to the form display page.

I get that field_ui is needed to configure scheduler but I prefer to disable UI modules on production environments.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

geertvd created an issue. See original summary.

geertvd’s picture

Status: Active » Needs review
FileSize
1.07 KB

Core uses this approach in hook_help a lot for these situations.

jonathan1055’s picture

Category: Bug report » Feature request

Hi geertvd,
This is interesting, thanks for the info and patch. Yes I added the dependency thinking that it was going to be required anyway to allow admins access to the Scheduler fields. But you are right that it can be turned off once the fields are configured.

Is there a good way to suggest to admins that they might find it useful to enable field_ui for setting up a site but the module does not require it? Maybe a line of text in the Scheduler config page would help, or in the readme?

I'll do some manual testing with your patch and see how it goes.

Jonathan

geertvd’s picture

Is there a good way to suggest to admins that they might find it useful to enable field_ui for setting up a site but the module does not require it? Maybe a line of text in the Scheduler config page would help, or in the readme?

That honestly seems unnecessary to me, UI modules are enabled in the standard install profile.
If a user would start a new installation from minimal profile I think we can assume that this is an advanced user, same can be said about someone uninstalling UI modules.

daften’s picture

To give my 2 cents, requiring a UI module is simply not done. If you want to indicate to a user that he'd need the field_ui module for some functionality, using hook_requirements with install phase should be enough.
I'd also say this is a bug and not a feature request. This patch doesn't add any features, but reverts unwanted behaviour (for most use cases).

jonathan1055’s picture

Category: Feature request » Bug report

requiring a UI module is simply not done

OK I take the point

I'd also say this is a bug and not a feature request. This patch doesn't add any features

Ha ha, yes you are right. I've switched it back, and will get this committed soon.

jonathan1055’s picture

Status: Needs review » Fixed

Core uses this approach in hook_help a lot for these situations.

For reference, aggregator_help() and comment_help() have this, and I'm sure many others do too.
I added a "not available" text into the message string to explain why the link does not work.

Thank you. Committed and Fixed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.