-
-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle deleted model classes when purging tokens #7188
base: 4.13
Are you sure you want to change the base?
Conversation
How can the class of an opt-in token be deleted? Did you remove an implementation that used opt-in tokens? |
Yes, I used the OptIn service for an own implemention. That implementation does not exist anymore, but the OptIn tokens (referencing to that old implementation, table names |
} catch (\RuntimeException $e) { | ||
// Class does not exist anymore, token can be deleted | ||
break; | ||
} | ||
|
||
/** @var Model $model */ | ||
$model = $this->framework->getAdapter($class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't the error happen here rather than with $class = $adapter->getClassFromTable($table);
? The latter just returns a string and should always work, even if the class does not exist anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But that's the stack trace for Contao 5. This PR is against 4.13 and the error would not occur in that line - it would occur later when the class is tried to be instantiated.
My Sentry is overflowing because of this error 馃槃