Permalink
Browse files

DEVELOPER_DEBUG messages to help you diagnose broken prev/next links …

…in XMDBD files.
  • Loading branch information...
tjhunt
tjhunt committed Aug 15, 2008
1 parent 64b0c54 commit 865d83b3ca42a7cd83e977dcb60210a0f8b24282
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/xmldb/classes/XMLDBObject.class.php
@@ -240,6 +240,7 @@ function checkPreviousNextValues(&$arr) {
}
}
if ($counter != 1) {
+ debugging('The number of tables with previous not set is different from 1', DEBUG_DEVELOPER);
$result = false;
}
}
@@ -252,6 +253,7 @@ function checkPreviousNextValues(&$arr) {
}
}
if ($counter != 1) {
+ debugging('The number of tables with next not set is different from 1', DEBUG_DEVELOPER);
$result = false;
}
}
@@ -261,6 +263,7 @@ function checkPreviousNextValues(&$arr) {
if ($element->getPrevious()) {
$i = $this->findObjectInArray($element->getPrevious(), $arr);
if ($i === NULL) {
+ debugging('Table ' . $element->getName() . ' says PREVIOUS="' . $element->getPrevious() . '" but that other table does not exist.', DEBUG_DEVELOPER);
$result = false;
}
}
@@ -272,6 +275,7 @@ function checkPreviousNextValues(&$arr) {
if ($element->getNext()) {
$i = $this->findObjectInArray($element->getNext(), $arr);
if ($i === NULL) {
+ debugging('Table ' . $element->getName() . ' says NEXT="' . $element->getNext() . '" but that other table does not exist.', DEBUG_DEVELOPER);
$result = false;
}
}
@@ -283,6 +287,7 @@ function checkPreviousNextValues(&$arr) {
foreach($arr as $element) {
if (in_array($element->getPrevious(), $existarr)) {
$result = false;
+ debugging('Table ' . $element->getName() . ' says PREVIOUS="' . $element->getPrevious() . '" but another table has already said that!', DEBUG_DEVELOPER);
} else {
$existarr[] = $element->getPrevious();
}
@@ -294,6 +299,7 @@ function checkPreviousNextValues(&$arr) {
foreach($arr as $element) {
if (in_array($element->getNext(), $existarr)) {
$result = false;
+ debugging('Table ' . $element->getName() . ' says NEXT="' . $element->getNext() . '" but another table has already said that!', DEBUG_DEVELOPER);
} else {
$existarr[] = $element->getNext();
}

0 comments on commit 865d83b

Please sign in to comment.