Change of project in comment does not update assigned options
aclight - May 4, 2008 - 01:48
| Project: | Project issue tracking |
| Version: | 5.x-2.x-dev |
| Component: | Issues |
| Category: | bug report |
| Priority: | normal |
| Assigned: | aclight |
| Status: | closed |
Description
Now that we have a hook_project_issue_assignees(), we need to re-implement that hook every time the project is changed (eg. from a comment) so that the list of users in the assigned select box is also updated.
Attached patch does this.
| Attachment | Size |
|---|---|
| pi_assigned_update_0.patch | 7.11 KB |

#1
!isset($assigned_choices)will always pass. second, if we're trying to make sure that the submitted user is a valid assignee for the new project, won't the FAPI choice-checker take care of that?// Build the HTML output for the rid select.-- this code comment looks wrong for building the assigned selectfunction project_issue_update_project($pid, $cid = NULL, $rid = NULL, $assigned_uid = NULL, $issue_nid = NULL)-- the order of the args there seems goofy to me. i think it would be less confusing if we reorganized those instead of just tacking the new args on the end. perhaps pid, nid, cid, rid, uid? just some order that makes intuitive sense...#2
attached patch:
project_issue_update_project()to something i think is more sensible.project_issue_update_project()node_load()for loading the issue inproject_issue_update_project()to make sure it checks that the passed nid belongs to a project issue. also changed thenode_load()for the project loading for consistency.tested, and this all seems to be working beautifully now. gonna leave it CNR for a bit in case anybody else wants to jab at it...
#3
Why are we doing this:
- $node = node_load($pid);+ $node = node_load(array('nid' => $pid, 'type' => 'project_project'));
in light of this: #311369: Project loading could use the static cache ?
Is the idea that the static cache doesn't help us in this AJAX menu handler, since we're only looking up a single project per "page load" anyway?
Otherwise, patch looks good visually. I haven't tested it yet.
#4
no, the idea is that we have no real validation on the pid, we're just trusting the url that the AJAX request sends.
and also what you said about single page loads. :)
#5
This patch fixes the doxygen of project_issue_update_project() to start with a one line summary and also fixes the @param assigned_uid part. In addition, removes a blank line from the start of the function.
#6
with updated comment
#7
unified diff this time
#8
Reviewed and tested. Please commit to DRUPAL-5--2 and HEAD. Thanks!
#9
committed to 5.x-2.x, HEAD, deployed on d.o
#10
Automatically closed -- issue fixed for two weeks with no activity.