Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Debug toolbar selectors #5544

Merged

Conversation

iRedds
Copy link
Collaborator

@iRedds iRedds commented Jan 5, 2022

Description
#5541

Selectors are not unique, and elements are searched throughout the document, so there might be a conflict.

Document object replaced with toobar fragment

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@lonnieezell lonnieezell merged commit e0fd7d4 into codeigniter4:develop Jan 5, 2022
@iRedds iRedds deleted the fix/debug-toolbar-selectors branch January 5, 2022 04:21
@kenjis kenjis added bug Verified issues on the current code behavior or pull requests that will fix them hotfix labels Jan 5, 2022
@kenjis
Copy link
Member

kenjis commented Jan 7, 2022

Probably because of this PR, debug toolbar does not show up, if I click the icon.
Screenshot 2022-01-07 14 06 57

Uncaught TypeError: this.toolbar is undefined
showTab http://localhost:8080/ line 37 > injectedScript:92
createListeners http://localhost:8080/ line 37 > injectedScript:64
init http://localhost:8080/ line 37 > injectedScript:21
onreadystatechange http://localhost:8080/index.php?debugbar:49
loadDoc http://localhost:8080/index.php?debugbar:14
EventListener.handleEvent* http://localhost:8080/index.php?debugbar:1
line 37 > injectedScript:92:14

Screenshot 2022-01-07 14 07 18

@kenjis kenjis mentioned this pull request Jan 7, 2022
5 tasks
@paulbalandan
Copy link
Member

I think the fix would be to call ciDebugbar.init() in the js. But I don't know where to place it.

@iRedds
Copy link
Collaborator Author

iRedds commented Jan 7, 2022

@paulbalandan Calling the showTab method changes the context (this = a instead of this = ciDebugBar) if the method is called not directly, but as an "internal call".
Don't understand how i missed this.
Now my question is how to fix this correctly? New PR?

@kenjis
Copy link
Member

kenjis commented Jan 7, 2022

@iRedds There is no other way than new PR.

kenjis pushed a commit that referenced this pull request Jan 8, 2022
@kenjis kenjis mentioned this pull request Jan 8, 2022
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them hotfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants