If you happen to add a component where trim($component) === '', there is no way to remove it.

This is because:

(1) component names are saved trimed() in the database (in project_issue_project_edit_form_submit()); and because
(2) the component name is used as a key in project_issue_project_edit_form_submit(), which result in a input tag with name="component[][name]" being generated.

Comments

dww’s picture

Issue tags: +6.x-1.0 wishlist

Bummer. ;) We shouldn't let you save them in the first place, then. ;) But yeah, we need to fix this. I know core has an empty component, and that sucks.

It'd be nice to fix this before 6.x-1.0, but I don't think it's a blocker, so adding it to the wishlist...

mikey_p’s picture

Status: Active » Needs review
StatusFileSize
new2.69 KB

This should do the trick, and it includes a batch update function to go through project_issue_projects and update rows with empty components.

I named the update function assuming the #175555: Add custom Priority Levels would land first.

mikey_p’s picture

Status: Needs review » Needs work

Whoops, left a dsm in there.

mikey_p’s picture

Status: Needs work » Needs review
StatusFileSize
new2.63 KB

I still can't get the form_set_error to correctly highlight the element that it's set on. I've talked to chx about this and it doesn't seem to be anything obvious.

mikey_p’s picture

StatusFileSize
new2.64 KB

Blargh, typo.

mikey_p’s picture

Moving some of the work I had on github to topic branches on d.o: http://drupalcode.org/project/project_issue.git/shortlog/refs/heads/7254...