Lack of interest Some suggestions for XenForo_DataWriter::_applyFieldValueLimits

  • Thread starter Thread starter ragtek
  • Start date Start date
This suggestion has been closed automatically because it did not receive enough votes over an extended period of time. If you wish to see this, please search for an open suggestion and, if you don't find any, post a new one.
R

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



Error
Please enter a valid value. for field blog_type


instead of

Error
Please enter a valid value.


Which makes debugging A LOT EASIER!
 
Upvote 2
This suggestion has been closed. Votes are no longer accepted.
YES, please. I support this. I also wrote a quick fix to solve this issue and spare much time debugging issues.
 
Top Bottom