You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After upgrading from Lumen 5.4 to 5.5 and Landlord from 2.0.6 to 2.0.8, my tenants are getting mixed up.
This is the piece of code where a wrong value is added to the "where":
TenantManager:143
$this->modelTenants($model)->each(function ($id, $tenant) use ($model) {
$model->addGlobalScope($tenant, function (Builder $builder) use ($tenant, $id, $model) {
if($this->getTenants()->first() && $this->getTenants()->first() != $id){
$id = $this->getTenants()->first();
}
$builder->where($model->getQualifiedTenant($tenant), '=', $id);
});
});
As you can see in the attached picture, the tenant value for the tenant id is 1. However, the library is setting the value of the tenant to "DS", which is the value of another tenant belongsToSolution.
The problem seems to be that the library is always getting the first tenant as the value, instead of getting the tenant with the corresponding key. I think the correct code would be:
$this->modelTenants($model)->each(function ($id, $tenant) use ($model) {
$model->addGlobalScope($tenant, function (Builder $builder) use ($tenant, $id, $model) {
$id = $this->getTenantId($tenant);
$builder->where($model->getQualifiedTenant($tenant), '=', $id);
});
});
Hi,
After upgrading from Lumen 5.4 to 5.5 and Landlord from 2.0.6 to 2.0.8, my tenants are getting mixed up.
This is the piece of code where a wrong value is added to the "where":
TenantManager:143
As you can see in the attached picture, the tenant value for the tenant id is 1. However, the library is setting the value of the tenant to "DS", which is the value of another tenant belongsToSolution.
The problem seems to be that the library is always getting the first tenant as the value, instead of getting the tenant with the corresponding key. I think the correct code would be:
Lumen: 5.5
LandLord: 2.0.8
PHP: 7.1.9
Enviroment: WAMP Stack (Windows 10) and LAMP Stack (Ubuntu 16)
The text was updated successfully, but these errors were encountered: