Commit 55fd9240 authored by Côme Chilliet's avatar Côme Chilliet

Merge branch '5954-unicity-should-be-set-explicitely' into '1.4-dev'

Resolve "Unicity should be set explicitely"

See merge request fusiondirectory/fd!528
parents 0d2bb37e 85c255e5
......@@ -148,6 +148,7 @@ class Attribute
function setUnique ($unique, $filter = NULL)
{
if ($unique === TRUE) {
trigger_error('Deprecated fallback');
$this->unique = 'one';
} else {
$this->unique = $unique;
......@@ -487,7 +488,7 @@ class Attribute
}
$infos = pluglist::pluginInfos(get_class($this->plugin));
if ($this->uniqueFilter === NULL) {
$filters = array_map(
$objectTypeFilters = array_map(
function ($key, $ot)
{
if (!is_numeric($key)) {
......@@ -503,6 +504,10 @@ class Attribute
array_keys($infos['plObjectType']),
array_values($infos['plObjectType'])
);
$filters = array();
if (!empty($objectTypeFilters)) {
$filters[] = '(|'.implode($objectTypeFilters).')';
}
$pluginFilter = call_user_func(array(get_class($this->plugin), 'getLdapFilter'));
if (!empty($pluginFilter)) {
$filters[] = $pluginFilter;
......
......@@ -104,7 +104,7 @@ class simpleTabs
($baseobject instanceof simplePlugin) &&
($baseobject->attributesAccess[$infos['mainAttr']]->getUnique() === FALSE)
) {
$baseobject->attributesAccess[$infos['mainAttr']]->setUnique(TRUE);
$baseobject->attributesAccess[$infos['mainAttr']]->setUnique('one');
}
}
......
......@@ -157,7 +157,7 @@ class department extends simplePlugin
$this->attributesAccess['businessCategory']->setChoices($categoriesList);
}
$this->attributesAccess[static::$namingAttr]->setUnique(TRUE);
$this->attributesAccess[static::$namingAttr]->setUnique('one');
}
/* Check values */
......
  • SonarQube analysis indicates that quality gate is failed.

    • Security Rating on New Code is passed: Actual value 1
    • Reliability Rating on New Code is failed: Actual value 3 > 1
    • Maintainability Rating on New Code is passed: Actual value 1
    • Duplicated Lines on New Code (%) is passed: Actual value 3.058232090490155

    SonarQube analysis reported no issues.

  • SonarQube analysis indicates that quality gate is failed.

    • Security Rating on New Code is passed: Actual value 1
    • Reliability Rating on New Code is failed: Actual value 3 > 1
    • Maintainability Rating on New Code is passed: Actual value 1
    • Duplicated Lines on New Code (%) is passed: Actual value 3.058232090490155

    SonarQube analysis reported no issues.

Markdown is supported
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