@@ -1873,25 +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- if ($ before ) {
1883- $ this ->applyBeforeHandler ($ action ,$ database ,$ tables [0 ],$ key [0 ],$ before ,$ contexts );
1884- }
1885- foreach ($ contexts as $ context ) {
1886- $ 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 ]]);
18871889
1888- if ($ tenancy_function ) $ this ->applyInputTenancy ($ tenancy_function ,$ action ,$ database ,$ tables [0 ],$ input ,$ fields [$ tables [0 ]]);
1889- if ($ input_sanitizer ) $ this ->applyInputSanitizer ($ input_sanitizer ,$ action ,$ database ,$ tables [0 ],$ input ,$ fields [$ tables [0 ]]);
1890- 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 );
18911893
1892- $ this ->convertInputs ($ input ,$ fields [$ tables [0 ]]);
1893- $ inputs [] = $ input ;
1894- }
1894+ $ this ->convertInputs ($ input ,$ fields [$ tables [0 ]]);
1895+ $ inputs [] = $ input ;
18951896 }
18961897
18971898 return compact ('action ' ,'database ' ,'tables ' ,'key ' ,'page ' ,'filters ' ,'fields ' ,'orderings ' ,'transform ' ,'multi ' ,'inputs ' ,'collect ' ,'select ' ,'before ' ,'after ' );
0 commit comments