This is related to #539182: Custom release node validation not happening -- you'll only see this bug once #539182 is fixed...
project_release_exists() is buggy regarding releases with extra. It only compares the fields that a given release defines, not all possible release fields. So, for example, if you have a release like:
6.x-1.0-alpha1
and you try to submit a new release:
6.x-1.0
project_release_exists() incorrectly tells you that release already exists. The problem is that the 2nd release doesn't have a version_extra field at all, so that's not included in the query used to check for duplicates. You get a query that looks like this:
SELECT COUNT(*) FROM {project_release_nodes} p INNER JOIN {term_node} t ON p.nid = t.nid WHERE p.pid = %d AND p.version_major = %d AND p.version_patch = %d AND t.tid = %d
Instead, for any fields not in the release we're considering, we need to add a "$field IS NULL" to the query, to make sure we really match the same release. Like so:
SELECT COUNT(*) FROM {project_release_nodes} p INNER JOIN {term_node} t ON p.nid = t.nid WHERE p.pid = %d AND p.version_major = %d AND p.version_patch = %d AND p.version_minor IS NULL AND p.version_extra IS NULL AND t.tid = %d
I have a patch for this coming soon...
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 539190-1.project_release_exists.patch | 1.58 KB | dww |
Comments
Comment #1
dwwComment #2
dwwAfter a bit more testing, committed #1 to HEAD.