Hi,
I've prepared a patch which adds this new features :
- New mode "enable" to automatically enable selected development modules.
- $conf['warnme_mode'] in settings.php which makes it possible to overwrite warnme_mode for different sites. so there will be no need to change it via admin interface whenever we're downloading or uploading the site. for example when developers import online database all the development module become enabled automatically.

Please have a look and let me know your opinion.
BTW : Thanks for sharing this module.

Comments

sinasalek’s picture

StatusFileSize
new4.11 KB

Some improvment

lyricnz’s picture

These seem like good ideas. Please provide the second version as a patch for review. Thanks!

lyricnz’s picture

StatusFileSize
new1.67 KB

Hi sinasalek. I don't understand why new code is needed to:

$conf['warnme_mode'] in settings.php which makes it possible to overwrite warnme_mode for different sites. so there will be no need to change it via admin interface whenever we're downloading or uploading the site. for example when developers import online database all the development module become enabled automatically.

That behaviour will naturally happen if you add settings to $conf and use variable_get() to check for it.

Also, I've simplified the conditional logic a little, removed tab characters per coding standards, etc. Please review.

lyricnz’s picture

StatusFileSize
new1.84 KB
sinasalek’s picture

Thanks lyricnz, i don't see where $mode comes from in the last patch. I used the following code to set $mode

function warnme_init() {
  global $conf;
  if (isset($conf['warnme_mode'])) {
  	  $mode = $conf['warnme_mode'];
  } else {
  	  $mode = variable_get('warnme_mode', 'warn');
  }

According to your previous comment something like this should also work ?

function warnme_init() {
    $mode = variable_get('warnme_mode', 'warn');
lyricnz’s picture

sinasalek: the reason that you don't see the line that sets $mode in the patch is that the existing code, which does:

function warnme_init() {
  $mode = variable_get('warnme_mode', 'warn');
  if (!user_access('administer site configuration') || $mode == 'ignore') {
    return;
  }
  ...

hasn't changed, so isn't included in the patch.

sinasalek’s picture

I update my installation to the latest dev and applied #4. I can confirm that it words. Thanks

lyricnz’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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