As a site administrator, go to admin/structure/types/manage/{node_type}/display and attempt to change the display's visibility using the select ajax widget. The throbber appears and spins and spins and spins.

Reviewing the watchdog logs, it appears that the form is not fetched, as it is showing the error called here:
watchdog('ajax', 'Invalid form POST data.', array(), WATCHDOG_WARNING); in ajax_get_form http://drupalcontrib.org/api/drupal/drupal--includes--ajax.inc/function/...

My memcache config is as follows:

<?php
/**
 * Memcache Caching
 */
// the path to the core cache file
include_once('./includes/cache.inc');
// the path to the memcache cache file
include_once('./sites/all/modules/memcache/memcache.inc');

// make MemCacheDrupal the default cache class
$conf['cache_default_class'] = 'MemCacheDrupal';

// Memcache servers
 $conf['memcache_servers'] = array(
         '127.0.0.1:11211' => 'default',
         '127.0.0.1:11212' => 'menu',
         '127.0.0.1:11213' => 'filter',
         '127.0.0.1:11214' => 'form',
         '127.0.0.1:11215' => 'block',
         '127.0.0.1:11216' => 'update',
         '127.0.0.1:11217' => 'views',
         '127.0.0.1:11218' => 'content',
         '127.0.0.1:11219' => 'apachesolr',
       );
$conf['memcache_bins'] = array(
          'cache'        => 'default',
          'cache_menu'   => 'menu',
          'cache_filter' => 'filter',
          'cache_form'   => 'database',
          'cache_block'  => 'block',
          'cache_update' => 'update',
          'cache_views'  => 'views',
          'cache_views_data'  => 'views',
          'cache_content'  => 'content',
          'cache_apachesolr'  => 'apachesolr',
       );
?>

After disabling the memcache module and commenting out the memcache config items in the settings.php, the fields_ui widgets appear to function normally. This happens in Chrome and Firefox for Mac.

Drupal project issue queue with the similar problem from other modules here #1075482.

Joe

Comments

dench0’s picture

Subscribe.
I have the same problem.

catch’s picture

Category: bug » support
Priority: Major » Normal
Status: Active » Postponed (maintainer needs more info)

This line in your configuration doesn't make any sense in D7:

 'cache_form'   => 'database',

You should set cache_form to use DrupalDatabaseCache - that is supported natively by Drupal 7 and is not a memcache feature at all. Needs to be in the overall cache settings, not memcache variables.

See #512026: Move $form_state storage from cache to new state/key-value system and other issues.

jghyde’s picture

Thanks for the reply catch.

I found the problem. I needed to fetch the latest git repo.

Using these steps, typed into the command line:

git clone --branch 7.x-1.x http://git.drupal.org/project/memcache.git
drush en memcache -y
drush updb

Then in settings.php, this config seems to work for forms, because I removed the bin for forms:

<?php
/**
 * Memcache Caching
 */
// the path to the core cache file
include_once('./includes/cache.inc');
// the path to the memcache cache file
include_once('./sites/all/modules/memcache/memcache.inc');

// make MemCacheDrupal the default cache class
$conf['cache_default_class'] = 'MemCacheDrupal';

// Memcache servers
 $conf['memcache_servers'] = array(
         '127.0.0.1:11211' => 'default',
         '127.0.0.1:11212' => 'menu',
         '127.0.0.1:11213' => 'filter',
         '127.0.0.1:11215' => 'block',
         '127.0.0.1:11216' => 'update',
         '127.0.0.1:11217' => 'views',
         '127.0.0.1:11218' => 'content',
         '127.0.0.1:11219' => 'apachesolr',
       );
$conf['memcache_bins'] = array(
          'cache'        => 'default',
          'cache_menu'   => 'menu',
          'cache_filter' => 'filter',
          'cache_block'  => 'block',
          'cache_update' => 'update',
          'cache_views'  => 'views',
          'cache_views_data'  => 'views',
          'cache_content'  => 'content',
          'cache_apachesolr'  => 'apachesolr',
       );
?>

Thanks for the pointer catch!

Joe

catch’s picture

That is still going to put cache_form in memcache.

You should put $conf['cache_class_cache_form'] = 'DrupalDatabaseCache'; if you actually want that to use the db (which is recommended that this point due to core mis-using cache_form for $form_state storage).

jghyde’s picture

So the final settings.php should look like this?

This is tested and appears to work well:

<?php
/**
 * Memcache Caching
 */
// the path to the core cache file
include_once('./includes/cache.inc');
// the path to the memcache cache file
include_once('./sites/all/modules/memcache/memcache.inc');

// make MemCacheDrupal the default cache class
$conf['cache_default_class'] = 'MemCacheDrupal';

// Memcache servers
 $conf['memcache_servers'] = array(
         '127.0.0.1:11211' => 'default',
         '127.0.0.1:11212' => 'menu',
         '127.0.0.1:11213' => 'filter',
         '127.0.0.1:11215' => 'block',
         '127.0.0.1:11216' => 'update',
         '127.0.0.1:11217' => 'views',
         '127.0.0.1:11218' => 'content',
         '127.0.0.1:11219' => 'apachesolr',
       );
$conf['memcache_bins'] = array(
          'cache'        => 'default',
          'cache_menu'   => 'menu',
          'cache_filter' => 'filter',
          'cache_block'  => 'block',
          'cache_update' => 'update',
          'cache_views'  => 'views',
          'cache_views_data'  => 'views',
          'cache_content'  => 'content',
          'cache_apachesolr'  => 'apachesolr',
       );

// Add to cache forms in drupal database, not memcache see 
// http://drupal.org/node/1214536#comment-4748042
$conf['cache_class_cache_form'] = 'DrupalDatabaseCache';
?>
catch’s picture

That looks right to me.

jghyde’s picture

Thanks catch. memcache is legit for Drupal 7.

Do you want me to make a patch to add this to documentation INSTALLATION.txt, or do you want to wait until the other issue about the form cache name gets solved in core?

catch’s picture

There's one other thing here. For a couple of releases, memcache has had wildcard support, so you don't necessarily need to put all your bins in actual separate cache bins - they could all share one or two. The only reason to do that would be to guarantee memory to a particular bin (i.e. it makes sense to do that for sessions).

A docs patch for INSTALL.txt or similar (minus the bin configuration) would be great yeah.

jghyde’s picture

Component: Code » Documentation
Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new1.85 KB

Here's a documentation patch for the README.txt to clarify the forms caching and the no need to name explicit bins, with a sample settings.php example. I hope I covered it adequately for memcache newbies like me.

joe

catch’s picture

Sorry just spotted something else, this is a problem with the current docs too but might as well fix.

Should be possible to do something like:

$conf['cache_backends']['MemcacheDrupal'] = DRUPAL_ROOT . '/path/to/memcache/memcache.inc';

rather than the explicit include.

jghyde’s picture

this changes the memcache.inc/memcache.db.inc, still have the include_once(cache.inc).

I didn't get fancy with the DRUPAL_ROOT thing. It failed my test on my cloud server.

Here you go.

markpavlitski’s picture

Status: Needs review » Fixed

I believe this has been addressed in the recent documentation rewrite by Jeremy.

Status: Fixed » Closed (fixed)

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

devd’s picture

it should works if you enable "cache pages for anonymous users".