Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaScript error in connection with the Issue templates plugin #185

Open
albrechtd opened this issue Mar 13, 2024 · 2 comments
Open

JavaScript error in connection with the Issue templates plugin #185

albrechtd opened this issue Mar 13, 2024 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@albrechtd
Copy link

albrechtd commented Mar 13, 2024

Hi,

I use the WYSIWYG plugin together with “Redmine Issue Templates” and noticed that updating the Visual content seems to be broken since moving from Redmine 4 to 5 and/or to recent browser releases. I guess this might be related to #134

The Firefox Javascript console prints the following error message when I try to apply a template (same with Chromium, btw.):

Uncaught (in promise) TypeError: ns.setRelatedLink is not a function
    replaceTemplateValue https://vm-dev-redmine-01[…]/redmine/plugin_assets/redmine_issue_templates/javascripts/issue_templates.js:195
    replaceTemplateValue https://vm-dev-redmine-01[…]/redmine/projects/it-support/issues/new:162
    loadTemplate https://vm-dev-redmine-01[…]/redmine/plugin_assets/redmine_issue_templates/javascripts/issue_templates.js:143
    promise callback*loadTemplate https://vm-dev-redmine-01[…]/redmine/plugin_assets/redmine_issue_templates/javascripts/issue_templates.js:112
    <anonymous> https://vm-dev-redmine-01[…]/redmine/projects/it-support/issues/new:441
issue_templates.js:195:8
    replaceTemplateValue https://vm-dev-redmine-01[…]/redmine/plugin_assets/redmine_issue_templates/javascripts/issue_templates.js:195
    replaceTemplateValue https://vm-dev-redmine-01[…]/redmine/projects/it-support/issues/new:162
    loadTemplate https://vm-dev-redmine-01[…]/redmine/plugin_assets/redmine_issue_templates/javascripts/issue_templates.js:143
    (Async: promise callback)
    loadTemplate https://vm-dev-redmine-01[…]/redmine/plugin_assets/redmine_issue_templates/javascripts/issue_templates.js:112
    <anonym> https://vm-dev-redmine-01[…]/redmine/projects/it-support/issues/new:441
    receiveMessage resource://gre/actors/SelectChild.sys.mjs:265
    receiveMessage resource://gre/actors/SelectChild.sys.mjs:467

The error does not occur if I disable (i.e. return immediately from) the function overrideIssueTemplatePluginMethods in app/views/redmine_wysiwyg_editor/_redmine_wysiwyg_editor_partial.html.erb.

My minimal Redmine configuration (on a Debian Bookworm box) to reproduce the issue:

Environment:
  Redmine version                5.0.4.stable
  Ruby version                   3.1.2-p20 (2022-04-12) [x86_64-linux-gnu]
  Rails version                  6.1.7.3
  Environment                    production
  Database adapter               PostgreSQL
Redmine plugins:
  redmine_issue_templates        1.1.2
  redmine_ssl_auth_cn            1.0.4-patched
  redmine_wysiwyg_editor         0.32.0

Thanks an advance for any insight, Albrecht.

@taqueci
Copy link
Owner

taqueci commented Mar 17, 2024

File assets/javascripts/issue_templates.js of master branch has been something completely different from the one tagged with v1.1.2...

agileware-jp/redmine_issue_templates@v1.1.2...master#diff-8ec4222b279b2d70ee26cd1f63da74c82d761757406176a3034a6127d39069d3

@taqueci taqueci added the help wanted Extra attention is needed label Mar 17, 2024
@albrechtd
Copy link
Author

File assets/javascripts/issue_templates.js of master branch has been something completely different from the one tagged with v1.1.2...

I tried with the Redmine Issue Templates master branch, and get almost the same error. The TypeError now references t.setRelatedLink, and the line numbers are different (it looks as if most newlines were removed form the latest version).

Maybe re-introducing my evil hack from #134 might give a usable result, but that doesn't feel like the proper solution (although I could live with customised plugins in my envoronment…).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants