wagtail-tag-manager icon indicating copy to clipboard operation
wagtail-tag-manager copied to clipboard

Cookie bar not shown when only required/default tag types are used

Open pbspm01 opened this issue 3 years ago • 4 comments
trafficstars

Describe the bug When WTM_TAG_TYPES only contains default, or required types, the cookie bar does not show even at the first page load.

When any tag type is set to delayed or initial, the cookie bar shows at the first page load.

To Reproduce Steps to reproduce the behavior:

  1. In the settings set WTM_TAG_TYPES to either "", or "required". Do not set "delayed" or "initial" for any tags.
  2. Load a page
  3. See the lack of the cookie banner

Expected behavior The cookie banner is shown at first page load.

Screenshots N/A

Desktop (please complete the following information):

  • OS: Linux
  • Browser: Chrome Version 101.0.4951.64 (Official Build) (64-bit) & Firefox 91.9.0esr (64-bit)
  • Version

Smartphone (please complete the following information):

  • Device: Sony Xperiz XZ1 Compact
  • OS: Android 9
  • Browser Chrome
  • Version 102.0.5005.59

** Installed packages ** wagtail-tag-manager==1.3.2

  • selenium [required: >=3.141.0,<3.142.0, installed: 3.141.0]
    • urllib3 [required: Any, installed: 1.26.9]
  • wagtail [required: >=2.11,<2.17, installed: 2.16.2]
    • anyascii [required: >=0.1.5, installed: 0.3.1]
    • beautifulsoup4 [required: >=4.8,<4.10, installed: 4.9.3]
      • soupsieve [required: >1.2, installed: 2.3.2.post1]
    • Django [required: >=3.2,<4.1, installed: 3.2.13]
      • asgiref [required: >=3.3.2,<4, installed: 3.5.2]
      • pytz [required: Any, installed: 2022.1]
      • sqlparse [required: >=0.2.2, installed: 0.4.2]
    • django-filter [required: >=2.2,<22, installed: 21.1]
      • Django [required: >=2.2, installed: 3.2.13]
        • asgiref [required: >=3.3.2,<4, installed: 3.5.2]
        • pytz [required: Any, installed: 2022.1]
        • sqlparse [required: >=0.2.2, installed: 0.4.2]
    • django-modelcluster [required: >=5.2,<6.0, installed: 5.3]
      • pytz [required: >=2015.2, installed: 2022.1]
    • django-taggit [required: >=2.0,<3.0, installed: 2.1.0]
      • Django [required: >=2.2, installed: 3.2.13]
        • asgiref [required: >=3.3.2,<4, installed: 3.5.2]
        • pytz [required: Any, installed: 2022.1]
        • sqlparse [required: >=0.2.2, installed: 0.4.2]
    • django-treebeard [required: >=4.5.1,<5.0, installed: 4.5.1]
      • Django [required: >=2.2, installed: 3.2.13]
        • asgiref [required: >=3.3.2,<4, installed: 3.5.2]
        • pytz [required: Any, installed: 2022.1]
        • sqlparse [required: >=0.2.2, installed: 0.4.2]
    • djangorestframework [required: >=3.11.1,<4.0, installed: 3.13.1]
      • django [required: >=2.2, installed: 3.2.13]
        • asgiref [required: >=3.3.2,<4, installed: 3.5.2]
        • pytz [required: Any, installed: 2022.1]
        • sqlparse [required: >=0.2.2, installed: 0.4.2]
      • pytz [required: Any, installed: 2022.1]
    • draftjs-exporter [required: >=2.1.5,<3.0, installed: 2.1.7]
    • html5lib [required: >=0.999,<2, installed: 1.1]
      • six [required: >=1.9, installed: 1.16.0]
      • webencodings [required: Any, installed: 0.5.1]
    • l18n [required: >=2018.5, installed: 2021.3]
      • pytz [required: >=2020.1, installed: 2022.1]
      • six [required: Any, installed: 1.16.0]
    • Pillow [required: >=4.0.0,<10.0.0, installed: 9.1.1]
    • requests [required: >=2.11.1,<3.0, installed: 2.27.1]
      • certifi [required: >=2017.4.17, installed: 2022.5.18.1]
      • charset-normalizer [required: ~=2.0.0, installed: 2.0.12]
      • idna [required: >=2.5,<4, installed: 3.3]
      • urllib3 [required: >=1.21.1,<1.27, installed: 1.26.9]
    • tablib [required: >=0.14.0, installed: 3.2.1]
    • telepath [required: >=0.1.1,<1, installed: 0.2]
    • Willow [required: >=1.4,<1.5, installed: 1.4.1]
    • xlsxwriter [required: >=1.2.8,<4.0, installed: 3.0.3]

Additional context In many countries it is illegal to have consent boxed pre-checked. Therefore the correct approach there is to use only required or default type tags, in which case the cookie bar is not shown, so there's no chance that the user can be asked on a relatively easy way to give consent.

pbspm01 avatar May 27 '22 16:05 pbspm01

Hi @pbspm01, I've altered the way consent is stored in the cookie and how it's interpreted by the cookie bar and consent form. Could you perhaps validate if this resolves the issue for you?

Please see #110

jberghoef avatar Jun 08 '22 14:06 jberghoef

Hi @jberghoef, thank you very much!

Yes, absolutely I'll test.

Please give me a couple of days. I'll come back with the results.

pbspm01 avatar Jun 08 '22 18:06 pbspm01

Hi @jberghoef, I've tested and it works now! Cookie bar shows with unchecked boxes.

I had to change an import in strategy.py, though (undoing the change in #109):

"from wagtail.views import serve as wagtail_serve" -> "from wagtail. core. views import serve as wagtail_serve"

I've also noticed a small issue: if a WTM_TAG_TYPE is set to an invalid value, like "blah" then the check-box is pre-checked.

pbspm01 avatar Jun 15 '22 12:06 pbspm01

Hi @jberghoef , I've upgraded since to Wagtail 3 and the solution works without a problem. Will you make this feature official? Thank you!

pbspm01 avatar Nov 22 '22 20:11 pbspm01