After updating my website, a seemingly random message began popping up after cache clears and cron runs.

# activity features are being excluded because some needed modules are not enabled.

At first I had no idea what it was and no context to try to identify it in. Greps failed because of use of the t() function. Better user interface would have saved some time.

Comments

jonskulski’s picture

StatusFileSize
new864 bytes

Here is a very tiny patch. We should talk tomorrow or monday on a better way to approach this maybe :)

kosmikko’s picture

I think this nagging should be moved somewhere else, now it's displayed too often. For example when saving the modules page.

merlinofchaos’s picture

Also, this nagging is displayed to non administrative users, which is totally wrong.

I would suggest, if you really want to display something, put a REQUIREMENTS_WARNING in hook_requirements so that it will show up on the status page.

merlinofchaos’s picture

Oh and in the current download, the parentheses on the t() are wrong which causes a general warning.

ckng’s picture

Status: Active » Needs review
StatusFileSize
new2.4 KB

Attached patch moves the message to total_control_admin_settings(), which only user with permission 'administer total control' can access.

Perhaps could use markup instead of set message also.

jonskulski’s picture

Status: Needs review » Needs work

I like using 'administer total control' to control who can view this message. ITs a good approach.

Feedback on the patch:

  1. the if statement can totally go. if (true) { continue; } is not meaningful and just eats up some CPU
  2. let's be smarter about how we check what is missing. I don't there is any reason to loop through the directory of view default files to see what modules are not needed. Simple if (!module_exists(...)) { } should suffice
  3. perhaps we want this on the total control panel edit page as well.
  4. May want a 'hide this message' functionality since I personally don't want the statistics module on, but dont want to see the message
  5. drupal_set_message is the way to go, not markup
  6. The text on the warning needs to be clearer
jenlampton’s picture

I took the nag out of the dev version. I'm working on adding module-related features more gracefully in the 2.x branch.

Will add the nag back in here if this patch gets rewritten :)

lipcpro’s picture

I downloaded the dev version and I'm still getting the message

jenlampton’s picture

Ok, I now actually committed the nag-less version.

Sorry about that. :/

drupalninja99’s picture

Version: 6.x-1.1 » 6.x-1.2

I still see this in 1.2, I ended up just enabling the statistics module so I wouldnt have to see it anymore

/**
 * Implementation of hook_views_default_views().
 */
function total_control_views_default_views() {
  $files = file_scan_directory(drupal_get_path('module', 'total_control'). '/views', '.view');
  foreach ($files as $filepath => $file) {
    require $filepath;
    
    // test for statistics module
    if (   ($file->name == 'control_activity' && !module_exists('statistics')) 
        || ($file->name == 'control_comments' && !module_exists('comment'))
        || ($file->name == 'control_terms' && !module_exists('taxonomy')) ){
      drupal_set_message(t('!feature features are being excluded because some needed modules are not enabled.', array('!feature' => substr($file->name,8))));
    }
    else {
      if (isset($view)) {
        $views[$view->name] = $view;
      }
    }
    
  }
  return $views;
}
clkeenan’s picture

I hate to sound completely clueless, but what do I need to do to fix this problem? As in, why is this message appearing?

shotokai’s picture

@CLKeenen
You can either apply the patch in #6 above, or switch over to the dev version of the module.

gr33nman’s picture

This nag feature would be more useful if it had a link that takes you to a report that shows you what modules need to be enabled - or disabled - to remove the nag screen.

jenlampton’s picture

Status: Needs work » Needs review
StatusFileSize
new6.74 KB

Alright, I've removed the nag and add a requirements check that just suggests other features might be hidden without these modules.

jenlampton’s picture

rerolled against latest dev. removed dpm. :)

jenlampton’s picture

Status: Needs review » Fixed

this fix is committed to -dev and will be included in the next release.

Status: Fixed » Closed (fixed)

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