Skip to content
Extraits de code Groupes Projets
Valider edf66083 rédigé par mattab's avatar mattab
Parcourir les fichiers

Fix typo

parent 0323adab
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -338,17 +338,17 @@ abstract class VisitDimension extends Dimension ...@@ -338,17 +338,17 @@ abstract class VisitDimension extends Dimension
// find circular references // find circular references
// and remove dependencies whose column cannot be resolved because it is not installed / does not exist / is defined by core // and remove dependencies whose column cannot be resolved because it is not installed / does not exist / is defined by core
$depenencies = array(); $dependencies = array();
foreach ($dimensions as $dimension) { foreach ($dimensions as $dimension) {
$depenencies[$dimension->getColumnName()] = $dimension->getRequiredVisitFields(); $dependencies[$dimension->getColumnName()] = $dimension->getRequiredVisitFields();
} }
foreach ($depenencies as $column => $fields) { foreach ($dependencies as $column => $fields) {
foreach ($fields as $key => $field) { foreach ($fields as $key => $field) {
if (empty($depenencies[$field]) && !in_array($field, $exists)) { if (empty($dependencies[$field]) && !in_array($field, $exists)) {
// we cannot resolve that dependency as it does not exist // we cannot resolve that dependency as it does not exist
unset($depenencies[$column][$key]); unset($dependencies[$column][$key]);
} elseif (!empty($depenencies[$field]) && in_array($column, $depenencies[$field])) { } elseif (!empty($dependencies[$field]) && in_array($column, $dependencies[$field])) {
throw new Exception("Circular reference detected for required field $field in dimension $column"); throw new Exception("Circular reference detected for required field $field in dimension $column");
} }
} }
...@@ -364,7 +364,7 @@ abstract class VisitDimension extends Dimension ...@@ -364,7 +364,7 @@ abstract class VisitDimension extends Dimension
break; // to prevent an endless loop break; // to prevent an endless loop
} }
foreach ($dimensions as $key => $dimension) { foreach ($dimensions as $key => $dimension) {
$fields = $depenencies[$dimension->getColumnName()]; $fields = $dependencies[$dimension->getColumnName()];
if (count(array_intersect($fields, $exists)) === count($fields)) { if (count(array_intersect($fields, $exists)) === count($fields)) {
$sorted[] = $dimension; $sorted[] = $dimension;
$exists[] = $dimension->getColumnName(); $exists[] = $dimension->getColumnName();
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter