vanilophp / framework

The truly Laravel E-commerce Framework
https://vanilo.io
MIT License
810 stars 102 forks source link

No query results for model [Konekt\Acl\Models\Role] #34

Closed j-dohnalek closed 5 years ago

j-dohnalek commented 5 years ago

When running this migration Migrating: 2018_12_09_193651_create_property_permissions Getting this error: No query results for model [Konekt\Acl\Models\Role].

Any advice please?

fulopattila122 commented 5 years ago

This migration is part of the Vanilo Framework and doesn't come from this module. https://github.com/vanilophp/framework/blob/master/src/resources/database/migrations/2018_12_09_193651_create_property_permissions.php Still valid though, I'll transfer the issue there

j-dohnalek commented 5 years ago

I think the problem lies when I delete the admin role from roles, if the admin role is in the table it works fine.

The problem is over this line

$adminRole = RoleProxy::where(['name' => 'admin'])->firstOrFail();

I am not using admin role under such name in my system. Is it possible to move the hard-coded reference admin from the files to one place (i.e. app/concord.php) please? I have found that the values are hard-coded in the following files

2017_06_12_073443_create_appshell_permissions.php
2017_10_19_192447_create_vanilo_permissions.php
fulopattila122 commented 5 years ago

Yes, that's a good point. Still have to figure out how to do it in a backwards compatible manner.

fulopattila122 commented 5 years ago

If you upgrade konekt/appshell to 1.3.3 or higher and vanilo/framework to 0.5.3 or higher, the problem should be resolved.

j-dohnalek commented 5 years ago

great, thank you, I will have a look