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.
| Attachment | Size |
|---|---|
| Voila_Capture_20.png | 25.34 KB |

#1
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.
#2
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
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:
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
The resource limits for my test site are the following:
max_execution_time = 45max_input_time = 60
memory_limit = 64M
#5
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':
So we're left with only 'flag_actions.module' installed.
#6
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
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
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.
#9
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
Patch fixed the problem - now I can test the Rules integration :)
#11
Actually, I was able to install flags, but I didn't get the missing translation_helpers message.
#12
Updating the version information to reflect that this is a problem in rc1 as well as the dev build.
#13
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
Automatically closed -- issue fixed for 2 weeks with no activity.