Brave Linux, тема Meta. Не уверен, что это намеренно, но выглядит неправильно
2 лайка
bryce
(Bryce Huhtala)
13.Август.2024 00:53:39
2
Хм, я вижу то же самое на теме по умолчанию.
Есть элемент для имени, но он пуст!
Кажется, это не было задумано, поэтому я пока перенесу это в bug .
5 лайков
Вот быстрый взгляд, чтобы помочь разобраться с проблемой перед сном.
https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/helpers/category-link.js#L159
displayName не существует. Вместо этого есть поле name.
Изменения внесены в этом коммите:
committed 03:33PM - 08 Aug 24 UTC
This commit adds two new getters to the category model:
- `displayName`
- `des… criptionText`
These getters are used instead of `name` and `description_text` where appropriate.
On top of this two transformers have been added to allow plugins to alter these getters:
```javascript
api.registerValueTransformer(
"category-display-name",
({ value, context }) =>
value + "-" + context.category.id + "-transformed"
);
```
```javascript
api.registerValueTransformer(
"category-description-text",
({ value, context }) =>
value + "-" + context.category.id + "-transformed"
);
```
Кажется, что геттеры отсутствуют в контексте сводки пользователя, поскольку данные получаются из /summary.json.
https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/models/user.js#L1068-L1073
Возможно, будет достаточно сопоставить top_categories с помощью Category.create() или создать простой специфический класс.
4 лайка
Moin
13.Август.2024 05:20:25
4
Это напоминает мне Category names missing on group permissions page . В обоих случаях пропал текст, так что, возможно, это одна и та же проблема.
2 лайка
Кажется, это может быть результатом той же проблемы, но в другом месте. Я не буду притворяться, что знаю, как работает Discourse, поэтому на самом деле не могу ничего сказать по этому поводу.
1 лайк
j.jaffeux
(Joffrey Jaffeux)
13.Август.2024 22:05:30
7
Это должно исправить проблему:
main ← jjaffeux:name-description
merged 10:04PM - 13 Aug 24 UTC
`defaultCategoryLinkRenderer` is using a fake category object which doesn’t have… access to the functions and getters of category model.
This had been incorrectly set in https://github.com/discourse/discourse/commit/c197daa04c3114184cbd3ec2f1cfade1b5701793
As we don't get a real category object, we have to call the transformers manually and also pass the fake category object as context, this is not ideal as people might try to access properties in the transformer which are not available on the category object given they will be different based on the context. Hopefully one day this helper and all the chain can be refactored to use a real category model.
This commit also adds tests for these two properties in the category-link helper.
6 лайков
j.jaffeux
(Joffrey Jaffeux)
Закрыл(а) тему
16.Август.2024 22:05:33
8
Эта тема была автоматически закрыта через 3 дня после последнего ответа. Новые ответы больше не принимаются.