Knowledge Base Plugin

Think this goes here? unsure… but pretty sure this is the bug breaking mobile view?

INFO

StandardError (Attempting to access a non preloaded custom field, this is disallowed to prevent N+1 queries.)
/var/www/discourse/app/models/concerns/has_custom_fields.rb:164:in `

Backtrace

/var/www/discourse/app/models/concerns/has_custom_fields.rb:164:in []' /var/www/discourse/plugins/discourse-knowledge-base/plugin.rb:67:inknowledge_base_index’
/var/www/discourse/plugins/discourse-knowledge-base/plugin.rb:76:in block (2 levels) in activate!' (eval):33:in_fast_attributes’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:456:in attributes' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:480:in_serializable_hash’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:359:in serializable_hash' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer/associations.rb:124:inblock in serialize’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer/associations.rb:123:in map' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer/associations.rb:123:inserialize’
/var/www/discourse/lib/freedom_patches/ams_include_without_root.rb:57:in include!' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:368:inblock in include_associations!’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:367:in each_key' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:367:ininclude_associations!’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:362:in serializable_hash' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer/associations.rb:124:inblock in serialize’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer/associations.rb:123:in map' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer/associations.rb:123:inserialize’
/var/www/discourse/lib/freedom_patches/ams_include_without_root.rb:57:in include!' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:368:inblock in include_associations!’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:367:in each_key' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:367:ininclude_associations!’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:362:in serializable_hash' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:343:inas_json’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/json/encoding.rb:22:in encode' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/json/encoding.rb:22:inencode’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/core_ext/object/json.rb:41:in to_json' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:331:into_json’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/multi_json-1.13.1/lib/multi_json/adapters/oj.rb:40:in dump' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/multi_json-1.13.1/lib/multi_json/adapters/oj.rb:40:indump’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/multi_json-1.13.1/lib/multi_json/adapter.rb:25:in dump' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/multi_json-1.13.1/lib/multi_json.rb:139:indump’
/var/www/discourse/app/controllers/categories_controller.rb:47:in block (2 levels) in index' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_controller/metal/mime_responds.rb:203:inrespond_to’
/var/www/discourse/app/controllers/categories_controller.rb:45:in index' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_controller/metal/basic_implicit_render.rb:6:insend_action’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/abstract_controller/base.rb:194:in process_action' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_controller/metal/rendering.rb:30:inprocess_action’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/abstract_controller/callbacks.rb:42:in block in process_action' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:132:inrun_callbacks’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/abstract_controller/callbacks.rb:41:in process_action' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_controller/metal/rescue.rb:22:inprocess_action’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_controller/metal/instrumentation.rb:34:in block in process_action' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/notifications.rb:168:inblock in instrument’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/notifications/instrumenter.rb:23:in instrument' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/notifications.rb:168:ininstrument’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_controller/metal/instrumentation.rb:32:in process_action' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_controller/metal/params_wrapper.rb:256:inprocess_action’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.3/lib/active_record/railties/controller_runtime.rb:24:in process_action' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/abstract_controller/base.rb:134:inprocess’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionview-5.2.3/lib/action_view/rendering.rb:32:in process' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-mini-profiler-1.0.2/lib/mini_profiler/profiling_methods.rb:78:inblock in profile_method’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_controller/metal.rb:191:in dispatch' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_controller/metal.rb:252:indispatch’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_dispatch/routing/route_set.rb:52:in dispatch' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_dispatch/routing/route_set.rb:34:inserve’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_dispatch/routing/mapper.rb:18:in block in <class:Constraints>' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_dispatch/routing/mapper.rb:48:inserve’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_dispatch/journey/router.rb:52:in block in serve' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_dispatch/journey/router.rb:35:ineach’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_dispatch/journey/router.rb:35:in serve' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_dispatch/routing/route_set.rb:840:incall’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-protection-2.0.7/lib/rack/protection/frame_options.rb:31:in call' /var/www/discourse/lib/middleware/omniauth_bypass_middleware.rb:68:incall’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-2.0.7/lib/rack/tempfile_reaper.rb:15:in call' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-2.0.7/lib/rack/conditional_get.rb:25:incall’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-2.0.7/lib/rack/head.rb:12:in call' /var/www/discourse/lib/content_security_policy/middleware.rb:12:incall’
/var/www/discourse/lib/middleware/anonymous_cache.rb:234:in call' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-2.0.7/lib/rack/session/abstract/id.rb:232:incontext’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-2.0.7/lib/rack/session/abstract/id.rb:226:in call' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/cookies.rb:670:incall’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/callbacks.rb:28:in block in call' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:98:inrun_callbacks’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/callbacks.rb:26:in call' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/debug_exceptions.rb:61:incall’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/show_exceptions.rb:33:in call' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/logster-2.3.2/lib/logster/middleware/reporter.rb:43:incall’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/rack/logger.rb:38:in call_app' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/rack/logger.rb:28:incall’
/var/www/discourse/config/initializers/100-quiet_logger.rb:18:in call' /var/www/discourse/config/initializers/100-silence_logger.rb:31:incall’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/remote_ip.rb:81:in call' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/request_id.rb:27:incall’
/var/www/discourse/lib/middleware/enforce_hostname.rb:17:in call' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-2.0.7/lib/rack/method_override.rb:22:incall’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/executor.rb:14:in call' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-2.0.7/lib/rack/sendfile.rb:111:incall’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-mini-profiler-1.0.2/lib/mini_profiler/profiler.rb:171:in call' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/message_bus-2.2.2/lib/message_bus/rack/middleware.rb:57:incall’
/var/www/discourse/lib/middleware/request_tracker.rb:176:in call' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/engine.rb:524:incall’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/railtie.rb:190:in public_send' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/railties-5.2.3/lib/rails/railtie.rb:190:inmethod_missing’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-2.0.7/lib/rack/urlmap.rb:68:in block in call' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-2.0.7/lib/rack/urlmap.rb:53:ineach’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-2.0.7/lib/rack/urlmap.rb:53:in call' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/unicorn-5.5.1/lib/unicorn/http_server.rb:605:inprocess_client’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/unicorn-5.5.1/lib/unicorn/http_server.rb:700:in worker_loop' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/unicorn-5.5.1/lib/unicorn/http_server.rb:548:inspawn_missing_workers’
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/unicorn-5.5.1/lib/unicorn/http_server.rb:144:in start' /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/unicorn-5.5.1/bin/unicorn:128:in<top (required)>’
/var/www/discourse/vendor/bundle/ruby/2.6.0/bin/unicorn:23:in load' /var/www/discourse/vendor/bundle/ruby/2.6.0/bin/unicorn:23:in

Thanks @usulrasolas, could you fill out this form here?

https://thepavilion.io/w/bug-report/

2 Likes

I will as soon as I finish a forced but needed migration and see if the issue still exists. Thanks, didn’t realize this was there, and will be helpful for reporting any bugs in the future!

Just an idea: There is a functionality that this plugin could “steal” from another similar one ( Knowledge Explorer Plugin ). It’s the ability to select what’s displayed in the knowledge base with tags instead of just categories. That enables to just cherry pick some topics from anywhere.

On desktop, the KB looks great, but on mobile it’s just a tiny rectangle on the top left. Would it be possible to show it expanded by default?

I tried finding the piece of code that is in charge of this, but I wasn’t able to figure it out. Removing this unless didn’t do the trick. :thinking:

2 Likes

@Nacho_Caballero You could have it always expanded if you force expanded to be true in the knowledge-base-nav component, and remove the bound events in that component. I don’t have the time right now to work that up for you, but happy to accept a PR / give further pointers.

More broadly I’ve been hestitant to work on this plugin because there’s a fair degree of overlap with @justindirose’s excellent Knowledge Base Theme Component.

If users of this plugin see same tangible differences that are not feasible to include in Justin’s work, then we can invest more resources in improving and maintaing this (cc @FoohonPie)

5 Likes

Thanks for the reply, Angus. I’ll give it a try :+1:

These are the reasons I prefer your plugin over Justin’s:

  • You let me put a help icon next to the search icon (instead of adding a KB nav pill inside each category)
  • You only show the first post of the topic (which lets me keep the discussion separate from the actual help guide)

I see benefits to both approaches, but your style fits better with the way I want to help my audience.

Justin has gone even further now and created the Knowledge Explorer Plugin. I’m not sure how it relates to the theme component he created and its status… but I think it goes further. I agree with you Angus that it might be better to focus energies on helping Justin. Using official plugins is always a Good Thing™.

That said, there are quite a few features I really like from this knowledge base plugin that I miss! We put some excellent thought and work in, Angus, so let’s think some more about it before we throw it all away. If Justin is not interested in them and if we have a maintainer, maybe we should keep going here. Also, our plugin is actually working pretty well now and Justin’s work is still in progress and there is not much info available on his plans.

I think Justin is pursuing a different model where sites have maybe one or two KB categories with lots of topics that can be drilled down into using tags. Topics inside them appear as discussion topics with all the replies and discussion features intact. Ours is based on having one category with lots of sub-categories that can be drilled down into using a navigation menu. Topics inside are clean and have no discussion features, with link across to the discussion topic.

In bullet points, features I like are:

  • automatic support for sub-categories so you can have a kb category, and each sub-category is automagically included as a section. lovely!
  • respects category permissions to display categories and topics within them only to people with access
  • super handy table of contents that can have sections opened/closed to drill down
  • ability to manually set the sort order of topics in the table of contents
  • landing page text for the kb
  • landing pages for each section drawn from the about page
  • clean display of the kb topic, with no discussion features (but with link across to the discussion)

Some work that seems needed to bring this plugin up to speed:

  • ability to reorder sections (feature request)
  • display DiscoTOC (feature request)
  • ability to export/print entire section at once
  • toggle to switch back and forth between kb view of topic and discussion view, that works both ways (feature request)
  • ability to restrict keyword search kb topics when within the kb
  • ability to link directly to a section to display it without the distraction of other sections (eg /k/helpdesk to display just the helpdesk knowledgebase). Maybe also ability to confiure multiple knowledge base root categories.
  • ability to edit kb topics directly from the kb, maybe by adding EDIT link next to PRINT

Some bugs I noticed trying it today on my work community:

  • name space collision with knowledge base theme component (I think - this may be resolved)
  • printing works, but takes user away from page and displays topic with pencil shaded theme. (on my site, also does not exclude some theme customizations that interfere)
  • KNOWLEDGE BASE is displayed on top menu, but links to /c/kb/l/kb path which is incorrect. Should link to /k which does work.
  • for some reason, first item on the knowledge base menu is knowledge base - and seems to contain all topics in the sub-categories. links broken.

Some features from Justin’s work that I now miss:

  • tag filtering!
  • default to kb view within regular usage of forum
  • big search form right at the top

Screen shots

1 Like

I’m getting the same error. I love the plugin, but it completely breaks the search function. I’ve submitted a bug report as well. Thanks!

2 Likes

It seems this plugin causes my discourse instance to fail (bootstraps, but site doesn’t load) if I use it along with the Solved plugin. In other words, I seem to have to choose between the two plugins. Wondering if anyone else has run into this?

edit: Specifically it seems to fail in this manner if I try to nav from the admin panel to the homepage/forum index:

Server Error

while trying to load [/categories.json](DOMAIN/categories.json)

with domain being my app’s root domain

edit: This looks to manifest the same way as the bug @Ryan_Hyer is mentioning. Again (same logged error), it stops if I remove the solved plugin (which is listed in his list of used plugins) so I assume it is some sort of conflict between the two

1 Like

Yeah the idea on Knowledge Explorer is to filter and search any knowledge-base type topic across a set of selected categories and tags. It’s more about discovery and less about creating a structured KB like this plugin does. There are definitely two different use cases here.

The iteration released 2019-10-31T05:00:00Z pulls just the OP into the explorer view, versus the discussion. There is a link to the discussion if that is needed however.

3 Likes

Given the issues with this plugin, I would not recommend installing it until a path forward has been determined for it by @angus and his pavilion colleagues. The Knowledge Explorer Plugin is an impressive alternative, showing much promise. It will likely be an official plugin so it’s highly recommended.

Cool! I can repro this. Let’s keep the convo about this bug over here: