apaoww / yii2-oci8

Yii2 Oracle Oci8 Driver
11 stars 12 forks source link

Undefined index #8

Closed fdo36 closed 6 years ago

fdo36 commented 6 years ago

I have created a Yii2 application with MySQL. But due to some specifics instructions from the heaven, I must migrate to oracle 11g.

In my application, I used the role based access control with "auth_item" and all their relations.

The connection with the database works fine with your pluging, but when I do

$auth->getRole('Admin');

Appears the next error:

PHP Notice 'yii\base\ErrorException' with message 'Undefined index: rule_name'

The table structure of the rbac is shown in the picture attached.

When I call the "getRole()" method, I have to pass the role name as parametter. The roles are saved in the "auth_item" table with type = 1 (because type=2 means it's a permission).

So, you can see that the attribute "rule_name" of the "auth_item" table has an index and a FK pointing to the related table...

The attribute "rule_name" is nulleable and by default it stores a null and I have cero rows in the related table (this is not a problem in myslq and, indeed, it's a normal behaviour)

I hope you can help me because using the yii\db\Connection (with oci) it works fine but I want to use this widget).

Thanks in advance rbac

apaoww commented 6 years ago

You can try https://github.com/apaoww/yii2-dbmanager-oci8. This dbmanager is I customize for oracle to avoid index error.