自定义巫师插件 🧙

我创建了一个自定义向导,并进行了多次测试提交,但无法手动删除它们。根据我在另一个帖子中读到的内容,唯一的方法是通过 Rails,但我不知道应该使用哪些命令,ChatGPT 在这方面也常常出错。

1 个赞

你好 :slight_smile:
看起来 Discourse 核心在 6 月 6 日至 7 日周末的最近一次更新引入了一个破坏性的架构变更,导致 discourse-custom-wizard 插件使整个应用启动周期崩溃。

即使尝试访问 /safe-mode 也会因全局 500 错误而失败,因为崩溃发生在初始化中间件注册期间。

以下是从 Logster 中提取的确切致命错误堆栈:

ActionView::Template::Error (undefined method 'admin_stylesheets' for class DiscoursePluginRegistry)
lib/stylesheet/manager/builder.rb:199:in `Stylesheets::Manager::Builder#plugins_digest'

看来在资源/样式表编译阶段(plugins_digest),Discourse 核心正在 DiscoursePluginRegistry 上调用一个 admin_stylesheets 方法,该方法抛出了“未定义方法”异常,这可能是由于自定义向导注册或扩展管理样式的方式与核心不匹配所致。

app.yml 中禁用该插件并执行完整的容器重建后,论坛可以正常启动,这证实崩溃仅限于向导的集成钩子。

能否请您检查并更新注册表/样式表钩子,以兼容当前的核心变更?

谢谢!

1 个赞

我也可以确认同样的错误。不幸的是,我不得不暂时停用该插件。

感谢支持。

嘿,朋友们!感谢通过各种渠道联系我讨论此问题的各位。问题已修复,插件现已恢复正常运行。

9 个赞

自从我更新到最新版本的 Discourse 和插件后,我遇到了一个问题。

我设置了一个字段,让用户选择标签。我将标签限制在一个标签组中,并在“标签组”部分选择了该组。

这以前工作正常——用户只能从该标签组中的标签进行选择。

但现在,情况好像这个标签组不存在,用户可以任意选择任何标签。

我尝试移除标签组,保存,再重新添加,但这没有起作用。我也尝试完全不使用标签组,而在“内容”部分选择标签,但这最多只能选 5 个标签,而我需要的标签数量超过这个限制。

不知道该怎么办——这完全破坏了我表单的工作流程。我之所以使用这个选项,是因为下拉菜单不支持多选。用户最多只能选择 3 个选项,所以一组复选框也不太合适。

有没有其他替代方案的建议?或者我是不是哪里操作错了?

2 个赞

嘿,Jen,我刚刚推送了一些插件的修复。请更新一下,然后告诉我进展如何。

6 个赞

非常感谢 @angus,刚刚更新完毕,一切似乎都正常运行了。

在重建过程中,我注意到屏幕上出现了以下信息,因此想提醒你一下:

[DEPRECATION] Template.error_mode= is deprecated. Use Environment#error_mode= instead. Called from /var/www/discourse/plugins/discourse-custom-wizard/plugin.rb:99:in 'block in Plugin::Instance#activate!'
[DEPRECATION] Template.register_filter is deprecated. Use Environment#register_filter instead. Called from /var/www/discourse/plugins/discourse-custom-wizard/plugin.rb:106:in 'block in Plugin::Instance#activate!'
I, [2026-07-22T09:33:52.756446 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake assets:precompile:build'
[assemble_ember_build] Node.js heap_size_limit is less than 2048MB. Setting --max-old-space-size=2048 and CHEAP_SOURCE_MAPS=1
[assemble_ember_build] No existing build info file found.
Fetching and extracting https://get.discourse.org/discourse-assets/2026.7.0-latest-6accc7b7/production.tar.gz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 23.3M  100 23.3M    0     0  30.9M      0 --:--:-- --:--:-- --:--:--  184M
Prebuilt assets downloaded and extracted successfully.
[assemble_ember_build] Reusing existing core ember build. All done.
[DEPRECATION] Template.error_mode= is deprecated. Use Environment#error_mode= instead. Called from /var/www/discourse/plugins/discourse-custom-wizard/plugin.rb:99:in 'block in Plugin::Instance#activate!'
[DEPRECATION] Template.register_filter is deprecated. Use Environment#register_filter instead. Called from /var/www/discourse/plugins/discourse-custom-wizard/plugin.rb:106:in 'block in Plugin::Instance#activate!'
3 个赞

我可以确认,我再次被迫禁用该插件。

非常感谢创作者们的维护 :folded_hands:

1 个赞

我今天推送了一些针对此插件的不同修复和更新。请更新并查看是否解决了您的问题。

1 个赞

大家好。我从坟墓中爬了出来 两次

所以,在自托管的 Discourse 论坛上,我使用 Wizard 插件来处理一些事务,它在防止新手误操作方面表现相当不错。

论坛已经有一段时间没有更新(从三月开始),所以我请求进行更新,更新也完成了。不幸的是,更新之后,我的 Wizard 突然不再像以前那样正常工作了。让我解释一下。

在使用管理员账户时,我可以点击“新建主题”并访问 Wizard。然而,如果我使用普通账户并在同一类别中点击“新建主题”,它不会将我引导至 Wizard,而是直接在当前页面打开编辑器。

我不知道是什么导致了这个问题,而且由于我是新用户,无法上传视频(哈哈),但如果还有其他问题,尽管问。我会尽力回答。

我想发布一个示例,但由于未达到所需的信任等级而无法操作。现在我可以了,所以在这里发布。

左侧选项卡是拥有管理员/版主权限的账号。右侧选项卡是普通账号。我不确定这为何会有影响,真是见鬼了,兄弟。

插件管理界面中的文档链接指向了一个“未找到页面”错误:

https://pavilion.tech/products/discourse-custom-wizard-plugin/documentation/

根据本主题的原帖,文档似乎位于以下链接:

https://coop.pavilion.tech/docs?ascending=true&category=82&order=title

2 个赞

我很好奇,@angus。有没有地方可以报告我发送的那种错误?

@Lebron,八月是个淡季 :sun: 我怀疑你的问题是由核心 discourse/discourse 中一个关于自定义字段预加载的小众 bug 引起的。我已经为此提交了一个 PR:

4 个赞

LeBron James' Emotional Moment

谢啦,大佬。希望你的拉取请求合并后,我重建 Discourse 就能解决这个问题。:face_holding_back_tears: