Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It's a bug when comments contradict code. Fortunately, the code is correct.
In Drupal\system\Tests\Database\SchemaTest::testSchemaAddField(), a comment declares "Precision must be smaller than scale." because that's what the code is checking for. Of course, the opposite is true, and just reading that is confusing.
Comment | File | Size | Author |
---|---|---|---|
#2 | 2449147-SchemaTest-comment-fix.2.patch | 649 bytes | Island Usurper |
SchemaTest-comment-fix.patch | 629 bytes | Island Usurper | |
Comments
Comment #1
jhodgdonDoh! Good catch. I don't think I am quite happy with the patch though. Really what that little block of code is doing is skipping combinations that come up in the loop, where the precision would be smaller than the scale. Can we change the comment to include the word "skip" or "skipping", rather than just saying "must be"?
Also, as a note, it should be "than" not "then".
Comment #2
Island Usurper CreditAttribution: Island Usurper commentedThose are good points. How about saying it like this? Part of me wants to say something like "because it's in the standards" or "because it's impossible", but that may not be necessary.
Comment #3
Island Usurper CreditAttribution: Island Usurper commentedComment #4
jhodgdonThanks! Much better.
BETA: Small docs comment fix, allowed.
Comment #5
alexpottDocumentation is not frozen in beta. Committed f971c18 and pushed to 8.0.x. Thanks!