רק כמה קטגוריות מופיעות ב site.json כאשר max_nesting_categories = 3

סיכום מבוסס בינה מלאכותית

jimkleiber is experiencing an issue where WP-Discourse is not pulling the full list of categories after setting max_category_nesting = 3. The /site.json endpoint only displays 5 categories when logged in as admin, but 26 in incognito, while /categories.json shows 33. jimkleiber notes that even using /categories.json, 49 total categories are expected but only 33 are present. As a workaround, they manually updated a plugin file to read from /categories.json and added the missing category manually. They suggest that reading from /categories.json may be a more reliable solution in the future, but the core issue of missing categories remains even when using that endpoint. The problem might be related to max_category_nesting=3, but this is not confirmed.

מאז שהחלפתי ל-max_nesting_categories = 3, שמתי לב שה-WP-Discourse שלי כבר לא מושך את הרשימה המלאה של קטגוריות. אם אני מבקר ב-/site.json, אני יכול לראות רק 5 קטגוריות. אם אני מבקר ב-/categories.json, אני חושב שאני רואה את כל הקטגוריות ברמה הראשונה והשנייה, עם מזהי הקטגוריות ברמה השלישית המפורטים תחת הקטגוריות ברמה השנייה. עם זאת, WP-Discourse מאכלס את רשימת הקטגוריות שלו באמצעות /site.json.

כמו כן, כאשר אני מקליד /site.json בחלון שבו אני מחובר כמנהל מערכת, הוא מציג רק 5 קטגוריות. אם אני עושה זאת בחלון גלישה בסתר, הוא מציג 26. בחלון מחובר כמנהל מערכת עם /categories.json, הוא מציג 33.

יש לך מושג מה יכול לקרות?

עדכנתי ידנית את הקובץ plugin-utilities.php כדי לקרוא מ-categories.json ולא מ-site.json, ואז עדכנתי כדי לוודא שהוא קורא את אובייקט ה-JSON הנכון (ב-site.json, קטגוריות הן ברמה ראשונה, וב-categories.json הן ברמה שנייה).

עם זאת, יש לי 49 קטגוריות ורק 33 מוצגות גם ב-categories.json.

אז לעת עתה, פשוט הוספתי ידנית את הקטגוריה היחידה שרציתי והייתה חסרה.

עדיין לא בטוח אם זו בעיה של max_category_nesting=3, אבל גם אם לא, אני חושב שלקראת העתיד, בדיקה תקופתית של קטגוריות מ-categories.json על ידי wp-discourse עשויה להיות חלקה יותר.