humanmade / altis-consent

Enhanced user privacy and consent controls for Altis.
GNU General Public License v3.0
5 stars 2 forks source link

Consent banner still shows when `functional` is the only cookie opt-in. #85

Closed robindevitt closed 2 years ago

robindevitt commented 2 years ago

Issue/ Bug

When using the filter altis.consent.always_allow_categories to set the default category and having only the functional category enabled the consent banner still displays when the only allowed consent category is functional. Once a second category is enabled the banner is then hidden.

To replicate

  1. Use the following filter to make the functional category the only allowed by default:

    add_filter( 'altis.consent.always_allow_categories', function () {
    return [ 'functional' ];
    } );
  2. View the site so the cookie banner displays, select Cookie Preferences.

  3. Ensure only functional is selected and then save/ apply changes.

  4. Reload the page and the banner should still display. ( although it shouldn't )

Expectation

When removing statistics-anonymous from the allowed categories and accepting only functional cookies, the banner should remain hidden.

roborourke commented 2 years ago

Don't forget you can close this one out now, I often add a comment to the related PR like Fixes #123 so when the PR is merged the issue is closed automatically

robindevitt commented 2 years ago

PR has been merged and closed out in #87