crudkit icon indicating copy to clipboard operation
crudkit copied to clipboard

Warning: Missing argument 1 for CrudKit\Pages\BasicLoginPage::preprocess()

Open stfnsch opened this issue 9 years ago • 5 comments

When visiting the page, I get this PHP warning:

Warning: Missing argument 1 for CrudKit\Pages\BasicLoginPage::preprocess(), called in \vendor\skyronic\crudkit\src\CrudKit\CrudKitApp.php on line 51 and defined in \vendor\skyronic\crudkit\src\CrudKit\Pages\BasicLoginPage.php on line 67

In CrudKitApp.php, there is this function call of preprocess() without arguments, see line 51:

48     protected $login = null;
49     public function useLogin ($login) {
50         $this->login = $login;
51         $login->preprocess ();
52         if (!$login->check ()) {
53             $this->addPage ($login);
54             $this->render ();
55         }
56     }

File BasicLoginPage.php has got a function preprocess, but takes one argument $app, see line 67:

67  public function preprocess ($app) {
68      if ($this->url->get ('__ckLogout', false) !== false) {
69          $this->doLogout ();
70      }
71  }

stfnsch avatar Apr 12 '16 10:04 stfnsch

Same here.

It shows up when going into the login page.

fncapps avatar Apr 12 '16 10:04 fncapps

I deleted $app argument in BasicLoginPage.php as it seems that it is not used at all

mpriereira avatar Apr 13 '16 11:04 mpriereira

Yes, also using something like $login->preprocess ($this); works as a workaround.

stfnsch avatar Apr 13 '16 13:04 stfnsch

I encounter the same error.. which one should work well?

jaeturma avatar Apr 27 '16 02:04 jaeturma

I removed the $app argument from the /vendor/skyronic/crudkit/src/CrudKit/Pages/BasicLoginPage.php, and the page rendered properly. Seems like a bug.

jamespsterling avatar May 05 '16 14:05 jamespsterling