Skip to content

Commit 79e5976

Browse files
authored
fix: add fallback for appOverridesFolder config in View (#9958)
* fix: add fallback for appOverridesFolder config in View * add changelog entry
1 parent a5fc034 commit 79e5976

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

system/View/View.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,10 @@ public function render(string $view, ?array $options = null, ?bool $saveData = n
202202
$this->renderVars['file'] = $this->viewPath . $this->renderVars['view'];
203203

204204
if (str_contains($this->renderVars['view'], '\\')) {
205-
$overrideFolder = $this->config->appOverridesFolder !== ''
206-
? trim($this->config->appOverridesFolder, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR
205+
$appOverridesFolder = $this->config->appOverridesFolder ?? 'overrides';
206+
207+
$overrideFolder = $appOverridesFolder !== ''
208+
? trim($appOverridesFolder, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR
207209
: '';
208210

209211
$this->renderVars['file'] = $this->viewPath

user_guide_src/source/changelogs/v4.7.1.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ Bugs Fixed
4343
- **Model:** Fixed a bug where ``BaseModel::updateBatch()`` threw an exception when ``updateOnlyChanged`` was ``true`` and the index field value did not change.
4444
- **Session:** Fixed a bug in ``MemcachedHandler`` where the constructor incorrectly threw an exception when ``savePath`` was not empty.
4545
- **Toolbar:** Fixed a bug where the standalone toolbar page loaded from ``?debugbar_time=...`` was not interactive.
46+
- **View:** Fixed a bug where ``View`` would throw an error if the ``appOverridesFolder`` config property was not defined.
4647

4748
See the repo's
4849
`CHANGELOG.md <https://github.com/codeigniter4/CodeIgniter4/blob/develop/CHANGELOG.md>`_

0 commit comments

Comments
 (0)