@@ -1873,22 +1873,26 @@ protected function getParameters($settings) {
1873
1873
if ($ tenancy_function ) $ this ->applyTenancyFunction ($ tenancy_function ,$ action ,$ database ,$ fields ,$ filters );
1874
1874
if ($ column_authorizer ) $ this ->applyColumnAuthorizer ($ column_authorizer ,$ action ,$ database ,$ fields );
1875
1875
1876
+ // input
1876
1877
$ multi = strpos ($ key [0 ],', ' )!==false ;
1877
1878
$ inputs = array ();
1879
+ $ contexts = array ();
1878
1880
if (strlen ($ post )) {
1879
- // input
1880
1881
$ multi = $ post [0 ]=='[ ' ;
1881
1882
$ contexts = $ this ->retrieveInputs ($ post );
1882
- foreach ($ contexts as $ context ) {
1883
- $ input = $ this ->filterInputByFields ($ context ,$ fields [$ tables [0 ]]);
1883
+ }
1884
+ if ($ before ) {
1885
+ $ this ->applyBeforeHandler ($ action ,$ database ,$ tables [0 ],$ key [0 ],$ before ,$ contexts );
1886
+ }
1887
+ foreach ($ contexts as $ context ) {
1888
+ $ input = $ this ->filterInputByFields ($ context ,$ fields [$ tables [0 ]]);
1884
1889
1885
- if ($ tenancy_function ) $ this ->applyInputTenancy ($ tenancy_function ,$ action ,$ database ,$ tables [0 ],$ input ,$ fields [$ tables [0 ]]);
1886
- if ($ input_sanitizer ) $ this ->applyInputSanitizer ($ input_sanitizer ,$ action ,$ database ,$ tables [0 ],$ input ,$ fields [$ tables [0 ]]);
1887
- if ($ input_validator ) $ this ->applyInputValidator ($ input_validator ,$ action ,$ database ,$ tables [0 ],$ input ,$ fields [$ tables [0 ]],$ context );
1890
+ if ($ tenancy_function ) $ this ->applyInputTenancy ($ tenancy_function ,$ action ,$ database ,$ tables [0 ],$ input ,$ fields [$ tables [0 ]]);
1891
+ if ($ input_sanitizer ) $ this ->applyInputSanitizer ($ input_sanitizer ,$ action ,$ database ,$ tables [0 ],$ input ,$ fields [$ tables [0 ]]);
1892
+ if ($ input_validator ) $ this ->applyInputValidator ($ input_validator ,$ action ,$ database ,$ tables [0 ],$ input ,$ fields [$ tables [0 ]],$ context );
1888
1893
1889
- $ this ->convertInputs ($ input ,$ fields [$ tables [0 ]]);
1890
- $ inputs [] = $ input ;
1891
- }
1894
+ $ this ->convertInputs ($ input ,$ fields [$ tables [0 ]]);
1895
+ $ inputs [] = $ input ;
1892
1896
}
1893
1897
1894
1898
return compact ('action ' ,'database ' ,'tables ' ,'key ' ,'page ' ,'filters ' ,'fields ' ,'orderings ' ,'transform ' ,'multi ' ,'inputs ' ,'collect ' ,'select ' ,'before ' ,'after ' );
0 commit comments