There are so many queries in project_release land that do lots of extra JOINs and trouble just to get to the API compatibility tid. Many things would be vastly easier if we just denormalized a bit and stashed a copy of that tid into {project_release_nodes}. We already do that in the $node object by populating $node->project_release['version_api_tid'], this just makes it more official by doing it in the DB, too. ;) It's not really a big problem for us to keep this accurate, since we already have to do some checks every time a release node is modified anyway (to keep {project_release_supported_versions} sane).

Comments

dww’s picture

Status: Active » Needs review
StatusFileSize
new5.22 KB

Pretty straight forward. This doesn't yet take full advantage of the denormalized data. This just includes the DB update, the code to maintain the new column, and I simplified one function (project_release_exists()) which used to be buggy in some cases where there were multiple revisions of a release.

Tested heavily locally and on d6.d.o. Any objections?

dww’s picture

Status: Needs review » Needs work
Issue tags: +needs drupal.org deployment

Committed to HEAD. Needs deployment.

dww’s picture

Status: Needs work » Fixed
Issue tags: -needs drupal.org deployment
dww’s picture

Category: task » bug
Status: Fixed » Needs review
StatusFileSize
new1.23 KB

Eeek. This is broken here on d.o. New releases are not showing up with {project_release_nodes}.version_api_tid set properly. The problem is that when cvs.module alters the release node form, our happy version_api_tid isn't showing up in $node->project_release[] where we expect it. :( So, we need a bit of defensive programming to ensure we've really got the right value by also looking in $node->taxonomy[].

dww’s picture

Deployed on d.o (just a local patch for now), and repaired the records in {project_release_nodes} that were missing this. Should be better now, but I'm going to watch it for a day or so and make sure, then commit and deploy for real.

dww’s picture

Status: Needs review » Fixed
Issue tags: +needs drupal.org deployment

Working fine on d.o. For example, all of these were created since I deployed the above patch:

flickr_attach 6.x-1.5
season 6.x-1.1-beta2
API 6.x-1.2-beta4

Committed patch #4 to HEAD. We just need to officially deploy this...

dww’s picture

Issue tags: -needs drupal.org deployment

Uploaded the latest project code into SVN and deployed rev 1610 on d.o.

Status: Fixed » Closed (fixed)

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