-
Notifications
You must be signed in to change notification settings - Fork 2k
Open
Labels
bugVerified issues on the current code behavior or pull requests that will fix themVerified issues on the current code behavior or pull requests that will fix them
Description
PHP Version
8.5
CodeIgniter4 Version
4.7
CodeIgniter4 Installation Method
Composer (using codeigniter4/appstarter)
Which operating systems have you tested for this bug?
macOS
Which server did you use?
cli-server (PHP built-in webserver)
Environment
development
Database
MySQL 8
What happened?
When processing non-HTML requests, the Debugbar attaches special headers such as Debugbar-Link, which provide a URL to render the Debugbar in a separate request.
Although the Debugbar interface is rendered when visiting that URL, it is not fully initialized, which prevents any interaction with it.
Steps to Reproduce
- Add the following route:
// app/Config/Routes.php
$routes->get('ajax', 'Home::ajax');- Add this method to Home controller:
// app/Controllers/Home.php
public function ajax()
{
$this->response->setJSON([]);
}- Add the following script to
welcome_message.php:
<script>
fetch('/ajax', {
headers: {
'Accept': 'application/json',
'X-Requested-With': 'XMLHttpRequest'
}
})
</script>- Open Developer Tools and inspect the Network tab.
- Open the main page in the browser.
- Check the response headers of the
/ajaxrequest and look for theDebugbar-Linkheader. - Copy the URL from
Debugbar-Linkand open it in a new tab.
The Debugbar is displayed, but it is not interactive because it is not properly initialized.
Expected Output
The Debugbar should be fully interactive, just as it is when rendered within a standard HTML response.
Anything else?
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugVerified issues on the current code behavior or pull requests that will fix themVerified issues on the current code behavior or pull requests that will fix them