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

Things to check panels not dismissable #5057

Closed
minusf opened this issue Dec 16, 2020 · 6 comments
Closed

Things to check panels not dismissable #5057

minusf opened this issue Dec 16, 2020 · 6 comments
Labels
question This is more a question for the support than an issue.

Comments

@minusf
Copy link
Contributor

minusf commented Dec 16, 2020

Describe the bug

The "Things to check" panel shows notes like "Long untranslated", etc. The "Dismiss" and "Dismiss for all languages" buttons result in 405 Method not Allowed errors and can't be dismissed.

The issue seems to be that ignore_check is marked @require_POST: https://github.com/WeblateOrg/weblate/blob/master/weblate/trans/views/js.py#L116 while templates/translate.html has no POST forms for the check ignores.

This bug was noticed on an older installation of 4.1.1 but it seems to be the case for master still as well.

To Reproduce the bug

  1. Try to dismiss a "Things to check" panel.
@nijel
Copy link
Member

nijel commented Dec 17, 2020

This is supposed to happen in JavaScript, the link has check-dismiss class and that is handled here:

/* Check ignoring */
this.$editor.on("click", ".check-dismiss", (e) => {
var $el = $(e.currentTarget);
$.ajax({
type: "POST",
url: $el.attr("href"),
data: {
csrfmiddlewaretoken: this.csrfToken,
},
error: function (jqXHR, textStatus, errorThrown) {
addAlert(errorThrown);
},
});
if ($el.hasClass("check-dismiss-all")) {
$el.closest(".check").remove();
} else {
$el.closest(".check").toggleClass("check-dismissed");
}
return false;
});

Do you have JavaScript enabled? Did you run collectstatic on upgrade?

@nijel nijel added the question This is more a question for the support than an issue. label Dec 17, 2020
@github-actions
Copy link

This issue looks more like a support question than an issue. We strive to answer these reasonably fast, but purchasing the support subscription is not only more responsible and faster for your business but also makes Weblate stronger. In case your question is already answered, making a donation is the right way to say thank you!

@minusf
Copy link
Contributor Author

minusf commented Dec 18, 2020

yes, the file is present on the server under data/static/editor/full.js but it doesnt seem to be included in output.XXX.js by django compressor.

@minusf
Copy link
Contributor Author

minusf commented Dec 18, 2020

i turned of COMPRESS_ENABLED and the js files are still not loaded from translate.html template.

  <script defer data-cfasync="false" src="/static/js/slugify.js?v=4.1.1" type="text/javascript"></script>
  <script defer data-cfasync="false" src="/static/loader-bootstrap.js?v=4.1.1" type="text/javascript"></script>

---> this is where they should show up

  <link rel="image_src" type="image/png" href="/static/weblate-128.png"/>

very strange

@minusf
Copy link
Contributor Author

minusf commented Dec 18, 2020

i found the issue, it was an out of date locally modified base.html. I apologize for the noise and thanks for the clues.

@minusf minusf closed this as completed Dec 18, 2020
@github-actions
Copy link

The issue you have reported is resolved now. If you don’t feel it’s right, please follow it’s labels to get a clue and take further steps.

  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question This is more a question for the support than an issue.
Projects
None yet
Development

No branches or pull requests

2 participants