Download & Extend

Tables not populated on projects created before project add-ons are enabled

Project:Project
Version:6.x-1.x-dev
Component:Releases
Category:bug report
Priority:normal
Assigned:dww
Status:closed (fixed)

Issue Summary

If you enable "Project releases" after creating a project and then add a release to the project, the releases download table won't show up.
Reproducibility:
- Enable "Project"
- Create a project
- Enable "Project releases"
- Add a release to the formerly created project.
The "download table" doesn't show up in the project view page.

It' releated to the fact that the module creates the record in project_release_projects only when a project is first created.

Comments

#1

Title:Releases download table» Tables not populated on projects created before project add-ons are enabled

Yup, I can reproduce this. Definitely a bug. Related to #104190: Submit issues cannot find projects but in this case for the {project_release_projects} table. :( We should make sure {project*_projects} does this right once and for all. Any project-module add-on (project_release, project_issue, etc) that has its own "projects" table should populate records for all existing projects when the add-on is first enabled.

#2

Assigned to:Anonymous» dww
Status:active» needs review

This seems better than trying to just do it all at once when project_release.module is enabled, and it'll solve the problem on sites that are already experiencing the bug.

In terms of this same bug hitting other parts of project*:
- project_issue is already "fixed" (although I think I'd be in favor of porting this change to project_issue, too).

- project_usage doesn't have its own "projects" table.

- cvs.module does its own slightly weird thing to solve this -- in cvs_nodeapi() for both 'insert' and 'update', it always deletes any existing row in {cvs_projects} and inserts a new one.

AttachmentSizeStatusTest resultOperations
347199_project_release_projects.2.patch1.02 KBIgnored: Check issue status.NoneNone

#3

Ported the same idea to project_issue, and added code comments. Pretty sure these are RTBC.

AttachmentSizeStatusTest resultOperations
347199_project_issue_projects.3.patch1.68 KBIgnored: Check issue status.NoneNone
347199_project_release_projects.3.patch1.17 KBIgnored: Check issue status.NoneNone

#4

That's a good start guys, but still, if you execute my steps, the table won't show up.
To make it appear you must go to "Administer releases" an click submit, while, if you enable the module at the "right" time, the table will appear as soon as you add the release!

#5

Status:needs review» needs work

Hrm, ok. I hadn't actually tested your steps, I was just looking at the ability to save the version string format string, for example. I'll give this another look for exactly what you describe.

#6

Here is a patch which addresses #4.

With the patches by Derek in #3, this should fix this bug for good.

I'm also attaching a minor patch for project_issue which removes the call to project_issue_add_missing_projects from hook_install since it's called in hook_enable anyway.

AttachmentSizeStatusTest resultOperations
project_issue-347199.patch1.3 KBIgnored: Check issue status.NoneNone
project_release-347199.patch1.27 KBIgnored: Check issue status.NoneNone

#7

Status:needs work» needs review

#8

Attempted summary:
- We need #6 (check during hook_enable()) so that the bug is fixed if you just enable a submodule but don't edit any existing projects for that submodule.
- We need #3 (insert a record if we fail to update one during edit) for sites that already have some projects in the funky state, and try to edit, without enable/disable.

@alienbrain: is that accurate? I didn't check, but do all these patches apply to both D5 and HEAD?

Thanks!
-Derek

#9

Version:5.x-1.2» 6.x-1.x-dev
Status:needs review» fixed

Argh, I can't believe this issue is still open... I was just hit by this on a Project* site where I had to turn on project_release for the first time.

I ported both #3 and #6 to D6 of project_issue and project_release, then committed everything to both HEAD (6.x-1.*) and DRUPAL-5--2 for project_issue and DRUPAL-5 for project_release.

#10

Status:fixed» closed (fixed)

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

nobody click here