Closed (duplicate)
Project:
Drupal core
Version:
7.x-dev
Component:
dashboard.module
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Oct 2013 at 09:48 UTC
Updated:
23 Jun 2015 at 17:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
crystaldawn commentedI can confirm that this is a pretty serious bug that has 3 reproduction methods. ALL of them have something to do with the fact that UNDERSCORE is either in the name of the module OR in the name of the block machine name. I have created reproduction modules for EVERY method of seeing this bug in action. I have also created a module that does NOT trigger the bug and it works perfectly. Unfortunetly I do not have the time to figure out all of this weirdness as creating the reproduction modules themselves and figure all of this out ate up all of my time I had available to track down this bug.
I have marked this as CRITICAL because it results in Database corruption of the blocks table. I have also updated the title since the original poster's server language was something other than english, so I've also updated it to english to make it more clear and easier to search for this bug in the queue.
If this is a duplicate bug of some other issue, mark it as such and leave out any flame comments as they are not necessary.
Reproduction of the original poster's error: This can be reproduced using my test module called "betastats". This error shows up under 2 circumstances.
1. The module name MUST NOT have any underscores in it's name
2. The block machine name MUST contain an underscore. Without these 2 criteria, you will not see the error but you will observe the DB corruption when you start seeing "Empty" blocks all over the dashboard.
The reproduction of this bug for all of these modules is exactly the same.
1. enable the module
2. Go to the dashboard
3. Click "Customize"
4. Move the module's block from sidebar to main content area
5. Click save
6. Observe either the error of the original poster, OR an empty block showing up in content area. In ALL cases, the block does NOT move from the sidebar except with the "deltastats" module I provide as a working example.
What is in my attachment called reproduction_modules.tgz
This file contains 3 modules. The first 2 are infected with different ways of reproducing this UNDERSCORE bug. The 3rd module (deltastats) shows how to WORK AROUND this bug until a proper fix can be devised. I cant provide a patch to fix this right now because of time limitations, but this module should help others get their own module blocks functioning since A LOT of modules are affected by this bug. Some will be able to implement the fix, others will not because of underscores in the module files themselves which is another good reason why this is a critical bug as it's work around requires changes that existing popular modules simply cannot do such as change the filename of their module.
alpha_stats.module:
What does this module show?
Using the 6 steps above with this module's block will result in the following:
The module will NOT produce an error, but you will see the data corruption in the block table where dashboard.module is replacing the _ with a - which is incorrect. These bad entries ARE NOT removed even after uninstall of the module like they should be. Since it is now corrupted, the entries have to be removed by hand. The entries duplicate themselves every time you click "Save" at step 5 resulting in all kinds of badness. No amount of changing the underscore for the block machine name will produce an error or change the behavior. Why? Because the module name has an underscore as well which is causing the error to be suppressed somewhere.
betastats.module:
What does this module show?
Using the 6 steps above with this module's block will result in the following:
The module WILL produce an error AND you will see the data corruption in the block table where dashboard.module is replacing the _ with a - which is incorrect. These bad entries ARE NOT removed even after uninstall of the module like they should be. Since it is now corrupted, the entries have to be removed by hand. The entries duplicate themselves every time you click "Save" at step 5 resulting in all kinds of badness. Unlike alpha_stats module, changing the underscore in the machine name for the block WILL fix this problem and essentially turns it into "deltastats" module which works perfectly. This proves that underscore is a problem not only in the machine name of the module, but also the name of the module itself.
deltastats.module
What does this module show?
Using the 6 steps above with this module's block will result in the following:
The module WILL NOT produce any errors nor will it produce any DB Corruption issues. This module is almost identical to betastats other than name and the fact that the underscore in the blocks machine name has been removed. This module works perfectly and can be used as a template of how to work around this dangerous bug.
Comment #2
cilefen commentedI confirmed in 7.x-dev what was described in #1. Thank you for the test modules!
Comment #3
David_Rothstein commentedI'm pretty sure this is a duplicate of #936798: Dashboard uses unreliable method for identifying blocks. - reopen if I'm mistaken. We should probably raise the priority of that issue a bit though.