Download & Extend

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

Project:Memcache API and Integration
Version:7.x-1.x-dev
Component:memcache_admin
Category:bug report
Priority:major
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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

Comments

#1

Status:active» needs review

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

#2

AttachmentSize
memcache_admin.module.319697.patch 907 bytes

#3

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?

#4

Status:needs review» needs work

Memcache 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.

#5

Version:5.x-1.8» 6.x-1.6

I 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?

#6

Status:needs work» postponed (maintainer needs more info)

Are you able to duplicate with the latest -dev snapshot?

#7

Version:6.x-1.6» 6.x-1.8
Assigned to:Anonymous» Fabianx

Problem 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 ...

#8

Assigned to:Fabianx» Anonymous
Status:postponed (maintainer needs more info)» needs work

Re-opening this. #372810: Lots of failed include_once errors is duplicate.

#9

Component:Code» memcache_admin
Priority:normal» major

#10

Status:needs work» fixed

Duplicated, 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

#11

Version:6.x-1.8» 7.x-1.x-dev
Status:fixed» patch (to be ported)

Whoops, needs to be ported to 7.x-dev.

#12

Status:patch (to be ported)» fixed

Applied fine via cherry pick. Pushed.

#13

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.