don't unset project info during processing
pwolanin - August 4, 2008 - 13:20
| Project: | Drupal |
| Version: | 6.x-dev |
| Component: | update.module |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
In update.compare.inc in function update_process_project_info(&$projects), selected information from the .info file is added to the top-level for each project in the $projects array. However, not all information is added (e.g. PHP version dependency, module dependencies, etc). Having this other information available would be very useful for advanced implementations of hook_update_status_alter(). Is there any reason the 'info' portion actually needs to be unset()? It seems that if left it would just be ignored by the existing code in update module.

#1
The simplest solution is just to remove the one line per the attached patch. Additional motivations for this would be switching based on other non-standard variables set in .info, or added in or changed by an implementation of hook_system_info_alter().
Patch applies cleanly against both 7.x and 6.x.
#2
Haven't thought about this too much let, but let me just point out the obvious: that this moves us in the opposite direction from what we're talking about over at #238950: Reduce RAM resource consumption. ;) The goal of that issue is to strip out all the junk we're saving and processing in all these arrays. Of course, here you're talking about adding more info that might actually be useful, so it's different. When I get a chance, I'll ponder this patch a little more and give a helpful reply to your questions. ;) I'm not convinced this is a "bug", either, but I'll leave that alone for now.
#3
Patches cleanly against 7.x and does appear to break anything. I am running CVS of d7, no additional modules installed, so perhaps it's in need of a little extra testing in that regard, but I've seen nothing to indicate a problem at this point.
Eclipse
#4
dww, reading the code it doesn't look like this would be in the critical path with regard to memory usage. The amount of memory that is added by loading .info files seems mostly negligible but maybe I'm wrong?
#5
Yeah, it's probably a drop in the bucket, and I doubt there's a compelling reason to ignore the rest of the contents of the .info file. Feel free to commit this without my having thought any more about it. But, if you'd like me to think about it first, remind myself exactly what's going on, etc, then I'll spend a little time on that at some point in the nearish future and report back here. I've got other things that are probably higher priority to attend to, first. ;)
#6
#7
not critical
#8
I think this is pretty harmless and opens up possibilities. Certainly not in the critical memory path. Committed to CVS HEAD.
#9
how about for 6.x too?
#10
Gabor is away from the keyboard so I committed this to the DRUPAL-6 branch. Thanks Peter.
#11
Automatically closed -- issue fixed for two weeks with no activity.