chris
March 19, 2026, 12:12pm
#1
I have a registration form that used to work fine but now it seems that the ajax handler is submitted twice
<form
data-request="{{ __SELF__ }}::onRegisterAccount"
data-request-validate
data-request-flash="*"
data-request-files
data-request-update="'{{ __SELF__ }}::register-confirmation':'#update-partial'"
>
I can see in the DevTools the 2 requests:
Hey @chris ,
Is it possible that {% framework %} or {% framework extras %} are included more than once in your layout or pages?
1 Like
chris
March 19, 2026, 3:22pm
#3
Hi @apinard
thanks for jumping in
On OC v3, the code is working fine.
On two different instances of OC v4, this code is submitting twice the request AjaxHandler, and therefore the code behind is creating 2 users, in that case.
As a workaround, I had to put the code behind a DB:transaction with a lockTables
and yes I have only one in the code.
apinard:
{% framework extras %}
chris
March 19, 2026, 4:47pm
#4
oh ! But I found a hidden different version of it indeed.
<script src="{{
[
'@jquery',
'@framework.extras',
]|theme
}}"></script>
1 Like
What does the submit button look like?
chris
March 21, 2026, 9:44am
#6
the button
<button type="submit" class="btn btn--squarish btn--block" data-attach-loading>Submit</button>
Looks good, yeah it does sound like the framework has loaded twice.