无法访问我们的一个类别

https://meta.discourse.org/t/discourse-2-6-0-beta5-release-notes/168756

更新到 beta5 后,我们其中一个分类无法再访问,对此感到疑惑。如有需要,请告诉我需要哪些日志。我是管理员,但当我尝试点击并按名称选择这个特定分类时,我看到:

据我所知,所有其他分类都能正常打开。

该分类的名称中是否包含特殊字符?

1 个赞

“社区日历”

想再问问,是否有人建议如何将“社区日历”这一类别与其他类别合并。目前仍无法通过选择该类别来访问它,但单独的文章仍然可以查看,也没有看到任何错误日志弹出。

哎呀!该页面不存在或为私有。 :thinking:

1 个赞

这是该类别的 Rails 输出。

摘要

#<Category:0x000055cde93db078
id: 36,
name: “社区日历”,
color: “ED207B”,
topic_id: 419,
topic_count: 15,
created_at: 2019 年 3 月 24 日 星期日 18:10:42 UTC +00:00,
updated_at: 2020 年 12 月 20 日 星期日 08:27:45 UTC +00:00,
user_id: 2,
topics_year: 5,
topics_month: 0,
topics_week: 0,
slug: “Unofficial-events”,
description: “此<a href="https://discuss.noisebridge.info/calendar\”>非官方社区日历适用于您希望分享的任何活动!Noisebridge 之外的生活。",
text_color: “FFFFFF”,
read_restricted: false,
auto_close_hours: nil,
post_count: 26,
latest_post_id: 8837,
latest_topic_id: 2105,
position: 20,
parent_category_id: nil,
posts_year: 9,
posts_month: 0,
posts_week: 0,
email_in: nil,
email_in_allow_strangers: false,
topics_day: 0,
posts_day: 0,
allow_badges: true,
name_lower: “community calendar”,
auto_close_based_on_last_post: false,
topic_template: “此日历适用于您希望分享的任何活动!\n活动不一定需要涉及 Noisebridge!\n”,
contains_messages: nil,
sort_order: “”,
sort_ascending: nil,
uploaded_logo_id: 504,
uploaded_background_id: nil,
topic_featured_link_allowed: true,
all_topics_wiki: false,
show_subcategory_list: false,
num_featured_topics: 3,
default_view: “calendar”,
subcategory_list_style: “rows_with_featured_topics”,
default_top_period: “all”,
mailinglist_mirror: false,
minimum_required_tags: 0,
navigate_to_first_post_after_read: false,
search_priority: 0,
allow_global_tags: false,
reviewable_by_group_id: nil,
required_tag_group_id: nil,
min_tags_from_required_group: 1,
read_only_banner: nil,
default_list_filter: “all”>

1 个赞

这可能与以下内容有关:
https://meta.discourse.org/t/discourse-event/149964/135

1 个赞

谢谢,看来我需要从 Rails 控制台应用 default_view 修复。目前还不清楚如何修复 ID 为 36 的“Unofficial-events”类别,使其使用最新视图。

我尝试按照这些说明操作,但不确定是否需要将 myCategory 重写为 Unofficial-events,同时保留 ID 36。

Rails 控制台新手。我的操作总结

$ ./launcher enter app

rails c

[1] pry(main)> Unofficial-events = Category.find_by(id: 36)
NameError: uninitialized constant Unofficial
from (pry):1:in __pry__' [2] pry(main)> Unofficial-events.default_view = "latest" NameError: uninitialized constant Unofficial from (pry):2:in pry
[3] pry(main)> Unofficial-events.save!
NameError: uninitialized constant Unofficial
from (pry):3:in __pry__' [4] pry(main)> myCategory = Category.find_by(id 36) NoMethodError: undefined method id’ for main:Object
from (pry):4:in `pry
[5] pry(main)>

2 个赞

:thinking: 我不太确定 Unofficial-event 中的连字符是否合适,不过将 myCategory 用作变量名应该是没问题的。

来自 (pry):3:in __pry__' [4] pry(main)> myCategory = Category.find_by(id 36) NoMethodError: 未定义方法 id’ for main:Object
来自 (pry):4:in `pry
[5] pry(main)>

感谢 @Benjamin_D。如果有人需要执行此操作,请注意此帖子的最后一步有一个小拼写错误,请使用 myCategory.save! 保存。

2 个赞

你在 id 和 36 之间漏掉了冒号:

1 个赞

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.