Skip to content
This repository has been archived by the owner on May 14, 2018. It is now read-only.

SQL schema update cause some troubles. #170

Closed
cyrilf opened this issue Jul 23, 2013 · 15 comments
Closed

SQL schema update cause some troubles. #170

cyrilf opened this issue Jul 23, 2013 · 15 comments

Comments

@cyrilf
Copy link

cyrilf commented Jul 23, 2013

@Danielss89 has done a pull request (164) in order to update the schema.sql
Now, the documentation isn't up to date and some files haven't been updated accordingly..

My main issue is with the Provider/Identity/ZfcUserZendDb.php in the method getIdentityRoles
This method should return a string corresponding of the roleId but now, it returns an int and ZF doesn't know this role (as it receive an id like: 7 instead of a name like 'admin').
My workaround for now is to use this id (i.e. 7) and query the user_role table in order to get the corresponding string (i.e. admin)

@Ocramius
Copy link
Contributor

Duplicate of #168

@cyrilf
Copy link
Author

cyrilf commented Jul 23, 2013

I understand that you consider this as a duplicate.
But in my opinion, it's not entirely the same..

#168 is talking about wrong default values in Provider/Role/ZendDb.php which is a small issue because these are only default values, overloaded by the configuration values.
My issue is about the Provider/Identity/ZfcUserZendDb.php where the method now return a wrong result.

It's just to keep you aware that there is more than one change to do.
Thanks!

@Ocramius Ocramius reopened this Jul 23, 2013
@Ocramius
Copy link
Contributor

@cyrilf are you eventually able to provide a test case for the issue?

@cyrilf
Copy link
Author

cyrilf commented Jul 23, 2013

@Ocramius unfortunately not.. I've started working with ZF2 only a week ago. So I'm not aware about best practices and how to easily do that.

But if you need me to be more precise about the issue I encounter I'm glad if I can help.

Edit:

I've created a Gist to show you my workaround (just using a join between the 2 tables).

@Ocramius
Copy link
Contributor

@cyrilf ah, I see the problem. It looks like a valid fix, but I will include it only with tests.
@bjyoungblood are you eventually able to check this?

@dphn
Copy link

dphn commented Jul 25, 2013

Hello, when do you plan to release a working version?

@Ocramius
Copy link
Contributor

Whenever someone provides a patch+test plus I have time to merge it
On 25 Jul 2013 18:43, "dphn" notifications@github.com wrote:

Hello, when do you plan to release a working version?


Reply to this email directly or view it on GitHubhttps://github.com//issues/170#issuecomment-21567604
.

@dphn
Copy link

dphn commented Jul 25, 2013

Tell me, please, what version is still working?
P.S.: parent_id is varchar. Um ... Are you sure?

@dphn
Copy link

dphn commented Jul 26, 2013

Well done, thank you.

@Ocramius
Copy link
Contributor

Will fix asap
On 26 Jul 2013 08:53, "dphn" notifications@github.com wrote:

Well done, thank you. Small "but":
https://github.com/bjyoungblood/BjyAuthorize/pull/171/files

'BjyAuthorize\Provider\Role\ZendDb' => array(

  •            'table'             => 'user_role',
    
  •            'role_id_field'     => 'role_id',
    
  •            'parent_role_field' => 'parent', // !!!!!!!!!!!!!!!!!!!!!!!!!!!!
    
  •            'table'                 => 'user_role',
    
  •            'identifier_field_name' => 'id',
    
  •            'role_id_field'         => 'role_id',
    
  •            'parent_role_field'     => 'parent_id', // !!!!!!!!!!!!!!!!!!!!!!!
         ),
    


Reply to this email directly or view it on GitHubhttps://github.com//issues/170#issuecomment-21604445
.

@Ocramius
Copy link
Contributor

@dphn fyi, you can directly comment on the diff

@dphn
Copy link

dphn commented Jul 26, 2013

Er ... comments? Now three tables. A one role have a single parent. If done four tables, one role can have multiple parents :)
table name link_parens
role_id
parent_id
Good luck :)

@Ocramius
Copy link
Contributor

@dphn can you please comment on the correct issue, inline, in the location that bothers you? I am not understanding the problem you are trying to explain.

@Ocramius
Copy link
Contributor

The correct thread is #171

@Ocramius
Copy link
Contributor

Handled @8214a324c3307f6675e8c38228e4b304ceb29fc8

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

No branches or pull requests

3 participants