Problemen met het activeren van de zijbalk na de recente update van Doc Categories

As of these changes to Doc Categories

the sidebar no longer activates. I am running version 3.6.0.beta1-dev (17d735b3ad) with the Horizon theme, and there is nothing in the error logs. I also ensured there is a set index topic, rebuilt the launcher, and ran bundle exec rake doc_categories:build_sidebar.

2 likes

Bedankt voor het rapport, we zullen er binnenkort naar kijken.

2 likes

Oh nee, dat is niet best.

Heb je de uitvoer van bundle exec rake doc_categories:build_sidebar nog? (Stuur me gerust een privébericht als het privé is)

Tot nu toe heb ik hier op Meta + Horizon geen problemen gezien, maar er kan een staat zijn die ik mis. Als je een data-explorer hebt, kun je dan controleren of er indexen, secties en links zijn aangemaakt?

query
SELECT
  i.category_id,
  i.index_topic_id,
  sec.section_names,
  lnk.section_links
FROM doc_categories_indexes i
LEFT JOIN LATERAL (
  SELECT
    string_agg(COALESCE(s.title, ''), ', ' ORDER BY s.position) AS section_names
  FROM doc_categories_sidebar_sections s
  WHERE s.index_id = i.id
) AS sec ON TRUE
LEFT JOIN LATERAL (
  SELECT
    string_agg(l.href, ', ' ORDER BY s.position, l.position) AS section_links
  FROM doc_categories_sidebar_sections s
  LEFT JOIN doc_categories_sidebar_links l
    ON l.sidebar_section_id = s.id
  WHERE s.index_id = i.id
) AS lnk ON TRUE
ORDER BY i.category_id, i.index_topic_id;

Eén factor is de site-cache. Aangezien categorieën 30 minuten worden gecached, kan de update hebben plaatsgevonden en is de reguliere sidebar gecached vóór het uitvoeren van de rake-taak.

1. migratie naar tabel
2. cache miss -> ziet normale sidebar in plaats van docs sidebar
3. rake-taak om sidebar te bouwen
4. zou herbouwde sidebar moeten zien

Technisch gezien zou (4) moeten gebeuren en de cache moeten resetten. Als dat het probleem is, zou je ze nu moeten zien.

3 likes

Thanks for the quick reply! It seems not to be the cache as the issue is persisting. I’m sending you a PM with the Data Explorer query results and the bundle exec rake doc_categories:build_sidebar output. It aborts with a fatal

2 likes

Just a report back for future onlookers that the rake task that was run in OP was using

bundle exec rake doc_categories:build_sidebar

and met with the error

ActiveRecord::NoDatabaseError: We could not find your database: discourse. Available database configurations can be found in config/database.yml. (ActiveRecord::NoDatabaseError)

Depending on self-hosted setups, it is likely that the task needs to be run with the discourse user to get to the database.

sudo -E -u discourse bundle exec rake doc_categories:build_sidebar

@MachineScholar has confirmed that the sections and links have thus been successfully created. :ok_hand:t2:

4 likes

Dit onderwerp werd automatisch gesloten na 3 dagen. Nieuwe reacties zijn niet meer toegestaan.