[FIX] website: prevent crash in FormEditorRegistry if key not found

Steps to reproduce
==================

Go to Maintenance > Studio > Website > New Form
Click on the website editor
Click on the name field

UncaughtPromiseError > KeyNotFoundError

Cause of the issue
==================

Starting from 17, the FormEditorRegistry is not the legacy one.
If the key is not present in the registry, it will fail, unless we pass
a default value.
In this case, the key `website_form_key` is false.

Solution
========

Pass null as the default value.

opw-3652423

closes odoo/odoo#147840

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
This commit is contained in:
Hubert Van De Walle
2024-01-03 16:59:16 +00:00
parent 7e6b875d1e
commit 38155143dc
@@ -629,7 +629,7 @@ options.registry.WebsiteFormEditor = FormEditor.extend({
// Add Action related options
const formKey = this.activeForm.website_form_key;
const formInfo = FormEditorRegistry.get(formKey);
const formInfo = FormEditorRegistry.get(formKey, null);
if (!formInfo || !formInfo.fields) {
return;
}