Unverified Commit ac29f690 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

:ambulance: fix(schac) Do not fill schacPersonalUniqueCode automatically on templates

issue #6093
Showing with 12 additions and 10 deletions
+12 -10
...@@ -59,18 +59,20 @@ class schacAccount extends simplePlugin ...@@ -59,18 +59,20 @@ class schacAccount extends simplePlugin
{ {
parent::update(); parent::update();
if (($supannTab = $this->parent->getTabOrServiceObject('supannAccount')) !== FALSE) { if (!$this->is_template) {
$ine = $supannTab->supannCodeINE; if (($supannTab = $this->parent->getTabOrServiceObject('supannAccount')) !== FALSE) {
  • :warning: Merge this if statement with the enclosing one. :blue_book:

Please register or sign in to reply
$uniquecodes = $this->schacPersonalUniqueCode; $ine = $supannTab->supannCodeINE;
foreach ($uniquecodes as $key => $uniquecode) { $uniquecodes = $this->schacPersonalUniqueCode;
if (preg_match('/^urn:schac:personalUniqueCode:int:esi:fr:/', $uniquecode)) { foreach ($uniquecodes as $key => $uniquecode) {
unset($uniquecodes[$key]); if (preg_match('/^urn:schac:personalUniqueCode:int:esi:fr:/', $uniquecode)) {
unset($uniquecodes[$key]);
}
} }
if (!empty($ine)) {
$uniquecodes[] = 'urn:schac:personalUniqueCode:int:esi:fr:'.$ine;
}
$this->schacPersonalUniqueCode = array_values($uniquecodes);
} }
if (!empty($ine)) {
$uniquecodes[] = 'urn:schac:personalUniqueCode:int:esi:fr:'.$ine;
}
$this->schacPersonalUniqueCode = array_values($uniquecodes);
} }
return TRUE; return TRUE;
......
  • SonarQube analysis reported 1 issue

    • :warning: 1 major

    Watch the comments in this conversation to review them.

Supports Markdown
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