Module becomes disabled after installing it

kiamlaluno - March 1, 2009 - 15:25
Project:Flag
Version:6.x-1.0-rc1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

I installed the project files, and enabled both the modules; after I click on the Save button in the modules page, Flag is reported to be disable, and Flag actions is reported to be enabled (see the attached screenshot).
I also installed the optional module as suggested by Flag, but that doesn't change anything.

I am not sure if this is someway related, but when I activated the module, it showed an error message saying that the other module should be necessary if I wanted to have automatic translations (I am not sure I remember the message exactly).
I then disabled Flag actions, uninstalled it, and enabled them again. This time all works fine.

AttachmentSize
Voila_Capture_20.png25.34 KB

#1

kiamlaluno - March 2, 2009 - 23:57

To notice that the checkbox shown close to Flag is disabled; that means it's not even possible to select it.
It's strange that Flag is reported disabled while Flag actions (which depends on it) is shown enabled, but it's also strange that the checkbox is shown disabled.

After I installed Translation helpers, disabled (and uninstalled Flag actions), I got all working (like is clear in the screenshot attached to this comment).
It's evident the difference between a disabled checkbox, and an enabled but not selected checkbox.

AttachmentSize
Voila_Capture_21.png 25.26 KB

#2

quicksketch - March 1, 2009 - 22:20

Hmm, this is all very odd. It's likely a problem in Drupal core, rather than Flag, since Flag just simply states its dependencies to core and trusts that it will handle it properly. I'm not able to reproduce this problem though. Could you provide step-by-step instructions on how to reproduce it?

#3

kiamlaluno - March 3, 2009 - 00:00

Could it be caused by the memory required during the installation of the module?

I installed it on my web site, and I got a WSD; apart that, when I visited the home page (that reported the message the module was successfully installed I was not able to see in the modules page), all was working well, including the module.
The PHP installed on my web site has a limit of 32 megabytes of memory.

What I reported before was the effect of the installation of the module in my test site I run on my Mac which has the memory limit set to 64 MB, or 128 MB.
The steps I followed are:

  • I copied the files on my test site.
  • I enabled both the modules, and clicked on the Save button; I noticed that there was a message telling me that, for an additional functionallity, it was required a third module (the message was an error message, the one that the theme I am using shows on a red background).
  • I noticed what is evident in the first screenshot I attached, and I thought it was because the third-party module was missing (I thought that also because the message given me first was not on a yellow background, that would mean it was a warning message).
  • I copied the optional module (Translation helpers), enabled; The checkbox close to Flag was still disabled.
  • I deselected Flag actions, selected it on the Uninstall tab, and clicked on the button to uninstall it (but I didn't delete the module files).
  • I re-selected the modules to re-enable them, and this time the checkboxes close to both the modules were selected.

As I had two different result from two different Drupal sites that have different memory limits for PHP, I think that this is caused by a high request of memory during the installation.
So far, the modules are working correctly, and until now I have not had any problems from then.

I can check the PHP memory limit for my test site, to be able to report exactly how much memory is reserved for PHP.

#4

kiamlaluno - March 3, 2009 - 00:01

The resource limits for my test site are the following:

max_execution_time = 45
max_input_time = 60
memory_limit = 64M

#5

mooffie - March 2, 2009 - 05:18

I can't run Drupal, so I can't verify this, but I have a guess as to what's happening here:

When one clicks the "Save" button on the modules page, the system_modules_submit() function kicks in. This function has the following suspicious code (the line-numbers are my own):

100.  // Install new modules.
101.  foreach ($new_modules as $key => $module) {
102.    if (!drupal_check_module($module)) {
103.      unset($new_modules[$key]);
104.    }
105.  }
106.  drupal_install_modules($new_modules);

Now, think what happens when we elect to install both 'flag.module' and 'flag_actions.module':

  1. We tick the two. We click 'Save'.
  2. We don't have 'translation_helpers.module' installed, so installation of 'flag.module' is cancelled (line #102, line #103).
  3. But installation of 'flag_actions.module' continues "as usuall" (line #106).

So we're left with only 'flag_actions.module' installed.

#6

kiamlaluno - March 2, 2009 - 13:53

That could make sense.
The problem is that, in the description Drupal shows for Flag, the module is not said to require Translations helpers; the description for Flag is simply:

Create customized flags that users can set on content.
Required by: Flag actions (enabled)

As you can notice, there isn't a line saying Requires: Translation Helpers.

#7

kiamlaluno - March 2, 2009 - 14:01

The (Change category) text that is visible in Voila_Capture_20.png is added from a module I am developing, which has simply the purpose of changing the category (package) assigned to the modules; it doesn't create interferences, as I tried by disabling it before to proceed with the installation of Flag, but the result didn't change.

#8

quicksketch - March 2, 2009 - 15:32

I think mooffie might be right. The dependency checker assumes that the Flag module was installed correctly when it installs Flag actions, resulting in Flag actions being enabled but Flag being disabled. Then as we know, the Flag module becomes impossible to enable until Flag actions has been disabled and re-enabled.

I'm thinking we should not prevent the install of Flag if translation helpers is missing, instead only throw a run-time error. Especially since Flag works perfectly fine without translation_helper until you start deleting translations anyway. Here's a patch that changes this error to runtime only.

AttachmentSize
flag_translation_check.patch 1.14 KB

#9

kiamlaluno - March 2, 2009 - 17:56

I understood now what mooffie was saying.
Flag checks if translation.module is enabled, and in that case it checks also if translation_helpers.module is enabled. In my case, the first module was enabled, and the second module was not even installed; therefore, Drupal set flag.module like disabled.

#10

Amitaibu - March 4, 2009 - 23:29
Status:active» reviewed & tested by the community

Patch fixed the problem - now I can test the Rules integration :)

#11

Amitaibu - March 4, 2009 - 23:30
Status:reviewed & tested by the community» needs work

Actually, I was able to install flags, but I didn't get the missing translation_helpers message.

#12

mtapman - March 8, 2009 - 15:09
Version:6.x-1.x-dev» 6.x-1.0-rc1

Updating the version information to reflect that this is a problem in rc1 as well as the dev build.

#13

quicksketch - March 10, 2009 - 05:47
Status:needs work» fixed

Actually, I was able to install flags, but I didn't get the missing translation_helpers message.

That's because it's no longer shown on install, it's only shown on the admin/reports/status page.

I went ahead and committed the current patch, if further changes are necessary please reopen.

#14

System Message - March 24, 2009 - 05:50
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.