Options

Why validation of tinyint be boolean?

nukboonnukboon New
edited September 2012 in Vanilla 2.0 - 2.8

Annouce Field type in GDN_Discussion Table is tinyint data-type and can be insert 0,1,2 value into
but now tinyint validation be boolean cause i can't insert '2' (int) value (by my plugin)

my code (plugin)

function DiscussionModel_BeforeSaveDiscussion_Handler .....
    ....
    $Args['FormPostValues']['Announce'] = 2;

in library/core/class.validation.php

// Force other constraints based on field type.
    switch($Properties->Type) {
        case 'tinyint':
        case 'bit':
        case 'bool':
        case 'boolean':
                    $RuleNames[] = 'Boolean';
        break;

Comments

Sign In or Register to comment.