无法为非空原因字段授予自定义徽章

您好,我检查了最新的稳定版 1.9.3+2test-passed,发现如果“原因”字段不为空,则无法授予用户自定义徽章。

复现步骤:

  1. 使用 font-awesome 图标创建一个简单的徽章,不使用 SQL
  2. 进入 admin/users,找到目标用户
  3. 点击“编辑徽章”
  4. 选择刚创建的徽章
  5. 输入原因(重要!)https://www.cuba-platform.com/discuss/t/redirecting-http-to-https/3977/4
  6. 点击“授予”
  7. 您将收到一个错误,详情见下图。

如果“原因”字段为空,则不会出现错误。

我的论坛位于子文件夹中,这可能是导致失败的原因:

2 个赞

This looks incredibly likely to be the reason, unable to repro on non-subfolder.

4 个赞

Hi,
I was able to find the issue. I found it out after seeing that we were returning 404 in the first screenshot instead of 400. We were not taking care of relative_root_url while parsing reason of badge.

I have created PR for the same here:

7 个赞

This has been merged. Thank you @saurabhp!

4 个赞

This topic was automatically closed after 3 days. New replies are no longer allowed.