Index: /main/trunk/greenstone2/runtime-src/src/w32server/cgiwrapper.cpp
===================================================================
--- /main/trunk/greenstone2/runtime-src/src/w32server/cgiwrapper.cpp	(revision 22832)
+++ /main/trunk/greenstone2/runtime-src/src/w32server/cgiwrapper.cpp	(revision 22833)
@@ -393,9 +393,13 @@
 		// the collection appears at this gsdlhome only because it's gdbm
 		// file is installed here -- it's real gdbm will therefore be 
-		// somewhere else).
-		text_t build_cfg = filename_cat (my_gsdl_collecthome,
-						 *colhere, "index", "build.cfg");
-						 
-		if (file_exists (build_cfg)) {
+		// somewhere else).		
+		
+		// commenting out the following build_cfg test since the server won't know to load 
+		// collection groups otherwise, as these don't have build_cfg files but ought to be loaded along
+		// with collections (the real test for whether something ought to be loaded--whether an item read
+		// in by read_dir is a collection or collection group--happens at a later time in the GS runtime code).
+		
+		//text_t build_cfg = filename_cat (my_gsdl_collecthome,*colhere, "index", "build.cfg");						 
+		//if (file_exists (build_cfg)) {
 		  collections.insert (*colhere);
 
@@ -408,5 +412,5 @@
 		  tmp.gsdl_dbhome = my_gsdl_dbhome;			
 		  translated_colinfo[*colhere] = tmp;
-		}
+		//}
 	  }
 	  ++colhere;
@@ -474,20 +478,9 @@
     text_tset these_collections;
   
-    // First volume gsdlhome's - part 1
-	// if non-standard collecthome under [gsdl] section of site config file (llssite or glisite),
-	// then need to read in all the collections from this collecthome
-	if(gsdl_collecthome != filename_cat(gsdl_gsdlhome,"collect")) { 		
-		load_collections_from_collectdir(translated_collectinfo,
-				colhere, colend, these_collections,
-				dbhomes, clhomes, collections,
-				gsdl_gsdlhome, gsdl_collecthome, gsdl_dbhome);		
-	}
-	
-	// first volume gsdlhome's - part 2
+    // First volume gsdlhome's
 	// read in all the collections from sections other than [gsdl] in the site config file (llssite/glisite)
     colinfo_tmap::const_iterator this_info = gsdl_collectinfo.begin();
     colinfo_tmap::const_iterator end_info = gsdl_collectinfo.end();
     while (this_info != end_info) {
-	
       if (dbhomes.find ((*this_info).second.gsdl_dbhome) == dbhomes.end()) {
 			load_collections_from_collectdir(translated_collectinfo,
@@ -500,31 +493,24 @@
       ++this_info;
     }
+	
+	// if non-standard collecthome under [gsdl] section of site config file (llssite or glisite),
+	// then need to read in all the collections from this collecthome
+	if(gsdl_collecthome != filename_cat(gsdl_gsdlhome,"collect")) { 
+		load_collections_from_collectdir(translated_collectinfo,
+				colhere, colend, these_collections,
+				dbhomes, clhomes, collections,
+				gsdl_gsdlhome, gsdl_collecthome, gsdl_dbhome);		
+	}	
+  
+  // But when the default greenstone collect dir (gsdlhome\collect) is used, the following is used to load the collections:
   
     // then if necessary the main dbhome (this should only happen if the 
     // gsdl.ini is a little screwed up and no volume dbhomes occurred)
     if (dbhomes.find (gsdl_dbhome) == dbhomes.end()) {
-		  
-      these_collections.erase (these_collections.begin(), these_collections.end());
-      read_dir (filename_cat (gsdl_dbhome, "collect"), these_collections);
-      colhere = these_collections.begin();
-      colend = these_collections.end();
-      while (colhere != colend) {
-		  
-	//text_t build_cfg = filename_cat (gsdl_dbhome,"collect",
-	//			 *colhere, "index", "build.cfg");
-      //if (file_exists (build_cfg)) {
-	  collections.insert (*colhere);
-	  
-	  collectioninfo_t tmp;
-	  tmp.gsdl_gsdlhome = gsdl_gsdlhome;
-	  tmp.gsdl_collecthome = gsdl_collecthome;
-	  tmp.gsdl_dbhome = gsdl_dbhome;
-	  translated_collectinfo[*colhere] = tmp;
-	  //}
-	++colhere;
-      }
-      dbhomes.insert (gsdl_dbhome);
-      clhomes.insert (gsdl_collecthome);
-    }
+	  load_collections_from_collectdir(translated_collectinfo,
+				colhere, colend, these_collections,
+				dbhomes, clhomes, collections,
+				gsdl_gsdlhome, filename_cat (gsdl_dbhome, "collect"), gsdl_dbhome);
+    }	
   }
 
