Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext JS Premium Member
    Join Date
    Sep 2007
    Location
    CT
    Posts
    462
    Vote Rating
    2
    ValterBorges is on a distinguished road

      0  

    Default Ext 4.0.5 store.sync Presence zero value validation bug

    Ext 4.0.5 store.sync Presence zero value validation bug


    Situation:

    A record that has a model with a int type and gets set to zero will make the record.dirty = true.
    store.getUpdatedRecords() returns the updated record and everything is well.

    The presence function returns false because !!0 = false although there is a value present

    presence: function(config, value) {
    if (value === undefined) {
    value = config;
    }

    return !!value;
    //this should check if value !== 0 because zero is a valid and can be present
    },

    Now sure how this affects store from synching but it it's. It must be coded not to sync if validation fails.

  2. #2
    Sencha - Management Team abe.elias's Avatar
    Join Date
    Aug 2008
    Location
    Palo Alto, CA
    Posts
    405
    Vote Rating
    3
    abe.elias is on a distinguished road

      0  

    Default


    I know Ed fixed this. Let me find out why it didn't make it in.

  3. #3
    Sencha - Community Support Team edspencer's Avatar
    Join Date
    Jan 2009
    Location
    Palo Alto, California
    Posts
    1,939
    Vote Rating
    7
    edspencer is a jewel in the rough edspencer is a jewel in the rough edspencer is a jewel in the rough

      0  

    Default


    This was applied to the 4.1.0 branch. I've just cherry picked it back to 4.0.6 so it will be present in that release. In the mean time you can override it with this patch:

    Code:
    Ext.apply(Ext.data.validations, {
        presence: function(config, value) {
            if (value === undefined) {
                value = config;
            }
            
            //we need an additional check for zero here because zero is an acceptable form of present data
            return !!value || value === 0;
        },
        
        /**
         * Returns true if the given value is between the configured min and max values.
         * For example:
         *
         *     validations: [{type: 'length', field: 'name', min: 2}]
         *
         * @param {Object} config Config object
         * @param {String} value The value to validate
         * @return {Boolean} True if the value passes validation
         */
        length: function(config, value) {
            if (value === undefined || value === null) {
                return false;
            }
            
            var length = value.length,
                min    = config.min,
                max    = config.max;
            
            if ((min && length < min) || (max && length > max)) {
                return false;
            } else {
                return true;
            }
        }
    });
    Ext JS Senior Software Architect
    Personal Blog: http://edspencer.net
    Twitter: http://twitter.com/edspencer
    Github: http://github.com/edspencer

  4. #4
    Ext JS Premium Member
    Join Date
    Sep 2007
    Location
    CT
    Posts
    462
    Vote Rating
    2
    ValterBorges is on a distinguished road

      0  

    Default 4.0.6

    4.0.6


    When do you expect 4.0.6 to be out? 4.1.0?

  5. #5
    Sencha - Community Support Team edspencer's Avatar
    Join Date
    Jan 2009
    Location
    Palo Alto, California
    Posts
    1,939
    Vote Rating
    7
    edspencer is a jewel in the rough edspencer is a jewel in the rough edspencer is a jewel in the rough

      0  

    Default


    Typically patch releases are every 2-3 weeks though we might push this one out sooner
    Ext JS Senior Software Architect
    Personal Blog: http://edspencer.net
    Twitter: http://twitter.com/edspencer
    Github: http://github.com/edspencer

  6. #6
    Sencha User
    Join Date
    Jul 2011
    Posts
    1
    Vote Rating
    0
    Simon178 is on a distinguished road

      0  

    Default validate for presence of boolean values

    validate for presence of boolean values


    Hi there,

    it seems there is quite the same problem with boolean values and validation for presence.

    Suggestion:
    return !!value || value === 0 || value === false;
    or am i wrong?

    regard,
    Simon