Closed (fixed)
Project:
Mollom
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Sep 2010 at 16:50 UTC
Updated:
24 Apr 2014 at 17:13 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
pwolanin commentedLooks ok to me - guess mysql doesn't know how to cast empty string to float.
Comment #2
pwolanin commenteddoesn't matter (PDO casts to string), but I might use '0' vs. 0
also, why LIKE '', versus = '' ?
Comment #3
dave reidYeah I'm not sure why the 'LIKE' condition is needed compared to a direct comparison.
Comment #4
sunHow about this?
Comment #5
JacobSingh commentedAs long as the 0 is the correct value. I don't know why/when that field got empty values, but if that translates to zero in the new schema then good.
Comment #6
JacobSingh commentedComment #7
sunmmm... actually, that's a very good point. We want the resulting value to become NULL instead. Real 'quality' values are ranging from 0 to 1. So I wonder whether we can temporarily update to a 2 or 9 for empty strings, and after converting to float, set those rows to NULL. Hrm. Any better ideas?
Comment #8
dries commentedquality is in an alpha/beta thing so we can reset those values to 0 if that is easier. None of the module code actually uses the value.
Comment #9
sunReally not sure whether there is a better way of doing this. But here's how it could work.
Comment #10
sunI have manually installed alpha1, created some form protections and imported some {mollom} data, and all updates ran fine with this patch and led to the expected values. While doing so, I realized that update.php also displays the phpDoc description of an update... so I additionally tweaked that description a bit.
Comment #11
sunAnother tweak for the description.
Comment #12
dries commentedCode looks good but not in a position to test it right now. Sun can commit the patch if it is properly tested.
I'd also be happy to drop the quality column for the time being.
Comment #13
sunThanks for reporting, reviewing, and testing! Committed to HEAD.
A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.