Problem/Motivation

There is no indication in the logs when the module is activated or inactivated.

Proposed resolution

Add watchdog entry when the module is activated and inactivated.

Remaining tasks

  1. Fix the issue
  2. Create a patch
  3. Review the patch
  4. Commit the patch

User interface changes

None.

API changes

None.

Data model changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

oadaeh created an issue. See original summary.

oadaeh’s picture

Assigned: Unassigned » oadaeh
oadaeh’s picture

Assigned: oadaeh » Unassigned
Issue summary: View changes
Status: Active » Needs review
FileSize
854 bytes

The attached patch addresses this issue.

Kristen Pol’s picture

+++ b/email_verify.admin.inc
@@ -119,14 +119,21 @@ function email_verify_admin_settings($form, &$form_state) {
 
 /**
  * Form submit function.
+ *
+ * This runs the module verification check, if activating, and logs whether the
+ * module was activated or inactivated.
  */
 function email_verify_admin_settings_submit($form, &$form_state) {
   // Enable/disable mail sending subsystem.
   if ($form_state['values']['email_verify_active']) {
     if (!email_verify_activated()) {
       email_verify_enable_module();
+      watchdog('email_verify', 'The Email Verify module was activated.');
     }
   }
+  elseif (email_verify_activated()) {
+    watchdog('email_verify', 'The Email Verify module was inactivated.');
+  }
 }

I'm confused as to why this is here. How can the module be disabled if we are submitting its settings form?

oadaeh’s picture

It's not that the module is disabled, it's that it's inactivated. Both the PHPMailer and SMTP Authentication Support modules use a similar concept.

It's an extra step in using the module. Previously, when the module was enabled on the modules page, it would go through a process of checking to see if it could work on the site it was installed on. Sometimes while doing that, it would cause the page to timeout and information to be lost and modules to be left in a weird state. I added this activation step on and moved the capability checks to the configuration page to minimize the likelihood of that happening.

I see I need to change the name of the email_verify_enable_module() function, as that name isn't correct. It should be something more like email_verify_test_capability().

oadaeh’s picture

Issue summary: View changes
Patrick Storey’s picture

Status: Needs review » Reviewed & tested by the community

Testing the patch in comment #3, prior to adding the patch there were no watchdog entries for the module being activated or inactivated at /admin/config/system/email_verify.

After adding the patch, there were watchdog entries for the module being activated and inactivated.

This has passed testing.

  • oadaeh committed db0586f on 7.x-2.x
    Issue #2669256 by oadaeh, Kristen Pol, Patrick Storey: Add watchdog...
oadaeh’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Fixed

This has been committed to the 2.x dev branch. Thanks for the reviews and testing.

Kristen Pol’s picture

Thanks!

oadaeh’s picture

Status: Fixed » Closed (fixed)

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