1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Lack of Interest Some suggestions for XenForo_DataWriter::_applyFieldValueLimits

Discussion in 'Closed Suggestions' started by ragtek, Jul 19, 2012.

  1. ragtek

    ragtek Guest

    It would be really nice and useful if there would be a better errormessage in the method, instead of only returning the please_enter_valid_value phrase, which makes debugging without an real debugger a pain:p


    My quick and dirty fix:
    I've added $fieldName as additional paramter to _applyFieldValueLimits and changed

    PHP:
    if (isset($extraLimits['allowedValues']) && is_array($extraLimits['allowedValues']) && !in_array($value$extraLimits['allowedValues']))
    {
    return new 
    XenForo_Phrase('please_enter_valid_value');
    }
    to
    PHP:
    if (isset($extraLimits['allowedValues']) && is_array($extraLimits['allowedValues']) && !in_array($value$extraLimits['allowedValues']))
    {
    return new 
    XenForo_Phrase('please_enter_valid_value') . ' for ' .get_called_class() .' field ' $fieldName;
    }
    now it's returning




    instead of


    Which makes debugging A LOT EASIER!
     
    Bob and Darkimmortal like this.
  2. HWS

    HWS Well-Known Member

    YES, please. I support this. I also wrote a quick fix to solve this issue and spare much time debugging issues.
     

Share This Page