Skip to content
Snippets Groups Projects
Commit 7ab6b37c authored by Alex Arnaud's avatar Alex Arnaud
Browse files

Merge branch 'hotline#220612_selection_d_une_bib_ko' into 'master'

[RTok] hotline#220612 : UserGroup form : fix getting search_id_site

See merge request !5166
parents f11eaa4b bc536a8c
Branches
1 merge request!5166[RTok] hotline#220612 : UserGroup form : fix getting search_id_site
Pipeline #47403 passed with stage
in 33 minutes and 40 seconds
- correctif #220612 : corrige la récupération du site dans le formulaire des groupes dynamiques
\ No newline at end of file
......@@ -204,8 +204,8 @@ class ZendAfi_Controller_Plugin_Manager_UserGroup
ZendAfi_Form_Admin_UserGroup::PERMISSION);
$multi_lib_name = (new Class_User_SearchCriteriaMultiLibraries([]))->getName();
if (isset($post[$multi_lib_name]))
$post[$multi_lib_name] |= 'all';
if ( ! ($post[$multi_lib_name] ?? null))
$post[$multi_lib_name] = 'all';
unset($post[ZendAfi_Form_Admin_UserGroup::RIGHTS_PERMISSIONS]);
return $post;
......
<?php
/**
* Copyright (c) 2012-2024, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* BOKEH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class UserGroupControllerPostSiteTest extends Admin_AbstractControllerTestCase
{
public function setUp(): void
{
parent::setUp();
$this->fixture(Class_UserGroup::class,
['id' => 77,
'protected' => false,
'libelle' => 'Accés aux ressources numériques',
'group_type' => Class_UserGroup::TYPE_DYNAMIC,
'users' => [],
'rights' => []]);
$this->postDispatch('admin/usergroup/edit/id/77',
['libelle' => 'Accés aux ressources numériques',
'search_id_site' => '2']);
}
/** @test */
public function searchIdSiteFilterShouldBeSavedAs2()
{
$this->assertEquals('2', json_decode(Class_UserGroup::find(77)
->getFilters())->search_id_site);
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment