Skip to content

Feature-Request: Get current working context inside invoke event ClientConfig_ConfigChange  #206

Description

@sebastian-marinescu

Summary

When developing a plugin that listens to ClientConfig_ConfigChange, inside a multi-context-aware setup, there is no way of knowing which context just got changed/updated.

Step to reproduce

Inside a plugin try to get the settings to the currently changed context:

// This always returns `mgr`, which sort of is correct:
$contextKey = $modx->context instanceof modContext || $modx->context instanceof \MODX\Revolution\modContext ? $modx->context->get('key') : 'web';
$settings = $clientConfig->getSettings($contextKey);

Observed/Expected behavior

There is currently no way to know which context got changed. When the event is invoked, it would be beneficial to also send the context-key of the currently changed context.

Environment

ClientConfig 2.3.3-pl
MODX Revolution 2.8.5-pl

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions