Bug #23044 Bug Fixed

View files not found

Version: 2.11.7 Reporter: Brian Litzinger

This is an archived bug report. If you are experiencing a similar issue, upgrade to the latest release and if that does not solve the problem, submit a new bug report

In preparing for a PHP 7 upgrade I stumbled upon this bug in 2.11 and fixed it. https://expressionengine.com/support/bugs/22897/A-non-numeric-value-encountered-ee-legacy-core-Loader.php-line-731

A couple days later when attempting to edit a custom field, I was getting this error: Unable to load the requested file: col_settings_tmpl.php

While debugging I realized it was an issue with the fix in bug 22897. Changing it from a + to . did correct the PHP 7 error, but it quietly introduced a new one. The issue seems to be that current() is getting the array’s value, which is true or false, and comparing it to the view file path, thus it was always true. I believe it should be using the array key, which is a view file path, to compare it to another view file path. Note this issue occurs in PHP 5.6 and PHP 7.

Change

current($this->_ci_view_paths) == $removed . 'views/')

to

current(array_keys($this->_ci_view_paths)) == $removed . 'views/')
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases