Uncaught TypeError
Comments for “Uncaught TypeError”
|
|
---|---|
Posted by Balazs on Monday 17th April 2023 at 23:33 GMT |
User Level: Level One Member Date Joined: 8/04/2023 |
Winning Answer! Posted by DaFa on Tuesday 18th April 2023 at 10:43 GMT
I'd say yes it probably is the new type hinting DC introduced a few days back. I'd also guess you are using PHP 8.2 or 8.1.17 as well.
I'll look at this a bit later tonight when I'm in front of my laptop. **** UPDATE I've created a pull request that fixes these errors - DC will look at them and review them later. These are the fixes to Trongate.php protected function view(string $view, array $data = [], bool $return_as_str = false): string|null { if ($this->parent_module !== '' && $this->child_module !== '') { // Load view from child module $output = $this->load_view_file($view, $data, $return_as_str); if ($return_as_str) { return $output; } } else { // Normal view loading process $module_name = $data['view_module'] ?? $this->module_name; extract($data); $view_path = APPPATH . 'modules/' . $module_name . '/views/' . $view . '.php'; if (!file_exists($view_path)) { $view = str_replace('/', '/views/', $view); $view_path = APPPATH . 'modules/' . $view . '.php'; } $output = $this->load_view_file($view_path, $data, $return_as_str); if ($return_as_str) { return $output; } } return null; } protected function load_view_file(string $view_path, array $data, bool $return_as_str): string|null|false { if (!file_exists($view_path)) { throw new Exception('View ' . $view_path . ' does not exist'); } if ($return_as_str) { ob_start(); require $view_path; return ob_get_clean() ?: null; } else { require $view_path; return false; } } This comment was edited by DaFa on Tuesday 18th April 2023 at 13:44 GMT |
User Level: Founding Member Date Joined: 30/11/2018 |
Posted by Balazs on Tuesday 18th April 2023 at 16:17 GMT
Yes, I use PHP 8.2. Thank you for the quick response.
|
User Level: Level One Member Date Joined: 8/04/2023 |
On the default "IT TOTALLY WORKS!" page I get the following error:
Is it related to the new "type hinting and return types" update? What's the fix?