After installing the schema module and checking the report, I saw these mismatches regarding the core search module:
* search_dataset
- column type - difference on: length
declared: array('description' => t('TODO: please describe this field!'), 'type' => 'varchar', 'length' => 16, 'not null' => FALSE)
actual: array('description' => t('TODO: please describe this field!'), 'type' => 'varchar', 'length' => '64', 'not null' => FALSE)
* search_index
- column type - difference on: length
declared: array('description' => t('TODO: please describe this field!'), 'type' => 'varchar', 'length' => 16, 'not null' => FALSE)
actual: array('description' => t('TODO: please describe this field!'), 'type' => 'varchar', 'length' => '64', 'not null' => FALSE)
* search_node_links
- column type - difference on: length
declared: array('description' => t('TODO: please describe this field!'), 'type' => 'varchar', 'length' => 16, 'not null' => TRUE, 'default' => '')
actual: array('description' => t('TODO: please describe this field!'), 'type' => 'varchar', 'length' => '64', 'not null' => TRUE, 'default' => '')| Comment | File | Size | Author |
|---|---|---|---|
| #10 | schema_alter_fix.patch | 743 bytes | letapjar |
Comments
Comment #1
jhodgdonI have no idea why your search tables have lenght 64 on those tables. When I install the search module, the fields are length 16. Have you modified them manually, or perhaps used a contrbuted module that modified them?
Comment #2
klonosNope, haven't touched the module - I almost never do that with core unless it is really-really-really necessary to. I have only applied the patch from post #146 in #269877: path_set_alias() doesn't account for same alias in different languages, but that doesn't touch search.module at all or the db, only path.module is modified. Please, take a look for yourself, it's just a 5-or-so liner: http://drupal.org/files/issues/path-module_269877-D6_1.patch
As for any contrib module messin' where it shouldn't... how could I figure out which one it could be. I cannot start by disabling all + uninstalling them and start over, since I am on a live site. Would I know by looking at their .install files or is this done during run-time? Is there any string I can search for in the modules' files?
I honestly want to help track this one down, but my list of modules is huge. I can provide a list of modules and their respective versions, but I don't like to pollute the issue with long posts. Perhaps I'll dump it in a .txt file and upload. Let me know if that would help.
Let me also add that this issue doesn't have any other quirks than that error in the site's status report. I haven't enabled search in my site yet, so I cannot know if/what it will cause. I am simply reporting it because earlier experience has shown that problems not dealt with in time come back to bite you later on. So I'll 'downgrade' this issue to minor till someone reports real problems caused by it. Please do guide me in troubleshooting this further though.
Thanx in advance.
Comment #3
jhodgdonIt would likely be in a contributed module's .install file, actually in the function [module_name]_enable() or [module_name]_install(). It could be done during run time...
I would look first at any module that you've installed that is related in any way to searching, since I cannot imagine why a non-search-related module would want to change the search tables. And the module would have the strings {search_dataset}, {search_index}, and {search_node_links} in it somewhere. So if you know how to use grep, you could grep through your sites/all/modules directory for those strings.
And since I am pretty sure this isn't a core Drupal bug, I am changing it to a support request. I'll be interested to see what you find out though!
Comment #4
klonosGot it! Its the Data module:
taking it there...
Comment #5
klonosComing from the core search.module...
In data_search.install lines 12, 13 &14:
alter the respective fields' lengths from 16 to 64. Is this necessary?
Schema module reports table mismatches. Please take a look at #0
Comment #6
alex_b commentedThis is the reason:
To avoid schema module complaining, we should also alter the schema information about the respective search tables. For the record though, the mismatch does not cause any actual problems.
Comment #7
klonosThanx for taking the time alex. I kinda knew no actual problems were caused. That's why it's set to 'minor' ;)
Comment #8
letapjar commentedThis should really be fixed - altering a core module's table without properly updating the schema is not a friendly way to do things.
Non-programmers who install data_search module (which requires the core search module) will constantly get a warning message about schema inconsistencies - this causes drupal admins to waste time tracking
down an issue due to bad programming practice.
at the very least this should be an issue to be fixed before a beta version is released.
Comment #9
danoprey commentedI have the exact same problem outlined above. How do I edit the schema to make the error message go away? It's fine that it causes no problems but I have to hand the site over to someone else, ideally error (message) free!
Comment #10
letapjar commentedTry the following patch - it simply implements hook_schema_alter within the data_search module.
note - this will solve the problem of the error message - but there is another larger issue about the fact that if someone installs data_search and later uninstalls the module - the core tables for search module are now mis-matched to their schema.
to apply the patch simply copy the file to your 'sites/all/modules/data' folder and then in your shell
change to that directory and type patch -p0 < schema_alter_fix.patch
I was able to eliminate the error message on a clean drupal install where the error message popped up after generating 50 pages of content with devel.
Comment #11
klonosI'll test this on first chance, but I trust your experience anyways so I believe it'll simply work ;)
...concerning this:
I wouldn't know code-wise, but how about undoing the changes during module uninstallation then. I am not talking about when simply disabling the module, but rather when offering an uninstallation option in the 'uninstall' tab (I think it has to do with hook_uninstall()).
Comment #12
letapjar commentedI don't know much about this module - but if content longer than the original 16 characters was stored in the search_dataset or search_index or search_node_links tables - then changing the field length back to 16 on uninstall might cause problems - at the very least data would be truncated. I think this is something for the original module developers to work out.
Comment #13
joachim commented> if content longer than the original 16 characters was stored in the search_dataset or search_index
Logically, anything that does not depend on Data module (and its alteration of the column length) would have had its data truncated to 16 characters on insert if Data module wasn't there anyway. So it would be a bug in that module, and getting it truncated when Data is uninstalled is just delaying the inevitable ;)
Setting to needs work as we need a hook_uninstall() too as pointed out above.