Community
Participate
Working Groups
Clicking Show attachment in task editor on a link to an attachment in a comment opens the web ui, if there is no attachment on that task (e.g. if the comment was pasted in from a different task). It should either do nothing or display an error message (or else not even be a hyperlink).
Frank, if it's not too expensive we could validate if attachment exists when parsing the text.
(In reply to comment #1) > Frank, if it's not too expensive we could validate if attachment exists when > parsing the text. Steffen, I see no way to check if the attachment is in the task. BugzillaConectorUI.findHyperlinks has TaskRepository and ITask as parameters but not TaskData. I see no way that we can get the needed TaskData in an cheap way. Thoughts?
Thanks for checking. In this case we won't be able to suppress the hyperlink and should improve error handling instead.
(In reply to comment #3) > Thanks for checking. In this case we won't be able to suppress the hyperlink and > should improve error handling instead. That we open the the attachment in the web page is the fallback. Should we bring up an Dialog first so the the user can cancel the action?
Makes sense. I suggest something along the lines of "Attachment xyz is not attached to the open bug. Open attachment in web browser?"
We can't know what attachement to show in the web browser, because we don't know where the attachment link was pasted from.
Sam, can you post an example? Obviously we have to assume that the link is referring to the current repository unless it's a qualified URL. The same applies tasks or any other relative hyperlink but I'm not sure I understand the concern.
Nevermind, I forgot that the attachment link includes the unique id of the attachment, so opening in the browser works. Here is an example link: (In reply to comment #6) > Created attachment 195156 [details] > framework patch > > Here's the part of the patch for the framework.
Created attachment 195789 [details] patch V1 can someone verify this so we can include this in 3.6?
Created attachment 195790 [details] mylyn/context/zip
Looks good except for one nit, please replace the call to PlatformUI.getWorkbench().getDisplay().getActiveShell() by WorkbenchUtil.getShell().
patch V1 is now in HEAD with the changes requested in comment#11.