file uploads file when memcache statistics are written to page footer - easy fix

ultimike - October 10, 2008 - 18:16
Project:Memcache API and Integration
Version:5.x-1.8
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

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

#1

Jeremy - October 30, 2008 - 19:31
Status:active» needs review

Can someone test this and confirm it solves the problem? (Attaching a real patch would certainly help...)

#2

jaydub - April 30, 2009 - 17:35
AttachmentSize
memcache_admin.module.319697.patch 907 bytes

#3

ambo - September 11, 2009 - 09:32

Hi,

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?

 
 

Drupal is a registered trademark of Dries Buytaert.