Skip to content

Commit

Permalink
Pull request #825 broke the Ajax messages. This commit fixes it.
Browse files Browse the repository at this point in the history
When there were no messages, but there was HTML for the ESI Ajax container, it was thrown. When that happened, there was no ESI container on that page, so messages would never work on that cached page.
  • Loading branch information
jeroenvermeulen committed Aug 26, 2015
1 parent 3f30eb9 commit cb986e1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions app/code/community/Nexcessnet/Turpentine/Block/Core/Messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,16 +198,17 @@ protected function _toHtml() {
} else {
$this->_loadMessages();
$this->_loadSavedMessages();
$html = $this->_real_toHtml();
if ( count($this->getMessages()) ) {
$html = $this->_real_toHtml();
} else {
// Prevent returning an empty <ul></ul>
$html = '';
}
}
} else {
$html = $this->_real_toHtml();
}
$this->_directCall = false;
if (count($this->getMessages()) == 0) {
return '';
}
return $html;
}

Expand Down

0 comments on commit cb986e1

Please sign in to comment.