Skip to content

Commit

Permalink
Merge pull request #2654 from pifou25/fix/debug_traces
Browse files Browse the repository at this point in the history
Fix/debug traces
  • Loading branch information
zoic21 authored Jun 6, 2024
2 parents 65702ef + 2c023f6 commit 7d58339
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
15 changes: 14 additions & 1 deletion core/dom/dom.ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,20 @@ NodeList.prototype.unseen = function() {
}
return this
}

Element.prototype.toggle = function() {
if (this.offsetParent === null){
this.style.display = ''
} else {
this.style.display = 'none'
}
return this
}
NodeList.prototype.toggle = function() {
for (var idx = 0; idx < this.length; idx++) {
this[idx].toggle()
}
return this
}
Element.prototype.empty = function() {
while (this.firstChild) {
this.removeChild(this.lastChild)
Expand Down
6 changes: 3 additions & 3 deletions core/php/utils.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,9 @@ function mySqlIsHere() {

function displayException($e) {
$message = '<span id="span_errorMessage">' . $e->getMessage() . '</span>';
if (DEBUG) {
$message .= '<a class="pull-right bt_errorShowTrace cursor">Show traces</a>';
$message .= '<br/><pre class="pre_errorTrace" style="display : none;">' . print_r($e->getTrace(), true) . '</pre>';
if (DEBUG !== 0) {
$message .= "<a class=\"pull-right bt_errorShowTrace cursor\" onclick=\"event.stopPropagation(); document.getElementById('pre_errorTrace').toggle()\">Show traces</a>";
$message .= '<br/><pre id="pre_errorTrace" style="display : none;">' . print_r($e->getTraceAsString(), true) . '</pre>';
}
return $message;
}
Expand Down
2 changes: 1 addition & 1 deletion sick.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
$user->save();
echo "OK (admin/admin)\n";
}
} catch (Exeption $e) {
} catch (Exception $e) {
echo "ERROR\n";
echo "Description : " . $e->getMessage();
echo "\n";
Expand Down

0 comments on commit 7d58339

Please sign in to comment.