-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
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.3
CodeIgniter4 Version
4.6.3
CodeIgniter4 Installation Method
Composer (using codeigniter4/appstarter
)
Which operating systems have you tested for this bug?
Linux
Which server did you use?
apache
Database
No response
What happened?
I get this error in the browser console when using the debug toolbar to highlight views:
Uncaught TypeError: Cannot read properties of null (reading 'nodeName')
at getValidElementInner (<anonymous>:320:45)
at getValidElement (<anonymous>:356:25)
at showHints (<anonymous>:373:36)
at btn.parentNode.onclick (<anonymous>:513:17)
getValidElement
calls getValidElementInner
with nodeElement.previousElementSibling
which is null
when nodeElement
is the comment node for "DEBUG-VIEW START 1 APPPATH/Views/bar.php"
As a result, the view highlighter gets stuck in an invalid state and further clicks on the button keep adding highlight elements and logging more errors.
Steps to Reproduce
app/Views/foo.php: <div><?= view('bar') ?></div>
app/Views/bar.php: <script></script>
any controller: return view('foo');
Render the view, then click on "Views" in the debug toolbar
Expected Output
No error
Anything else?
No response
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