# Perdu la capacité de créer de nouveaux sujets

**URL:** https://meta.discourse.org/t/lost-ability-to-create-new-topics/240661
**Category:** Bug
**Created:** [Octobre 2, 2022, 6:56 UTC](https://meta.discourse.org/t/lost-ability-to-create-new-topics/240661 "2022-10-02T18:56:42Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![cwhatley](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cwhatley/32/273851_2.png) [@cwhatley](https://meta.discourse.org/u/cwhatley)
#### Post date: [Octobre 2, 2022, 6:56 UTC](https://meta.discourse.org/t/lost-ability-to-create-new-topics/240661/1 "2022-10-02T18:56:42Z")

</div>

J’héberge moi-même en utilisant Docker et je mets à jour à partir de la branche `tests-passed`.

Mis à jour vers le commit suivant - [ff42bef1b6](https://github.com/discourse/discourse/commits/ff42bef1b69f9e274745c42aef6318691f228b5d) - qui inclut le PR suivant :

> <https://github.com/discourse/discourse/pull/18383>
>
> This change will auto select the General category in the composer when a new top…ic is created. As part of this change it will remove the option to de-select the category from the composer when the allow uncategorized site setting is disabled (you can still switch categories in the composer, but will not be allowed to leave the category field blank). This means that a user will no-longer receive the "you must select a category" message when submitting a topic because they will always have one selected.
> 
> There is a migration that will only trigger for \*new\* sites for setting the \`allow\_uncategorized\_topics\` site setting to false so that it is now disabled by default. This change initially broke many tests because we don't currently seed the general category and most of the tests were written assuming that uncategorized topics were allowed. I made the necessary changes to get the tests to pass, but I think there will be a refactoring that will need to take place in the future where we seed the General category in the test env so that helpers like \`create\_post\` use the General category instead of falling back to uncategorized.

Après l’installation, les utilisateurs ne peuvent pas ouvrir le compositeur de nouveaux sujets en cliquant sur «&nbsp;+ Nouveau sujet&nbsp;» ou en visitant `/new-topic` directement.

Erreur Javascript dans la console :

`TypeError: undefined is not an object (evaluating 'category.topic_template')`

Je soupçonnais que le code du PR pourrait être à l’origine du problème et je suis allé dans la console Rails et j’ai exécuté ce qui suit pour définir la catégorie générale comme l’une de nos catégories existantes :

`SiteSetting.general_category_id=5`

Cela a résolu le problème. La valeur précédente était -1.

Je pense qu’utiliser une valeur par défaut de `nil` pour `general_cateogory_id` résoudrait ce problème.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [Octobre 2, 2022, 7:47 UTC](https://meta.discourse.org/t/lost-ability-to-create-new-topics/240661/2 "2022-10-02T19:47:12Z")

</div>

Quel est l’âge de votre installation ?

Avez-vous créé une catégorie nommée « général » ou a-t-elle été créée automatiquement ?

---

<div class="post-metadata">

### Author: ![cwhatley](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cwhatley/32/273851_2.png) [@cwhatley](https://meta.discourse.org/u/cwhatley)
#### Post date: [Octobre 2, 2022, 8:04 UTC](https://meta.discourse.org/t/lost-ability-to-create-new-topics/240661/4 "2022-10-02T20:04:07Z")

</div>

Notre installation date d’environ 18 mois, mais nous sommes à jour avec la branche « tests-passed ».

Nous n’avons aucune catégorie « générale » du tout.

---

<div class="post-metadata">

### Author: ![darkpixlz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/darkpixlz/32/549896_2.png) [@darkpixlz](https://meta.discourse.org/u/darkpixlz)
#### Post date: [Octobre 2, 2022, 9:28 UTC](https://meta.discourse.org/t/lost-ability-to-create-new-topics/240661/5 "2022-10-02T21:28:10Z")

</div>

Avec le [commit de catégorie générale](https://github.com/discourse/discourse/pull/18383), les utilisateurs de mon forum voient maintenant quand ils cliquent sur Nouveau :

 ![image](https://global.discourse-cdn.com/meta/original/4X/7/6/5/765419b34b93a4bd453d842cd22a29b4d4ebc58c.png)  
La boîte de catégorie est vide car il n’y a pas de catégorie #General, et #Uncategorized est désactivé.

En essayant de créer un sujet, j’obtiens ceci :

 ![image](https://global.discourse-cdn.com/meta/original/4X/d/8/2/d82d04d02b8368ba0995807658f473e2dbdef3a2.png)

---

<div class="post-metadata">

### Author: ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### Post date: [Octobre 3, 2022, 5:04 UTC](https://meta.discourse.org/t/lost-ability-to-create-new-topics/240661/6 "2022-10-03T05:04:18Z")

</div>

> [@darkpixlz](#):
>
> La boîte de catégorie est vide car il n’y a pas de catégorie #General, et #Uncategorized est désactivé.

Pareil ici. Les utilisateurs devaient choisir une catégorie avant de pouvoir écrire. Maintenant, j’installe le [Composant de catégorie de compositeur par défaut](https://meta.discourse.org/t/default-composer-category-component/148048) en attendant le correctif, donc la catégorie ne sera pas vide à l’ouverture du compositeur. 🙂

---

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [Octobre 3, 2022, 6:58 UTC](https://meta.discourse.org/t/lost-ability-to-create-new-topics/240661/10 "2022-10-03T18:58:00Z")

</div>

D’accord, une correction pour cela a été fusionnée ! 🔧

> <https://github.com/discourse/discourse/commit/6affbabfd3a09c09b8800a8b0f81f2a07498c2fb>
>
> \* FIX: New general category changes preventing topic create
> 
> Follow up to: #18…383
> 
> The logic in the previous commit was checking for null, but we are
> seeding the SiteSetting.general\_category\_id with an id of -1 so we need
> to check for a positive value as well as checking for null.
> 
> See: https://meta.discourse.org/t/240661
> 
> \* Add js test for presence of category… dropdown option

---

<div class="post-metadata">

### Author: ![darkpixlz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/darkpixlz/32/549896_2.png) [@darkpixlz](https://meta.discourse.org/u/darkpixlz)
#### Post date: [Octobre 7, 2022, 12:26 UTC](https://meta.discourse.org/t/lost-ability-to-create-new-topics/240661/11 "2022-10-07T00:26:14Z")

</div>

![image](https://global.discourse-cdn.com/meta/original/4X/9/6/4/9645236e0e3d0ba6147ba3087b6028c0cae62493.png)  
Beaucoup mieux maintenant !

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [Octobre 9, 2022, 8:51 UTC](https://meta.discourse.org/t/lost-ability-to-create-new-topics/240661/12 "2022-10-09T08:51:29Z")

</div>


