Ignorar Navegação
Expandir
  • Pesquisa AvançadaAbre uma nova caixa de diálogo
    Insira os sinais de mais (+) ou menos (-) nos termos de pesquisa para tornar uma palavra obrigatória ou excluída
    Dicas de Pesquisa
    Filtrar por produto
    Filtrar por categoria
Form token is stripped from widget AJAX calls
Identificação da resposta 12720   |   Revisado 13/10/2023

Why isn't our custom widget AJAX-handler receiving the f_tok POST data anymore?

Environment:
  • Migrating to Customer Portal (CP) 3.9
  • Custom widget ajax-handling with form tokens
Issue:
 
We have a custom widget that consumes the f_tok form expiration token value passed to it by an ajax request to /ci/ajax/widget. When we update the CP framework to version 3.9, the token is now missing from the parameters received by the handler in our widget controller.
 
Cause:
 
In CP 3.9, /ci/ajax/widget unsets the value f_tok after it is validated and before sending the POST data to the widget controller.
 
Resolution:
 
If you want to validate this token directly in your widget's ajax handler, you could send it with any other name than f_tok.
 
For troubleshooting, try var_dump($params) in your widget controller ajax handler function.
 
Notes:
 
See /dav/cp/core/framework/Controllers/Ajax.php. In framework version 3.9, there is a comment "remove f_tok coming in POST so that downstream additional checks are avoided."
Notificar-me
A página será atualizada no envio. Todas as entrada pendentes serão perdidas.