? mobile_tools-variable-cache.patch
Index: mobile_tools.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mobile_tools/mobile_tools.module,v
retrieving revision 1.15.2.41
diff -u -p -r1.15.2.41 mobile_tools.module
--- mobile_tools.module	12 Feb 2010 20:35:54 -0000	1.15.2.41
+++ mobile_tools.module	22 Feb 2010 13:52:06 -0000
@@ -113,12 +113,10 @@ function mobile_tools_boot() {
   if (variable_get('mobile_tools_enable_roles', 0) ) {
     mobile_tools_roles_boot();  // assigns the user the mobile role
   }
-  if ($_SESSION['mobile-tools-site-type'] == 'mobile' || $theme_switched) {  
-    variable_set('default_main_nodes', variable_get('default_nodes_main_mobile', 5));
+  if ($_SESSION['mobile-tools-site-type'] == 'mobile' || $theme_switched && !preg_match('%^admin/content/node-settings(?:/|$)%', $_GET['q'])) {
+    // Modify for this request only (and avoid clearing the variable cache)
+    $conf['default_nodes_main'] = variable_get('default_nodes_main_mobile', 5);
   } 
-  else {
-    variable_set('default_main_nodes', variable_get('default_nodes_main_original', 10));
-  }
 }
 
 /******************************
@@ -812,7 +810,7 @@ function mobile_tools_form_alter(&$form,
       $form['default_nodes_main_mobile'] = array(
             '#type' => 'select',
             '#title' => t('Number of posts on main page for the mobile version'),
-            '#default_value' => variable_get('default_nodes_main_mobile', 10),
+            '#default_value' => variable_get('default_nodes_main_mobile', 5),
             '#options' => Array(
                     1 => 1,
                     2 => 2,
@@ -831,15 +829,10 @@ function mobile_tools_form_alter(&$form,
                 ),
             '#description' => t('The default maximum number of posts to display per page on overview pages such as the main page (on Mobile).'),
         );
-         $form['#submit'][] = 'mobile_tools_node_configuration_submit';
   } 
 //
 }
 
-function mobile_tools_node_configuration_submit($form) {
-  variable_set('default_main_nodes_original', $form['#post']['default_main_nodes']);
-}
-
 /**
  * Helper function to assist in making a mobile url (m.*) from a given url
  * 
