Skip to content

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

Description

@gustavojm

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions