Saving the dialog with `functional` = `always active` settings saves the value `false`

Created on 10 September 2024, 10 months ago

Problem/Motivation

Saving the dialog with functional as always active settings sets the group's value to false.

Agreeing the dialog sets the value functional to true.

Steps to reproduce

  1. Enable module.
  2. Saving with functional group enabled.
  3. Reloading the page, via browser tools, inspect cookiesjsr value after decoding.

Proposed resolution

Should be set true in both cases.

🐛 Bug report
Status

Active

Version

1.2

Component

Code

Created by

🇩🇪Germany stolzenhain

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

Comments & Activities

  • Issue created by @stolzenhain
  • I'm also experiencing this issue in version 1.2.13.

  • 🇯🇵Japan neptune-dc

    Problem is in CDN content: /libraries/cookiesjsr/dist/cookiesjsr.min.css: {}

    It treats always on cookies as any service that does not need consent with the variable `service.needConsent`.

    ```javascript
    // cookiesjsr/src/components/layer/SingleService.svelte

  • { service.name }

    {#if service.needConsent}
    title={$services[service.key] ? t('allowed') : t('denied')}
    activated={$services[service.key]}
    changed={setConsent} />
    {:else}
    {t('alwaysActive')}

    {/if}

  • ```

    However, it does not consider `service.needConsent` when saving:

    ```javascript

    import StoreCookieService from '../../services/StoreCookieService.js'; import BaseButton from './BaseButton.svelte' import {services, setAllServices, closeBanner, closeLayer} from "../../store.js"; export let btnType = ''; export let setAll = false; function setAllSaveAndClose() { let servicesState = {...$services}; for (let id in servicesState) { if (typeof servicesState[id] !== 'undefined') { servicesState[id] = setAll; } } StoreCookieService.setServices(servicesState); setAllServices(servicesState); closeBanner(); closeLayer(); }

    clicked="{setAllSaveAndClose}"
    btnType="{btnType}">


    ```

    Since the problem is in the CDN, I don't think this can be solved with a patch.

Production build 0.71.5 2024