Condition plugins provided by module not mentioned in docs

Created on 27 October 2024, 6 months ago

Problem/Motivation

From reading the main project page for this module, and the README.md file in the repo, there is no mention of the fact that this context module actually provides 7 condition plugins that become available upon installation of context. README just says "Context for Drupal 8 uses the built in condition plugins supplied by Drupal through the Plugin API. So any conditional plug-ins supplied by other modules can also be used with context."

The context-provided plugins are:

  • ContextAll
  • ContextAny
  • HttpStatusCode
  • RequestDomain
  • RequestPathExclusion
  • UserProfilePage
  • ViewInclusion

And these appear as follows in the configure visibility/conditions section:

Sure, if you look in the appropriate src folder of the repo, you can see them sitting there, but, to me, there is no expectation from the readings to even bother looking there to figure that out that we are getting those as a bonus...

The challenge I ran into, long story short, is walking into a project using this module (and not having used it before), finding the module was not being used (there were no contexts defined), wanting to uninstall it... but then running into errors where asset_manager and google_tag were looking for certain plugins... for which I did not think that context was providing such plugins to begin with... and the kicker is those modules weren't even using those conditions anyways, it was just old config in the db, that still declared a dependency on context module and certain plugins for some reason, but cleared out and worked ok upon resaving each's config...

Proposed resolution / User interface changes

The moral of the above story is to propose to either to:

  • document somehow that these plugins are provided by the context module and will be made available immediately upon installation.
  • prefix the name of each context-provided condition with "Context:" or "(Context)", so it can easily be figured by looking at the tabs that these are special conditions provided by a module. (who would guess from the UI that "Request path exclusion" has anything to do with the context module, for example?)
  • add a help text note that the condition is provided by the context module, like depicted above.
πŸ“Œ Task
Status

Active

Version

5.0

Component

Documentation

Created by

πŸ‡ΊπŸ‡ΈUnited States fizcs3 Omaha, Nebraska; USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024