So I made this to add support for Domain Access module, if you feel like you want to add it to your module. Feedback?

/**
 * Callback function for boost cache cleaner.
 */
function boost_cache_cleaner_callback() {
  // Check if user has access to this function.
  if (!user_is_anonymous()) {
    if (module_exists('domain')) {
      global $base_root;
      foreach (domain_domains() as $domain) {
        if (isset($domain['path'])) {
          $base_root = $domain['path'];
          boost_flush_caches();
        }
      }
    } else {
      boost_flush_caches();
    }
  }
}
CommentFileSizeAuthor
#2 2284131-domain-access-module.patch710 bytesRavindraSingh

Comments

RavindraSingh’s picture

Yes, @jisuo. Definitely, I will add this as an Feature by you.
Good Job, if you would interested to develop other modules with me please let me know.

RavindraSingh’s picture

StatusFileSize
new710 bytes

Fixed the issue and creating a patch

diff --git a/boost_cache_cleaner.module b/boost_cache_cleaner.module
index f048c7f..305b058 100644
--- a/boost_cache_cleaner.module
+++ b/boost_cache_cleaner.module
@@ -162,6 +162,16 @@ function boost_cache_cleaner_theme_settings_submit($form, &$form_state) {

 function boost_cache_cleaner_callback() {
   // Check if user has access to this function.
   if (!user_is_anonymous()) {
-    boost_flush_caches();
+    if (module_exists('domain')) {
+      global $base_root;
+      foreach (domain_domains() as $domain) {
+        if (isset($domain['path'])) {
+          $base_root = $domain['path'];
+          boost_flush_caches();
+        }
+      }
+    } else {
+      boost_flush_caches();
+    }
   }
 }
RavindraSingh’s picture

Status: Active » Needs review

  • RavindraSingh committed 82195b6 on 7.x-3.x
    Issue #2284131 by RavindraSingh, jisuo: Support for Domain Access module
    
RavindraSingh’s picture

Assigned: Unassigned » RavindraSingh
Status: Needs review » Patch (to be ported)
RavindraSingh’s picture

Status: Patch (to be ported) » Fixed
RavindraSingh’s picture

I have committed the patch and released dev. Thanks for suggesting.

Status: Fixed » Closed (fixed)

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