The drush issue queue commands will catch fire if a) someone deletes an issue comment, and b) the nid-#commentIndex selector is used in drush iq-apply-patch. See http://drupal.org/node/1078108#comment-6347840.

This patch adds the comment subject, which contains "#1", etc., as 'commentIndex' in the json output. This allows Drush to figure out what the correct index value for each comment is, even if someone deletes an earlier comment.

Comments

bdragon’s picture

Status: Needs review » Needs work

Using {project_issue_comments}.comment_number is a better way of getting at that.

dww’s picture

I'm not so sure. That table's going away in D7, so it seems short-sighted to depend on that. The dust is still settling on #1632492: Figure out and port project_issue comment numbering functionality to D7, but it seems like in any case, we're still going to use the comment subject field to hold the "#N" comment identifier. If anything, I'd just say we should call it "commentSubject" or "commentTitle" or something, and just let it be what it is.

greg.1.anderson’s picture

Status: Needs work » Needs review
StatusFileSize
new1.28 KB

We could include both...

Maybe redundant. If you want me to take one out, let me know and I'll re-roll; it can be called anything and pulled from anywhere, for my purposes. Just let me know what's best.

moshe weitzman’s picture

I like dww's idea to use commentSubject since that will keep working for a long time

greg.1.anderson’s picture

#3 has commentSubject; let me know if I should take out commentNumber.

dww’s picture

Status: Needs review » Fixed
Issue tags: +Drupal.org JSON

Seemed silly to make you re-roll this. I just took your patch from #1 and modified it to rename the key from 'commentIndex' to 'subject'.

At first, I committed/pushed it as 'commentSubject' but then I realized this is all inside a 'comments' subarray, and none of the other properties use a 'comment' prefix on the keys (e.g. the status is just called 'status', not 'commentStatus'), so I changed it to 'subject' for consistency. Sorry that means you'll have to re-roll at #1078108: Drush issue queue commands but that seemed like a better patch to have you re-roll, anyway. ;)

So, committed, pushed, and deployed live. Behold:

https://drupal.org/node/1730728/project-issue/json

Cheers,
-Derek

greg.1.anderson’s picture

Cool -- thank you!

Automatically closed -- issue fixed for 2 weeks with no activity.