When enabling offline mode, nothing really happens. This looks to be just some simple adjustments in the code at two spots in the apps.manifest.inc.

1: At the mark of 'if we are in offline mode', it has

195   // If there is no remote server, or we're in offline mode, stop here.
196   if (!$server['manifest'] || variable_get('apps_offline_mode', FALSE)) {
197     return $manifest;
198   }

Shouldn't it be more like this?

195   // If there is no remote server, or we're in offline mode, stop here.
196   if (!$server['manifest'] || variable_get('apps_offline_mode', TRUE)) {
197     return $manifest;
198   }

Secondly we have the image checks. My drupal installation was going crazy for each image as it was ALWAYS double checking and downloading new images. This is also uncharacteristic of an 'offline mode'. I made the following insert in the "apps_retrieve_app_image" function. This is just a hack, so I'm sure you guys (as the maintainers) can come up with a better solution!

310   if (!empty($fids) && isset($fids[0]) && is_numeric($fids[0])) {
311     $current = file_load($fids[0]);
312   }
313
314   // ADDITION: skip image check if we are in offline mode
315   if (variable_get('apps_offline_mode', TRUE)){
316         $current = (object) 'current';
317         $current->path = $uri;
318         $current->title = !empty($title) ? $title : '';
319         $current->alt = !empty($alt) ? $alt : $title;
320         return (array) $current;
321   }  // END ADDITION
322   // Check to see if the remote file is newer than the one that.
323   // We have and that the one we have still exists.
324   if ($current && file_exists($current->uri)) {

Anyway, I apologize if these are already being worked on. The image check added about 20-40 seconds on my Dashboard view because of all the HEAD/GET requests it was sending out from Drupal for EACH app I had. After i made this flip, its instant. I am only working in offline mode for the majority of my installs, so I wanted to throw this out there for anyone else having the issue.

Comments

cameronjb’s picture

Issue summary: View changes
hefox’s picture

Status: Active » Postponed (maintainer needs more info)

Huh, you understand how variable_get works? If you set a variable to true, variable_get will return true, so if you had to change the default value of the variable_get to TRUE then your variable wasn't set to true at that stage.

The multiple download of images should be fixed with a recent commit, might still be in -dev version