in testing hunmonk's very cool patch in http://drupal.org/node/86806 to reset the component and version when you switch projects, i noticed a bug when submitting new issues. turns out, this bug is totally unrelated to his patch, and exists in 4.7.x-*, too. basically, if you use a URL like:

node/add/project_issue/foo

but change the value of project from "foo" to "bar", if either project has releases and versions, the validation step always fails, no matter what you do. this needs to be fixed regardless of what happens with #86806. i think it'll be pretty easy to solve once i start digging into it.

Comments

dww’s picture

Title: version validation is hard-coded to get project from URL, not form values » validation is hard-coded to get project from URL, not form values
Status: Active » Needs review
StatusFileSize
new2.98 KB

actually, the main problem is in the form builder, not in the validation, though both need fixing. it's not just the version, but also the component and any other potentially project-specific fields that get nailed by this bug. this patch seems to solve it. needs more review/testing.

dww’s picture

here's a version for HEAD, e.g. if you want to try it out with http://drupal.org/node/57120

hunmonk’s picture

Version: 4.7.x-2.x-dev » 5.x-2.x-dev
Status: Needs review » Reviewed & tested by the community

tested with http://drupal.org/node/57120 also installed. created new issues and followups, changing projects on the fly w/ both. everything looks fine.

i'm not all that excited about the goofy if/else logic, but that's not really what we're fixing here. :)

+1 in that it fixes the issue -- we can clean up the overall code structure later...

dww’s picture

Version: 5.x-2.x-dev » 4.7.x-2.x-dev
Status: Reviewed & tested by the community » Fixed

committed a slightly modified version (takes out the '#default_value' => 0 from my previous patch) to HEAD, DRUPAL-4-7--2 and DRUPAL-4-7.

Anonymous’s picture

Status: Fixed » Closed (fixed)