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
FileSize
2.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

FileSize
2.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.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.