jan-vince / smallgdpr

OctoberCMS plugin to cope with GDPR
MIT License
9 stars 9 forks source link

Issue with undefined variable $context #32

Closed eger-heed closed 6 months ago

eger-heed commented 6 months ago

Not sure if this is only related to my installation and something I did, but I get this error when adding the plugin to the latest version of October:

An exception has been thrown during the rendering of a template ("Undefined variable $context").
~/plugins/janvince/smallgdpr/components/cookiesbar/cookiesbar.htm line 78
73  <script>
74
75        document.querySelector('#cookies-bar .btn-accept-all').addEventListener('click', function(e) {
76
77            e.preventDefault();
78            {% partial '@set-cookies' %}
79
80            if (document.querySelector('#cookies-bar')) {
81
82                document.querySelector('#cookies-bar').style.display = 'none';
83            }
84            {% for button in cookiesSettingsGet('cookies_bar_buttons', null)  %}

I can't see an apparent error in either the component default partial or the set-cookies that is referenced as the error source on line 789,

I've gone over and removed all my own overwriting partials and started clean a couple of times, but still no dice. The weird thing is I can't find $context in the plugin code, leading me to believe this is either a compatibility thing with the error originating somewhere else, or just my own ineptness at coding ;) Any help would be appreciated.

eger-heed commented 6 months ago

This error just appeard in a completely different context in October, so I'm pretty sure this has nothing to do with your plugin. Sorry for jumping to conclusions. :)