i blame devel module for making me wonder 'WTF is causing admin/just/about/anything to run about 50 more queries than any non-admin page?'.

for core packages, we don't define 'project' in our info files:

justin@ubuntu:~/code/drupal/7/clean$ grep project modules/*/*.info

we do define 'package' as 'Core' in our info files:

justin@ubuntu:~/code/drupal/7/clean$ grep package modules/*/*.info
modules/aggregator/aggregator.info:package = Core

... you get the idea ...

modules/user/user.info:package = Core

unfortunately, we have this in update_get_project_name:

function update_get_project_name($file) {
  $project_name = '';
  if (isset($file->info['project'])) {
    $project_name = $file->info['project'];
  }
  elseif (isset($file->info['package']) && (strpos($file->info['package'], 'Core -') !== FALSE)) {
    $project_name = 'drupal';
  }
  elseif (in_array($file->name, array('bluemarine', 'chameleon', 'garland', 'marvin', 'minnelli', 'pushbutton'))) {
    // Unfortunately, there's no way to tell if a theme is part of core,
    // so we must hard-code a list here.
    $project_name = 'drupal';
  }
  return $project_name;
}

as 'Core - ' doesn't match 'Core', the caching of this expensive data always fails. maybe it never worked, i can't be bothered looking.

so, the 2-characters-to-save-47-queries patch is attached.

this patch may be a bit disconcerting, because it causes many admin pages to feel, well, quick, which is distinctly un-drupal like.

Comments

damien tournoud’s picture

Status: Needs review » Reviewed & tested by the community

Good catch!

We changed the package name of Core modules in #293223: Roll back "Hide required core modules" but failed to update that function.

dries’s picture

Status: Reviewed & tested by the community » Needs work

I committed this to CVS HEAD but ideally there would have been a test for this. Marking this 'code needs work' so we can follow-up with a test.

catch’s picture

This will also need to be backported to D6.

damien tournoud’s picture

I think 6 is good, and it's quite difficult to test this.

catch’s picture

Oh you're right, I completely failed to read #1.

Anonymous’s picture

i'll work up a test in the next couple of days unless someone beats me to it.

dww’s picture

Component: update system » update.module
Priority: Critical » Normal
Issue tags: +Needs tests

"update system" == update.php + DB updates.
"update.module" == update status in core.

Just found this while reading through "update system" issues, looking for misclassified ones. Looks like this was only a D7 bug that's already fixed, so all that remains is a test.

dave reid’s picture

Assigned: » dave reid
Status: Needs work » Needs review
StatusFileSize
new1.03 KB

Trying to rack my brain coming up with tests for this, but I can't figure out a reliable way to do it.

Also discovered that we're using the Core - fields package for field modules that are required, so they never show up in the modules page. Also, this was going to exclude seven.theme. Changed the strpos to look if the package *begins* with "Core".

Anonymous’s picture

looks good to me, i like the stpos change, i think its a bit tighter than what i added.

dave reid’s picture

StatusFileSize
new3.33 KB

Actually here's an even better plan. Let's stop hardcoding the theme inclusions that no one can ever find when we add themes, and just add package = Core to our core themes' .info files.

dave reid’s picture

StatusFileSize
new3.47 KB

Fixes the extra blank line in stark.info.

Anonymous’s picture

do we need a doc update somewhere so contrib themes know about this? or is that going to be just an upgrade entry?

dave reid’s picture

It's only going to apply to our core themes, so we don't need to mention it anywhere.

dww’s picture

Status: Needs review » Reviewed & tested by the community

Love it. Defining Package = Core for core themes is a fine solution to this crappy hack. It will prevent bugs like #490562: Hard-coded list of core themes for update module is now stale in the future. There was another issue where we needed to know if a theme was part of core or not, but I can't find it right now. Drat. Anyway, still not sure about a test, but this is an improvement nonetheless. We can always add more tests later, but let's get this in. Thanks!

webchick’s picture

Status: Reviewed & tested by the community » Fixed

That looks like a nice solution.

Committed to HEAD. Thanks!

dries’s picture

Always good to remove a hack. Committed to CVS HEAD. Thanks.

Status: Fixed » Closed (fixed)

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

jacine’s picture

Assigned: dave reid » jacine
Status: Closed (fixed) » Active
Issue tags: -Needs tests +Needs documentation

This needs docs. Wasted a good 1/2 hour googling and looking through commit logs trying to figure this out what on earth this line was doing in core themes, what it does if anything, and if it's needed in other themes. On it.

jacine’s picture

Assigned: jacine » Unassigned
Status: Active » Fixed
Issue tags: -Needs documentation +Needs tests

Didn't mean to remove the "needs tests" tag. Adding it back.

I've added docs to the theming update page:
http://drupal.org/update/theme/6/7#package-core

Status: Fixed » Closed (fixed)
Issue tags: -Needs tests

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