@@ -1873,22 +1873,26 @@ protected function getParameters($settings) {
18731873 if ($ tenancy_function ) $ this ->applyTenancyFunction ($ tenancy_function ,$ action ,$ database ,$ fields ,$ filters );
18741874 if ($ column_authorizer ) $ this ->applyColumnAuthorizer ($ column_authorizer ,$ action ,$ database ,$ fields );
18751875
1876+ // input
18761877 $ multi = strpos ($ key [0 ],', ' )!==false ;
18771878 $ inputs = array ();
1879+ $ contexts = array ();
18781880 if (strlen ($ post )) {
1879- // input
18801881 $ multi = $ post [0 ]=='[ ' ;
18811882 $ 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 ]]);
18841889
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 );
18881893
1889- $ this ->convertInputs ($ input ,$ fields [$ tables [0 ]]);
1890- $ inputs [] = $ input ;
1891- }
1894+ $ this ->convertInputs ($ input ,$ fields [$ tables [0 ]]);
1895+ $ inputs [] = $ input ;
18921896 }
18931897
18941898 return compact ('action ' ,'database ' ,'tables ' ,'key ' ,'page ' ,'filters ' ,'fields ' ,'orderings ' ,'transform ' ,'multi ' ,'inputs ' ,'collect ' ,'select ' ,'before ' ,'after ' );
0 commit comments