Skip to content

PHP Notice: Undefined index: Role in AppController.php on line 36 #176

@pbhenson

Description

@pbhenson

We get a lot of these in our log files:

1: [:error] [pid 28452] [client 64.114.207.67:9798] PHP Notice:  Undefined i

ndex: Role in
/var/www/localhost/htdocs/guide_on_the_side/app/Controller/AppController.php on
line 36, referer:
http://gots.library.cpp.edu/guide_on_the_side/tutorial/document-delivery
1: [:error] [pid 92566] [client 64.114.207.67:15593] PHP Notice: Undefined
index: Role in
/var/www/localhost/htdocs/guide_on_the_side/app/Controller/AppController.php on
line 36, referer:
http://gots.library.cpp.edu/guide_on_the_side/tutorial/document-delivery
1: [:error] [pid 35701] [client 34.215.24.125:34610] PHP Notice: Undefined
index: Role in
/var/www/localhost/htdocs/guide_on_the_side/app/Controller/AppController.php on
line 36
1: [:error] [pid 5416] [client 64.114.207.67:16777] PHP Notice: Undefined i
ndex: Role in
/var/www/localhost/htdocs/guide_on_the_side/app/Controller/AppController.php on
line 36, referer:
http://gots.library.cpp.edu/guide_on_the_side/tutorial/document-delivery
1: [:error] [pid 5416] [client 34.215.24.125:34616] PHP Notice: Undefined i
ndex: Role in
/var/www/localhost/htdocs/guide_on_the_side/app/Controller/AppController.php on
line 36

Based on the code:

$role = $this->Role->findById($role_id);
$this->Session->write('Role', $role['Role']);

The role object does not have a 'Role' index? Is it assumed that it always should? We're running 1.0-beta4 which still seems to be the latest release version, and this section of code doesn't look different in HEAD.

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