grav-plugin-admin icon indicating copy to clipboard operation
grav-plugin-admin copied to clipboard

Admin cannot complete page saving when Xdebug enabled

Open yankl opened this issue 1 year ago • 2 comments

When I try to save a page in my local development environment from the admin plugin, I see that the page file does actually get updated, but the browser doesn't refresh, and everything on localhost stops responding until I reset Apache. I can see in the Task Admin that Apache is using CPU, and it can continue doing so indefinitely. Disabling all other plugins didn't help, but I noticed that disabling Xdebug did. It doesn't seem to matter which particular module is enabled -- setting either xdebug.mode to debug or coverage causes the issue -- but if xdebug.mode is set to nothing (xdebug.mode = ), then the problem resolves, even if Xdebug itself is still enabled (zend_extension = xdebug).

I'm on Windows 10 using Laragon, Apache 2.4.58, PHP 8.3.0, Xdebug 3.3.1, Grav 1.7.44, Admin 1.10.44

yankl avatar Mar 12 '24 07:03 yankl

From what you describe it does sound like an issue somewhat related to xdebug.. However I use xdebug every day and have never had an issue. Can you confirm you have no JavaScript errors on the page (via the console in your browsers dev tools). This might help isolate the root cause.

Also can you test with a bare-bones Grav+Admin installation on your setup? It could be an issue with the theme's blueprints that is causing things to get in a loop and therefore choke xdebug.

rhukster avatar Mar 12 '24 15:03 rhukster

I tried it on a fresh install of Grav from the zip file with Grav+Admin, and confirm that there is the same issue.

I see no Javascript errors on either install when editing the page.

However, I have been getting an error each time I log-in to admin, and I see it's also happening on the fresh install. It might very well be related because I see that it also only happens when I have xdebug enabled. The error message pops up and then fades out on the interface, but also appears in the console as so:

admin.min.js?309a05fb26:848 Failed to fetch at TypeError: Failed to fetch
    at request (http://fresh-grav.test/user/plugins/admin/themes/grav/js/admin.min.js?309a05fb26:886:10)
    at Feed.fetch (http://fresh-grav.test/user/plugins/admin/themes/grav/js/admin.min.js?309a05fb26:1763:7)
    at Feed.refresh (http://fresh-grav.test/user/plugins/admin/themes/grav/js/admin.min.js?309a05fb26:1791:14)
    at HTMLDocument.<anonymous> (http://fresh-grav.test/user/plugins/admin/themes/grav/js/admin.min.js?309a05fb26:1826:15)
    at e (http://fresh-grav.test/system/assets/jquery/jquery-3.x.min.js?309a05fb26:2:30158)
    at t (http://fresh-grav.test/system/assets/jquery/jquery-3.x.min.js?309a05fb26:2:30460)

And I've been getting more or less the same error message on my local dev site, though for whatever reason there the bottom of the stack points to lines in jquery-2.x.min.js instead of 3.x.

yankl avatar Mar 13 '24 13:03 yankl