I don't know if this patch is the correct logic, but it seems to fix the problem

Comments

pwolanin’s picture

Looks ok to me - guess mysql doesn't know how to cast empty string to float.

pwolanin’s picture

doesn't matter (PDO casts to string), but I might use '0' vs. 0

also, why LIKE '', versus = '' ?

dave reid’s picture

Yeah I'm not sure why the 'LIKE' condition is needed compared to a direct comparison.

sun’s picture

StatusFileSize
new845 bytes

How about this?

JacobSingh’s picture

As 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.

JacobSingh’s picture

Status: Needs review » Reviewed & tested by the community
sun’s picture

Status: Reviewed & tested by the community » Needs review

mmm... 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?

dries’s picture

quality 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.

sun’s picture

StatusFileSize
new1.01 KB

Really not sure whether there is a better way of doing this. But here's how it could work.

sun’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new1.5 KB

I 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.

sun’s picture

StatusFileSize
new1.51 KB

Another tweak for the description.

dries’s picture

Code 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.

sun’s picture

Status: Reviewed & tested by the community » Fixed

Thanks 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.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 25883e5 on master, fai6, 8.x-2.x, fbajs, actions by sun:
    #917216 by sun, JacobSingh, pwolanin: Fixed update for quality field...

  • Commit 25883e5 on master, fai6, 8.x-2.x, fbajs, actions by sun:
    #917216 by sun, JacobSingh, pwolanin: Fixed update for quality field...