PHP notice on admin/build/modules

sun - June 28, 2009 - 01:03
Project:Drupal
Version:7.x-dev
Component:base system
Category:bug report
Priority:critical
Assigned:sun
Status:closed
Issue tags:Registry
Description

Fix that, please.

AttachmentSize
dev.patch743 bytes
Testbed results
dev.patchpassedPassed: 11853 passes, 0 fails, 0 exceptions Detailed results

#1

webchick - June 28, 2009 - 01:35
Title:PHP notice on admin/build/modules» PHP notice on admin/build/modules the first time it scans a new module
Status:reviewed & tested by the community» active

We dug a bit deeper in IRC about this, and it turns out this only occurs the first time the page is loaded that a new module is in there it doesn't know about yet.

As best we can tell, this happens because http://api.drupal.org/api/function/system_get_files_database/7 is querying the database, and there's no record of the module there yet.

So while sun's patch will mask the issue, it seems like there might be something deeper...

#2

sun - June 28, 2009 - 01:37
Title:PHP notice on admin/build/modules the first time it scans a new module» PHP notice on admin/build/modules
Status:active» needs work
Issue tags:-Novice+Registry

Not RTBC.

http://api.drupal.org/api/function/system_get_files_database/7 is invoked to apply further properties to each module, but the registry does not know of new modules at this stage. So file_scan_directory() returns modules the registry doesn't know of yet.

Tagging.

#3

sun - June 28, 2009 - 01:45
Status:needs work» needs review

We want to invoke system_get_module_data() here (once) to scan and update the available modules. Needs testing of the installer though.

AttachmentSize
dev.patch 725 bytes
Testbed results
dev.patchfailedFailed: Failed to install HEAD. Detailed results

#4

Damien Tournoud - June 28, 2009 - 01:53

... but we also want to add a static of some sort to system_get_module_data() in order not to traverse the whole file tree twice in search of modules.

#5

Berdir - June 29, 2009 - 14:17

@4

Actually, we do it 3 times already :) (twice with system_get_module_data() and the registry does it directly to save update queries that we don't execute anymore).

I tried to implement the static cache in #147000-30: Regression: Unify and rewrite module_rebuild_cache() and system_theme_data() already, but failed because simpletest had issues with that and I didn't wanted to delay that issue.

#6

System Message - June 29, 2009 - 17:05
Status:needs review» needs work

The last submitted patch failed testing.

#7

Berdir - June 30, 2009 - 08:59

I changed the registry_rebuild() function in #429132: Remove unecessary module_rebuild_cache() call from _registry_rebuild(), now that we optimized system_get_module_data() (And will hopefully further improve it), we can revert that, I think. Not that you can also remove the ini file parsing stuff then.

#8

Berdir - July 5, 2009 - 09:23

Adding a static cache and getting the tests working seems to be hard, so I just reverted my patch in _registry_rebuild() for now.

AttachmentSize
drupal.registry_rebuild3.patch 1.18 KB
Testbed results
drupal.registry_rebuild3.patchpassedPassed: 11853 passes, 0 fails, 0 exceptions Detailed results

#9

Berdir - July 5, 2009 - 09:25

That was the wrong patch...

AttachmentSize
drupal.registry_rebuild4.patch 1.24 KB
Testbed results
drupal.registry_rebuild4.patchpassedPassed: 11853 passes, 0 fails, 0 exceptions Detailed results

#10

Berdir - July 5, 2009 - 09:41
Status:needs work» needs review

And now the correct status...

#11

boombatower - August 3, 2009 - 22:13
Status:needs review» reviewed & tested by the community

Looks clean and fixes issue.

#12

webchick - August 4, 2009 - 05:10
Status:reviewed & tested by the community» fixed

I like the resulting code much better. I think according to Berdir in #7 that the performance hit isn't as great anymore, but I'm sure catch will inform us if that's not the case. ;)

Committed to HEAD!

#13

System Message - August 18, 2009 - 05:20
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.