The collector script is retrieved on page load, but not executed (see screenshot):

In jira_issue_collector.js, the script is retrieved but never runs, while the $.ajax() call returns a success status every time. I've tried various permutations of $.getScript, $.ajax, etc all to no avail.

It seems like this could be an issue with Drupal.behaviors, as embedding the 'Embed in JavaScript' snippet from Jira (bypassing jira_issue_collector.js entirely) directly does work. This isn't ideal though as it doesn't get attached for ajax requests and such.

Verified on simplytest.me with v7.x-1.1 and the regex patch from https://www.drupal.org/node/2416467.

Comments

robwilmshurst’s picture

Issue summary: View changes
robwilmshurst’s picture

StatusFileSize
new1.08 KB

Workaround patch attached (this is by no means a full solution however).

robwilmshurst’s picture

Just re-read https://www.drupal.org/node/2378253 and it's a similar issue to this. If the locale parameter is present in the script URL, the collector is never displayed.

I think this is actually a Jira issue, rather than an issue with the regex in jira_issue_collector_admin_settings_form_validate, as it doesn't actually change the URL. Possibly related to https://jira.atlassian.com/browse/JRA-38562.

Maybe we just need to tweak the documentation for this module to clarify the issues with the locale parameter?

arpieb’s picture

I've confirmed the URL produced by JIRA v6.3.13#6344-sha1:62d2b41 is correctly formed, and does return a valid JS file. However the jQuery.ajax() call is completing "successfully" yet not executing the script file correctly.

Going with the concept in #2429389-2: Collector script not executed above, I've rolled a bit cleaner patch. The reason for the update is that the embed script accepted by the module's config page could be one of two formats, and will result in a failure if the wrong one is used. This patch simply adds the external JS URL to the page load via drupal_add_js() instead of assuming the embed format is correct as provided by the admin.

robwilmshurst’s picture

This seems like a cleaner approach - and is working for me, thanks.

arpieb’s picture

Status: Active » Needs review

Setting for "needs review."

The last submitted patch, 2: rawembed-2429389-1.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 4: jira_issue_collector-fix-js-injection-2429389-04.patch, failed testing.

jdelon02’s picture

StatusFileSize
new690 bytes

Hello,

This is my first time doing this, so I have no idea if I am doing it correctly. I was having a problem (which seems to match the bug described here), where the script gets loaded, but it does not run. I had no button, so no action could be taken. I have created a patch for this that works on my local environment.

Jeremy

kaidjohnson’s picture

Version: 7.x-1.1 » 7.x-1.2
Assigned: Unassigned » kaidjohnson
Priority: Normal » Critical
Status: Needs work » Needs review
Related issues: +#2582441: Doesn't work
StatusFileSize
new3.41 KB

I think the approach taken in #4 is the way to go. I've re-rolled the patch to drop the now unused javascript file and update the tests accordingly. Also added 'defer' to the drupal_add_js definition to ensure loading the feedback doesn't block page load, which is what I believe was the original intention of using jQuery.ajax().

Bumping this up to critical for obvious reasons.

kasperg’s picture

Version: 7.x-1.2 » 7.x-1.3
Status: Needs review » Fixed

Thanks for chiming in everybody. This issue has been flying under the radar for quite some time.

I just released a new version of the module, 1.3, which should fix this issue. The updated version still uses the current approach with Drupal.behaviors but only supports the JavaScript embed format as this caused the original problem regarding the issue collector not loading.

jkcrosby3’s picture

Recent update actually makes Feedback button appear so it can be used, so that is great! Thanks!
2 Issues:

  1. Choosing "Raise a Bug" template submits issue to JIRA, great. **I can't attach any images anymore though. No permissions is what it says. I haven't changed anything in that aspect, so don't know why that doesn't work anymore.
  2. Also, unfortunately, If I choose the "Got Feedback? " template it works but gives me the following garbage in addition to the issue typed in. Still can't attach issues.
  • *Rating*: :D Awesome!
  • {panel:title=What do you like?|borderColor=#ccc| titleBGColor=#c2ffa2|bgColor=#fff}
  • test3
  • {panel}
  • {panel:title=What needs to be improved?|borderColor=#ccc| titleBGColor=#faacad|bgColor=#fff}
  • test3
  • {panel}
  • *Reporter*: Bugs Bunny
  • *E-mail*: [mailto:bugsbunny@cartoonland.com]
kasperg’s picture

jkcrosby3:

  1. I just tried release 1.3 on simplytest.me. Image attachment worked fine. If you experience any issues here I think they are related to your JIRA installation. "The documentation mentions settings that must be enabled and permissions given":https://confluence.atlassian.com/jira/attaching-a-screenshot-185729550.html
  2. I also get this formatting in the issues I create. I guess this is how JIRA has decided to format user input in the issue collector (rating, what do you like, what needs to be improved etc.). If you think this can be improved then I think you need to contact Atlassian. I do not think there is anything we can do when embedding.

In general these are separate from the original concern. If you want to discuss them further please create new issues.

Status: Fixed » Closed (fixed)

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