I am using Schema and Schema views because I want to ensure that everything going into my database is clean as possible. I don't know that I have need of this module, but conceive that it may be useful, so I added it in.
In domain_blocks.install there is the following line in function domain_blocks_schema():
'delta' => array('type' => 'varchar', 'length' => '32', 'not null' => TRUE, 'default' => 0),
This causes admin/reports/status to show 1 warning in the Database schema section of the report. The warning is:
domain_blocks.delta is type varchar but its default 0 is PHP type integer
The error is corrected by changing the offending line to:
'delta' => array('type' => 'varchar', 'length' => '32', 'not null' => TRUE, 'default' => '0'),
Now I notice in the module file some code is looking at delta as a bool. I went to the PHP documentation to verify, and the text '0' is treated as false just as the int value of 0 is.
http://php.net/manual/en/language.types.boolean.php under Converting to boolean shows this to be the case.
If the default value of '0' is only meant to be used as a boolean FALSE, this should work without causing any other problems in the code.
However, I am not certain that this code change may not cause other problems, although my inclination is to think that it will not. I have never used git to create a patch, but am planning on trying to do so -- this will be my first patch to Drupal if I can figure it out, and I'd like to try to do this. If someone else beats me to it, oh well. If I do submit this patch, please make sure I have not done something wrong. I will try and be very thorough, but I am a rank neophyte at this...
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | domain_blocks-type-mismatch-1964638-2.patch | 772 bytes | clearbrook |
Comments
Comment #1
clearbrook commentedI think I am ready to upload a patch now...
;'{P~~~
Comment #2
clearbrook commentedOk this took me a while to fumble through the instructions on http://drupal.org/node/707484, but I am uploading a patch (hopefully done correctly) now...
Comment #3
clearbrook commentedThat was kind of fun, BTW...
Comment #4
nonsieDid you look at #1094588: Status report say: domain_blocks.domain_id is type int but its default 0 is PHP type string ? It does the same thing.
What is missing is an update hook for sites that have Domain Blocks already installed and need integer converted to a string.
Comment #5
clearbrook commentedWell, I guess I should try to do that, unless you are already fixing that. I did not think about the fact that and there are others more qualified who might be able to do this more quickly. I'll look at what they are doing and point them back here. And if I can figure it out, I will. My patch only works for initial installs and that is only half a fix. That dawns on me now...
LOL. Well, first try at patching was likely to miss something. Just did not expect it to be something so obvious. Doh!
Comment #6
nonsieTry the latest code in 7.x-3.x-dev and let me know if that fixes the issue for you.
Comment #7
clearbrook commentedWill do. Thanks. If you don't hear back, you should assume that it works just fine, at least for issues I am aware of.
Comment #8
nonsie