Problem/Motivation

From #1199946-16: Disabled modules are broken beyond repair so the "disable" functionality needs to be removed

Modules can't implement more than one of hook_field_storage_info(), hook_field_info() or hook_entity_info() (and their _alter counterparts).

Proposed resolution

The attached patch adds a field_requirements() function that warns in the system status report when a module implements two or more different kinds of hooks, as forbidden above.

Remaining tasks

The patch needs to be reviewed by a core developer.

User interface changes

The status page will warn if a module breaks this particular rule.

API changes

None.

Files: 
CommentFileSizeAuthor
#6 1288276-6-field_requirements.patch2.64 KBbrianV
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] Unable to apply patch 1288276-6-field_requirements.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#4 field_requirements-1288276-4.patch2.9 KBpillarsdotnet
PASSED: [[SimpleTest]]: [MySQL] 32,869 pass(es).
[ View ]
field_requirements.patch2.76 KBpillarsdotnet
FAILED: [[SimpleTest]]: [MySQL] 32,883 pass(es), 0 fail(s), and 6 exception(es).
[ View ]

Comments

pillarsdotnet’s picture

Issue tags:+Needs tests

Obviously, this needs tests.

pillarsdotnet’s picture

Status:Active» Needs review

CNR for bot.

Status:Needs review» Needs work

The last submitted patch, field_requirements.patch, failed testing.

pillarsdotnet’s picture

Status:Needs work» Needs review
StatusFileSize
new2.9 KB
PASSED: [[SimpleTest]]: [MySQL] 32,869 pass(es).
[ View ]

Okay, apparently a value is required. Need to file a documentation patch against hook_requirements(); the current docs say "During install phase, this should only be used for version numbers, do not set it if not applicable. " They should mention that during other phases, this property is required.

Mile23’s picture

Nice. :-)

brianV’s picture

StatusFileSize
new2.64 KB
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] Unable to apply patch 1288276-6-field_requirements.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

This sounds like a great idea. Rerolled for HEAD.

brianV’s picture

Issue summary:View changes

Fixed link to parent issue.

Status:Needs review» Needs work

The last submitted patch, 6: 1288276-6-field_requirements.patch, failed testing.

Berdir’s picture

Issue summary:View changes

None of those hooks exist anymore, and we actually have modules which do this (comment has a field type and entity type) in core.