ContextAwarePluginAssignmentTrait only allows contexts currently available via constraints

Created on 6 March 2020, over 5 years ago
Updated 14 December 2023, over 1 year ago

Problem/Motivation

When listing the contexts available the trait uses ContextHandler::getMatchingContexts which validates against the context definition by data type as well as any constraints.

This can prevent contexts which are not always available from being selected on forms. For example, a plugin with a context definition with a NotNull constraint will not match any contexts returned form getAvailableContexts without a value.

Proposed resolution

It seems to me that when listing available contexts only the data type should be considered and any constraint validation should be left until runtime. This does have an obvious side effect of allowing the selection of contexts that aren't always available and thus may not be available at runtime, resulting in exceptions.

πŸ› Bug report
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component
OtherΒ  β†’

Last updated about 1 hour ago

Created by

πŸ‡ΊπŸ‡ΈUnited States malcolm_p

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024