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

pwolanin - August 4, 2008 - 13:29
Status:active» patch (code needs review)

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.

AttachmentSize
save-info-290918-1.patch646 bytes

#2

dww - August 4, 2008 - 18:45

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

EclipseGc - August 4, 2008 - 20:29

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

Dries - August 5, 2008 - 05:38

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

dww - August 5, 2008 - 08:10

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

royerd - August 5, 2008 - 12:55
Title:don't unset project info during processing» don't unset project info during
Priority:normal» critical

#7

pwolanin - August 5, 2008 - 15:29
Title:don't unset project info during » don't unset project info during processing
Priority:critical» normal

not critical

#8

Dries - August 11, 2008 - 07:07
Status:patch (code needs review)» fixed

I think this is pretty harmless and opens up possibilities. Certainly not in the critical memory path. Committed to CVS HEAD.

#9

pwolanin - August 12, 2008 - 02:38
Version:7.x-dev» 6.x-dev
Status:fixed» patch (reviewed & tested by the community)

how about for 6.x too?

#10

Dries - August 12, 2008 - 05:12
Status:patch (reviewed & tested by the community)» fixed

Gabor is away from the keyboard so I committed this to the DRUPAL-6 branch. Thanks Peter.

#11

Anonymous (not verified) - August 26, 2008 - 05:13
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.