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

Data too long for column 'stats_type' incredibly difficult to track down.

Xon

Well-known member
#1
State_type column is 25 characters (which is generally a content type + action combination) however most content_type columns are 25 characters. This is very easy for an add-on to not correctly use.

It is very difficult to determine what is failing, as there is no reporting or checking to validate this column length and to report which row would fail to insert.

XF\Repository\Stats::build loops over the output of getStatsHandlers and just blindly inserts the resulting data. A simple length check would be enough to track down which add-on/custom code is triggering the data too long SQL exception.