Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DebugBar Routes Collector throws ErrorException when optional parameter is not passed to controller #762

Closed
gustavojm opened this issue Oct 9, 2017 · 1 comment

Comments

@gustavojm
Copy link
Contributor

Calling a controller method:

public function edit($id = NULL) {

without specifying the optional parameter $id like in http://localsite/admin/article/edit

throws ErrorException with the white screen of death if the debug bar is active.

The same error was reported in the forum by user qury
https://forum.codeigniter.com/thread-67555.html

This is what I've been able to debug so far...

Undefined offset: 0 in
BASEPATH/Debug/Toolbar/Collectors/Routes.php line 99

var_dump($rawParams);
array(1) {
  [0]=>  object(ReflectionParameter)#308 (1) {
  ["name"]=>  string(2) "id" }
}

var_dump($router->params());
array(0)

@lonnieezell
Copy link
Member

How is your route defined?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants