Patches ArrayDatasource by disabling fields-filtering, fixing broken results on hasMany/HABTM scenarios
Patches Array Datasource by disabling fields-filtering feature, since it was not behaving properly when querying hasMany/HABTM related models (see commit's source code for detailed explanation).
The reason for this patch lies on a strange behaviour in CakePHP 1.3.X's DBO Datasource (https://github.com/cakephp/cakephp/blob/1.3/cake/libs/model/datasources/dbo_source.php#L1230), where
$queryData['fields']is polluted with a fields list from the root model when querying itshasMany/HABTMrelationships, thus affecting all the following queries on related models (since$queryDatais passed by reference). This pollution affected the following bit of code in a way that, if nofieldsfor the current relationship were initially specified by the developer when executing afind(), it would unset ALL of them, giving almost blank results. Since trying to fully understand all the side effects that changing CakePHP's DBO Datasource would carry, and since field-filtering makes almost no sense in terms of optimization on Array Datasources (unlike in SQL), this patch consists in voiding field-filtering on Array Datasource's models.
Any experience on this scenario, anyone?