|
101 | 101 |
|
102 | 102 | // Defer font awesome |
103 | 103 | $wa->getAsset('style', 'fontawesome')->setAttribute('rel', 'lazy-stylesheet'); |
| 104 | + |
| 105 | +// Get the error code |
| 106 | +$errorCode = $this->error->getCode(); |
104 | 107 | ?> |
105 | 108 | <!DOCTYPE html> |
106 | 109 | <html lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>"> |
|
148 | 151 |
|
149 | 152 | <div class="site-grid"> |
150 | 153 | <div class="grid-child container-component"> |
| 154 | + <?php if ($this->countModules('error-' . $errorCode)) : ?> |
| 155 | + <div class="container"> |
| 156 | + <jdoc:include type="modules" name="error-<?php echo $errorCode; ?>" style="none" /> |
| 157 | + </div> |
| 158 | + <?php else : ?> |
151 | 159 | <h1 class="page-header"><?php echo Text::_('JERROR_LAYOUT_PAGE_NOT_FOUND'); ?></h1> |
152 | 160 | <div class="card"> |
153 | 161 | <div class="card-body"> |
|
167 | 175 | <blockquote> |
168 | 176 | <span class="badge bg-secondary"><?php echo $this->error->getCode(); ?></span> <?php echo htmlspecialchars($this->error->getMessage(), ENT_QUOTES, 'UTF-8'); ?> |
169 | 177 | </blockquote> |
170 | | - <?php if ($this->debug) : ?> |
171 | | - <div> |
| 178 | + </div> |
| 179 | + </div> |
| 180 | + <?php endif; ?> |
| 181 | + <?php if ($this->debug) : ?> |
| 182 | + <div> |
| 183 | + <?php echo $this->renderBacktrace(); ?> |
| 184 | + <?php // Check if there are more Exceptions and render their data as well ?> |
| 185 | + <?php if ($this->error->getPrevious()) : ?> |
| 186 | + <?php $loop = true; ?> |
| 187 | + <?php // Reference $this->_error here and in the loop as setError() assigns errors to this property and we need this for the backtrace to work correctly ?> |
| 188 | + <?php // Make the first assignment to setError() outside the loop so the loop does not skip Exceptions ?> |
| 189 | + <?php $this->setError($this->_error->getPrevious()); ?> |
| 190 | + <?php while ($loop === true) : ?> |
| 191 | + <p><strong><?php echo Text::_('JERROR_LAYOUT_PREVIOUS_ERROR'); ?></strong></p> |
| 192 | + <p><?php echo htmlspecialchars($this->_error->getMessage(), ENT_QUOTES, 'UTF-8'); ?></p> |
172 | 193 | <?php echo $this->renderBacktrace(); ?> |
173 | | - <?php // Check if there are more Exceptions and render their data as well ?> |
174 | | - <?php if ($this->error->getPrevious()) : ?> |
175 | | - <?php $loop = true; ?> |
176 | | - <?php // Reference $this->_error here and in the loop as setError() assigns errors to this property and we need this for the backtrace to work correctly ?> |
177 | | - <?php // Make the first assignment to setError() outside the loop so the loop does not skip Exceptions ?> |
178 | | - <?php $this->setError($this->_error->getPrevious()); ?> |
179 | | - <?php while ($loop === true) : ?> |
180 | | - <p><strong><?php echo Text::_('JERROR_LAYOUT_PREVIOUS_ERROR'); ?></strong></p> |
181 | | - <p><?php echo htmlspecialchars($this->_error->getMessage(), ENT_QUOTES, 'UTF-8'); ?></p> |
182 | | - <?php echo $this->renderBacktrace(); ?> |
183 | | - <?php $loop = $this->setError($this->_error->getPrevious()); ?> |
184 | | - <?php endwhile; ?> |
185 | | - <?php // Reset the main error object to the base error ?> |
186 | | - <?php $this->setError($this->error); ?> |
187 | | - <?php endif; ?> |
188 | | - </div> |
| 194 | + <?php $loop = $this->setError($this->_error->getPrevious()); ?> |
| 195 | + <?php endwhile; ?> |
| 196 | + <?php // Reset the main error object to the base error ?> |
| 197 | + <?php $this->setError($this->error); ?> |
189 | 198 | <?php endif; ?> |
190 | 199 | </div> |
191 | | - </div> |
| 200 | + <?php endif; ?> |
192 | 201 | </div> |
193 | 202 | </div> |
194 | 203 | <?php if ($this->countModules('footer')) : ?> |
|
0 commit comments