As discussed in http://drupal.org/node/199120 -- it'd be nice if the randomly generated issue comments sometimes reassigned issues. Unfortunately, it's a little complicated due to the fact that the issue form only thinks the current $user's uid and 0 (unassigned) are valid choices, so we'll have to do something a little sneaky to get this working, probably via some form_alter() treachery. Submitting this as a separate issue since this part isn't specific to the same GHOP task.

Comments

tmadeira’s picture

Thanks for the help with the code comments and for reviewing the patch lots of times :)

I would like to help in the assign stuff, but the solution I know (and would use) would be functional but a hack, just db_querying. It's not recommended, is it?

Considering your answer is "no", if you could me suggest the function I should learn and use, I think I can handle it. :D
(and I'd feel happier - less mercenary - doing a patch without earning completed ghop tasks... lol)

Thanks,
Tiago

dww’s picture

I haven't thought about this much yet. Really, this stuff is all going to be in flux given http://drupal.org/node/4354.

What I'd probably do is change project_issue_form() to take an optional 2nd argument, an associative array (uid => username) of additional users to include in the "Assigned" option. Then, when you invoke drupal_execute() to create a random comment, if you decided you wanted to reassign the issue to the random user creating the comment, you pass that user in the array for the 2nd argument. That way, the form builder will include it as a valid option, and then drupal_execute() will do the right thing.

I can't immediately think of a cleaner way to do this, and given that it's probably going to change in the near future, I wouldn't worry too much about the inelegance of this design. However, if anyone else has any bright ideas, I'd be glad to hear them. ;)

Thanks,
-Derek

mlncn’s picture

I think somewhat related, as far as technical needs: Allow users to assign other users to an issue.

mr.baileys’s picture

+1 subscribe.

Now that #4354: Select from various users for assigning issues made it into 5.x-2.3 this should be relatively easy to implement. I'd be happy to work in this but prefer to wait until all the changes made in #359237: Fatal errors & validation errors when generating issues. have been implemented.