Skip to content

4.x: show debug_kit iframe error nicely - #898

Merged
markstory merged 1 commit into
4.xfrom
4.x-error-iframe
Nov 13, 2022
Merged

markstory merged 1 commit into
4.xfrom
4.x-error-iframe

Conversation

@LordSimal

Copy link
Copy Markdown
Member

Refs #857

This adds a nice catch when a panel can't be loaded due to some error on the server side.

2022-11-11_17-10-26 (1)

This behavior can be reproduced if you add a syntax error inside the vendor/cakephp/debug_kit/src/Controller/PanelsController.php view method.

@LordSimal LordSimal added this to the 4.x milestone Nov 11, 2022
Comment thread webroot/js/modules/Toolbar.js Outdated
})
.fail(() => {
clearTimeout(timer);
$(`<iframe src="${url}" width="100%" height="100%"></iframe>`).appendTo(contentArea);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use another iframe instead of updating the content of contentArea?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I first wasn't able to get that to work for some reason but you are right, we don't need another iframe here.

@markstory
markstory merged commit ebbbf09 into 4.x Nov 13, 2022
@markstory
markstory deleted the 4.x-error-iframe branch November 13, 2022 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants