Skip to content

Conversation

@nathangavin
Copy link
Contributor

Description:

Please include a description of this change and which issue it fixes. If no issue exists yet please include context and what problem it solves.

Review

@nathangavin nathangavin marked this pull request as ready for review October 31, 2025 01:08
@nathangavin nathangavin requested a review from a team October 31, 2025 01:08
@nathangavin nathangavin added the Needs Review PRs that need a code review label Oct 31, 2025
Comment on lines +23 to +37
$description = Piwik::translate('General_ComplianceCNILDescription');

$isCloud = false;

/**
* This event should only be used by the cloud plugin, to determine that the
* current instance is a cloud instance.
*/
Piwik::postEvent('Policy.onCloudInstance', [$isCloud]);

if ($isCloud) {
$description .= ' ' . Piwik::translate('General_ComplianceDPALink', ['<a href="https://matomo.org/matomo-cloud-dpa/">', '</a>']);
}

return $description;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we don't want any cloud specific code in core, we should only post an event to update the description, and handle the rest in the cloud plugin.

Passing the policy class through the event as well if the event consumer wanted different updates per policy.

Suggested change
$description = Piwik::translate('General_ComplianceCNILDescription');
$isCloud = false;
/**
* This event should only be used by the cloud plugin, to determine that the
* current instance is a cloud instance.
*/
Piwik::postEvent('Policy.onCloudInstance', [$isCloud]);
if ($isCloud) {
$description .= ' ' . Piwik::translate('General_ComplianceDPALink', ['<a href="https://matomo.org/matomo-cloud-dpa/">', '</a>']);
}
return $description;
$description = Piwik::translate('General_ComplianceCNILDescription');
Piwik::postEvent('CompliancePolicy.updateDescription', [&$description, self::class]);
return $description;
"Comparisons": "Comparisons",
"ComplianceCNILTitle": "CNIL website analytics consent exemption conditions",
"ComplianceCNILDescription": "This table provides an indication of whether certain settings align with CNIL guidance. It does not guarantee full legal compliance. To qualify for the consent exemption under CNIL rules, all required configurations must be implemented. If any setting is shown as “Non-Compliant,” the exemption conditions are not met, and consent must be obtained from users. If any setting is shown as “Unknown” Matomo cannot determine whether this requirement has been implemented. In such cases, these measures must be manually verified.",
"ComplianceDPALink": "%1$sData Processing Agreement.%2$s",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would live in the cloud plugin

Comment on lines +1943 to +1947
-
message: "#^If condition is always false\\.$#"
count: 1
path: core/Policy/CnilPolicy.php

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be gone as we remove the conditional logic and handle it in cloud plugin.

@michalkleiner michalkleiner added this to the 5.6.0 milestone Oct 31, 2025
@michalkleiner michalkleiner changed the title add event to policy description to support cloud only links appearing Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review PRs that need a code review

3 participants