Daily updates from Odoo
Monday, May 13, 2024
1 change
Resolved issues and error corrections
This fix resolves a critical issue where event badge generation was causing website registrations to freeze indefinitely. The problem occurred when badge images weren't configured, causing the system to attempt unnecessary background image fetches that created database conflicts. With this fix, the badge generation process now works smoothly without blocking user registrations.
Original PR description
__Current behavior before commit:__ If the `badge_image` field of the event isn't set, the badge div's style defaults to `background-image: url();`. When `wkhtmltopdf` interprets this, it attempts to…
__Current behavior before commit:__ If the `badge_image` field of the event isn't set, the badge div's style defaults to `background-image: url();`. When `wkhtmltopdf` interprets this, it attempts to fetch the background image from the website's base URL. Consequently, each time the badge PDF is generated, `wkhtmltopdf` accesses the website's homepage, inadvertently altering the `website_visitor` table. If the badge PDF creation is triggered by a request from the website, it will lead to a deadlock due to simultaneous transactions on the same `website_visitor` row. __Description of the fix:__ Do not write the `background-image` instruction at all when `badge_image` is not set. __Steps to reproduce the issue on runbot:__ - Install `website_event` - Go to Email Templates > **Event: Registration Confirmation** > Settings - Put `Badge` in **Dynamic Reports** - Create a new Event and register to it on its website page -> The registration loads forever and it's impossible to go on any other page on the website opw-3884132