Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The subscription type "" does not exist #95

Open
Kahmoon opened this issue Dec 22, 2022 · 1 comment
Open

The subscription type "" does not exist #95

Kahmoon opened this issue Dec 22, 2022 · 1 comment

Comments

@Kahmoon
Copy link

Kahmoon commented Dec 22, 2022

Hi Kamil,

i am managin subscribers via backend a lot. Sometimes it happens that there is created an "empty" subscription, which causes the complete website to crash if this event is listed. Var/logs contains the following error.

[2022-12-21T18:23:42.677219+01:00] request.CRITICAL: Uncaught PHP Exception InvalidArgumentException: "The subscription type "" does not exist" at /homepages/46/xxx/htdocs/xxx-v3/vendor/codefog/contao-events_subscriptions/src/Codefog/EventsSubscriptions/SubscriptionFactory.php line 52 {"exception":"[object] (InvalidArgumentException(code: 0): The subscription type \"\" does not exist at /homepages/46/xxx/htdocs/xxx-v3/vendor/codefog/contao-events_subscriptions/src/Codefog/EventsSubscriptions/SubscriptionFactory.php:52)"} []

At some state of the registration process there is created an entry without any "type". I cannot reproduce it. Probably it comes from creating a new subscription and abort before completing the process. This could explain why its neither guest or member at the current state. But its written to database to early isn´t it?

I have to remove this entry manually directly in the database. There is no other way.

How can we avoid this? Any idea?

@Kahmoon
Copy link
Author

Kahmoon commented Jan 31, 2023

OK, now i can reproduce this error

Adding subscriber via backend and straight use back function of browser. Do not chose guest or member. Just go back. You now have an empty entry with type "". In this case the frontend will crash if this event is listen on this page.

SCR-20230131-hix

Trying to delete this empty subscription throws

SCR-20230131-hfb

Editing blank entry is possible.

There should be no frontend crash when type = "".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant