I've searched, but although we discussed this in countless of issues already, it seems that no one created a patch for it yet.

In short: required = TRUE must only be set for modules that are absolutely required for core to work.

Field type modules do not belong into that list.

Next to real world Drupal sites, this patch will also speed up the new testing profile.

Comments

Status: Needs review » Needs work

The last submitted patch, drupal.required.0.patch, failed testing.

sun’s picture

Status: Needs work » Needs review
StatusFileSize
new2.68 KB

There must be a bug in the required/dependencies handling...? Text module breaks badly, but even when added as dependency for Node... very odd.

sun’s picture

StatusFileSize
new2.1 KB

ok, let Text module be required then. But the other field type modules are definitely not.

sun’s picture

Title: Non-required core modules are marked required » Optional field type modules should not define required in their .info files

Better title?

sun’s picture

Title: Optional field type modules should not define required in their .info files » Optional field type modules should not be 'required' in .info file
moshe weitzman’s picture

Something about upgrade path gets more complicated if these modules are non-required. Maybe thats no longer an issue in D7.

sun’s picture

If I understood recent changes correctly, then it's not an issue if a newly required dependency does exist, it simply gets enabled. Aside from that, CCK will have to fiddle with these modules anyway, as some have been renamed.

sun’s picture

#3: drupal.required.3.patch queued for re-testing.

yched’s picture

If options.module is not required anymore, then taxonomy and list modules need to have a dependency on it.
Arguably, 'options' could be worth keeping as required - it's nature is to provide generic widgets, will likely be used by many field types..

Other than that, making number and list 'not required' sounds reasonable. We should make sure they're enabled in the default profile, though.

sun’s picture

StatusFileSize
new2.71 KB

Thanks! Added Options as dependency for Taxonomy and List.

yched’s picture

Status: Needs review » Reviewed & tested by the community

Thks sun. Looks good.

webchick’s picture

Status: Reviewed & tested by the community » Needs review

Hm. This is an API change (modules that assume certain field modules exist need to change their dependencies[] lines). But it might be possible to justify this if there were some real numbers behind "Next to real world Drupal sites, this patch will also speed up the new testing profile."

sun’s picture

Status: Needs review » Reviewed & tested by the community

Just tested this while writing a very simple/small test for Form API that leverages the testing profile. Results on my local box:

BEFORE: The test run finished in 25 sec.

AFTER: The test run finished in 22 sec.

I suck at maths, but my simple calc says that this therefore shaves off 12%.

yched’s picture

Note : if this gets in, http://drupal.org/handbook/modules/field will need to be updated accordingly.

Drupal core includes the following field type modules: Number (required), Text (required), List (required), Taxonomy (optional), Image (optional), and File (optional)

sun’s picture

#10: drupal.required.10.patch queued for re-testing.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, drupal.required.10.patch, failed testing.

sun’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new2.72 KB

Re-rolled against HEAD.

webchick’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +API change

I spoke to Dries about this. Even though this represents an API change, it's a pretty low-impact one (a couple of extra dependencies[] lines in the .info file) and if we're going to make it, it needs to be before RC.

In addition to providing more flexibility for installation profiles/distributions to make decisions on what's /actually/ required, it can help us speed up test runs, and I think this makes Drupal's required module list more intuitive to newcomers as well.

Committed to HEAD. Thanks!

yched’s picture

rfay’s picture

I don't think this API change needs to be announced. Contrary opinions?

webchick’s picture

Perhaps not. You can see that a few core modules did have to change as a result, and I could see this affecting Date module and maybe some other ones that build upon option lists/checkboxes. Up to you, though.

Status: Fixed » Closed (fixed)
Issue tags: -API change

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