Skip to content

ProcessController->isAjax() prevents using HTMX in modules of type process #2106

@th-developer

Description

@th-developer

Context: admin.php uses $config->ajax to control output and output buffering (ob_...). In case of true a process modules output is send directly otherwise the modules output is embedded as "content" in an admin page.

when you use htmx in an modules execute<...> method you want this ajax like handling.

Problem:
in admin.php $config ->ajax is overruled by the return value of ProcessController->isAjax(). And ProcessController is not modifiable whether by overriding isAjax() nor by hooks and it knows only how to detect incoming ajax requests (by checking HTTP headers)

It is not possible to arrange direct HTMX output (like in case of classic ajax) in a execute<...> method of a modules object.

possible Solutions already discussed here:
processwire forum: enable output other than classic ajax or full admin page in "process modules" (trouble with HTMX)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions