Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When "memcache admin" is enabled, and the "show memcache statistics at the bottom of each page" option is selected on admin/settings/memcache, file uploads fail.
The fix is easy, just replace the following line in memcache_admin_init():
if (($user->uid == 0) || strstr($_SERVER['PHP_SELF'], 'update.php') || strstr($_GET['q'], 'autocomplete')) {
with this (heavily borrowing from devel module)
if (($user->uid == 0) || strstr($_SERVER['PHP_SELF'], 'update.php') || strstr($_GET['q'], 'autocomplete') || $_GET['q'] == 'admin/content/node-settings/rebuild' || $_GET['q'] == 'upload/js' || substr($_GET['q'], 0, strlen('system/files')) == 'system/files') {
-mike
Comment | File | Size | Author |
---|---|---|---|
#2 | memcache_admin.module.319697.patch | 907 bytes | jaydub |
Comments
Comment #1
Jeremy CreditAttribution: Jeremy commentedCan someone test this and confirm it solves the problem? (Attaching a real patch would certainly help...)
Comment #2
jaydub CreditAttribution: jaydub commentedComment #3
ambo CreditAttribution: ambo commentedHi,
i run into this issue on a drupal installation using imagecache. for some reason imagecache is redirecting to itsself if a picture is rebuild with imagemagick or gd-lib. in this case drupal has not run the full bootstrap so no theming is available. memcache admin still wants so theme the memcache stats, and therefor has to implement theming functions. but in php's shutdown function working directory is set to / so no relative requires or includes are possible.
in memcache.admin on line 223 you still check for soe content-types which don't like text outputs, maybe it is usefull to check some more (dunno what header exists while processing images) here?
Comment #4
quicksketchMemcache is responsible for many instances of file uploads breaking in the FileField queue, see #297035: HTTP error 0 . Rather than checking certain paths however, a more reliable method would be checking headers for any type other than "text/html", as Devel module currently does.
Comment #5
Exploratus CreditAttribution: Exploratus commentedI just installed memache, and when i try to upload a file i get AHAH problem and it breaks - Version 6.x - 1.6. Any solutions?
Comment #6
Jeremy CreditAttribution: Jeremy commentedAre you able to duplicate with the latest -dev snapshot?
Comment #7
Fabianx CreditAttribution: Fabianx commentedProblem is still active in 6.x-1.8.
I'll fix this soon as it would be nice to have memcache admin not break all upload fields ...
Comment #8
catchRe-opening this. #372810: Lots of failed include_once errors is duplicate.
Comment #9
catchComment #10
Jeremy CreditAttribution: Jeremy commentedDuplicated, and patch applied (with some minor changes). Confirmed that file uploads were broken before the patch, and work after the patch (using the core upload module).
http://drupalcode.org/project/memcache.git/commitdiff/566d3e9
Comment #11
Jeremy CreditAttribution: Jeremy commentedWhoops, needs to be ported to 7.x-dev.
Comment #12
catchApplied fine via cherry pick. Pushed.