OFFLINE-GmbH / oc-gdpr-plugin

October CMS plugin to make websites GDPR and ePrivacy compliant
https://octobercms.com/plugin/offline-gdpr
MIT License
36 stars 20 forks source link

"Undefined index: class" on line 36 of /plugins/offline/gdpr/models/DataRetentionSettings.php #43

Closed ghost closed 6 years ago

ghost commented 6 years ago

Hello,

I'm trying to integrate an external plugin with the data-retention system.

The documentation says :

You can either specify a closure or a model class that defines a gdprCleanup method. Both have the same signature:

Here is my code :

        public function boot() {
        \Event::listen('offline.gdpr::cleanup.register', function () {
            return [
                'id'     => 'magicforms',
                'label'  => 'Magic Forms',
                'models' => [
                    [
                        'label'   => 'Magic Forms Records',
                        'comment' => 'Delete logged Magic Forms Records',
                        'closure' => function (Carbon $deadline, int $keepDays) {
                            // Delete your old data here
                        },
                    ],
                ],
            ];
        });
    }

But when I go to the GPRD data retention page, I get the following error :

"Undefined index: class" on line 36 of /plugins/offline/gdpr/models/DataRetentionSettings.php
tobias-kuendig commented 6 years ago

Thank you for reporting this problem. This is fixed with the latest update. You'll have to specify an id if you only use a closure. The README has been updated to reflect these changes:

https://github.com/OFFLINE-GmbH/oc-gdpr-plugin#register-your-plugin

For the time being you'll have to patch your installation manually. I'll first have to figure out how to release a bugfix to the marketplace without releasing all the other new stuff as well.

tobias-kuendig commented 6 years ago

Version 2.0 has just been released. This issue is fixed in the new version.