Modules without files[] in .info cause errors

Dave Reid - October 11, 2008 - 17:27
Project:Drupal
Version:7.x-dev
Component:base system
Category:bug report
Priority:normal
Assigned:Dave Reid
Status:closed
Description

If you have a contrib module for 7.x that doesn't provide the files[] array in it's .info file, and you enable that module, it causes errors in _registry_rebuild:
* notice: Undefined index: files in /Applications/MAMP/htdocs/core/includes/registry.inc on line 47.
* warning: Invalid argument supplied for foreach() in /Applications/MAMP/htdocs/core/includes/registry.inc on line 47.
* notice: Undefined index: files in /Applications/MAMP/htdocs/core/includes/registry.inc on line 47.
* warning: Invalid argument supplied for foreach() in /Applications/MAMP/htdocs/core/includes/registry.inc on line 47.

Patch adds a default $info['files'] = array() to module_rebuild_cache. Patch will also mark the module as incompatible in admin/build/modules so the rouge module cannot be enabled, since it would never be useful as no module functions would be found in the registry.

AttachmentSize
module-info-files-D7.patch1.42 KB
Testbed results
module-info-files-D7.patchfailedFailed: Failed to apply patch. a href=http://testing.drupal.org/pifr/file/1/module-info-files-D7.patchDetailed results/a

#1

moshe weitzman - October 12, 2008 - 02:18
Status:needs review» reviewed & tested by the community

Nice. This removes some rather disconcerting error messages.

#2

webchick - October 12, 2008 - 02:52
Status:reviewed & tested by the community» fixed

Yay! Thanks. :)

#3

Dave Reid - October 12, 2008 - 10:13
Status:fixed» needs review

Follow-up patch that does the same check when everyone will be upgrading to D7 from D6!

AttachmentSize
module-info-files-followup-D7.patch 708 bytes
Testbed results
module-info-files-followup-D7.patchfailedFailed: Failed to install HEAD. Detailed results

#4

Dave Reid - October 12, 2008 - 15:37

Had a logic error.

AttachmentSize
module-info-files-followup-D7.patch 687 bytes
Testbed results
module-info-files-followup-D7.patchfailedFailed: Failed to install HEAD. Detailed results

#5

webchick - November 9, 2008 - 07:16
Status:needs review» needs work

Macintosh-105:core webchick$ patch -p0 < module-info-files-followup-D7_0.patch
patching file update.php
patch unexpectedly ends in middle of line
Hunk #1 succeeded at 512 with fuzz 1 (offset 1 line).

Could you give this a quick re-roll? I just stumbled across it again and it seems like a good idea. :) And now that it's actually possible to upgrade D6 => D7 we can even test it too. ;)

#6

swentel - November 14, 2008 - 11:40
Status:needs work» needs review

Reroll

AttachmentSize
module-info-files-followup-D7.patch 935 bytes
Testbed results
module-info-files-followup-D7.patchfailedFailed: Invalid PHP syntax. a href=http://testing.drupal.org/pifr/file/1/module-info-files-followup-D7_1.patchDetailed results/a

#7

Anonymous (not verified) - November 14, 2008 - 16:15
Status:needs review» needs work

The last submitted patch failed testing.

#8

Dave Reid - November 14, 2008 - 16:19
Status:needs work» needs review

Re-roll with matching parathesis.

AttachmentSize
320009-module-info-files-followup-D7.patch 687 bytes
Testbed results
320009-module-info-files-followup-D7.patchpassedPassed: 7252 passes, 0 fails, 0 exceptions a href=http://testing.drupal.org/pifr/file/1/320009-module-info-files-followup-D7.patchDetailed results/a

#9

System Message - November 16, 2008 - 22:20
Status:needs review» needs work

The last submitted patch failed testing.

#10

Dave Reid - November 17, 2008 - 03:56
Status:needs work» needs review

Failed due to #74645: modify file_scan_directory to include a regex for the nomask.. Setting back to code needs review.

#11

catch - November 19, 2008 - 15:02
Status:needs review» reviewed & tested by the community

Trivial patch, RTBC.

#12

webchick - November 20, 2008 - 07:08
Status:reviewed & tested by the community» fixed

Committed; thanks! :)

#13

System Message - December 4, 2008 - 07:13
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.