Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Wrong interface on compileSource leads to fatal error #16608

Closed
oleghind opened this issue Jun 7, 2024 · 1 comment
Closed

[BUG] Wrong interface on compileSource leads to fatal error #16608

oleghind opened this issue Jun 7, 2024 · 1 comment
Assignees
Labels
5.0 The issues we want to solve in the 5.0 release bug A bug report status: medium Medium

Comments

@oleghind
Copy link

oleghind commented Jun 7, 2024

protected function compileSource(string! viewCode, bool extendsMode = false) -> string

compileSource method returns string, but sometimes it returns array

Example:

                    if extendsMode {
                        let finalCompilation[] = block;
                    } else {
                        let finalCompilation .= block;
                    }
                }
            }

            return finalCompilation;

... which leads to a crash:
PHP Fatal error: Phalcon\Mvc\View\Engine\Volt\Compiler::compileSource(): Return value must be of type string, array returned

Better adjust interface to string | array

@oleghind oleghind added bug A bug report status: unverified Unverified labels Jun 7, 2024
@oleghind oleghind changed the title Wrong interface on compileSource leads to fatal error [BUG] Wrong interface on compileSource leads to fatal error Jun 7, 2024
@niden niden self-assigned this Jun 7, 2024
@niden niden added status: medium Medium 5.0 The issues we want to solve in the 5.0 release and removed status: unverified Unverified labels Jun 7, 2024
@niden
Copy link
Member

niden commented Jun 7, 2024

Resolved in #16609

Thank you @oleghind

@niden niden closed this as completed Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5.0 The issues we want to solve in the 5.0 release bug A bug report status: medium Medium
Projects
Status: Implemented
Development

No branches or pull requests

2 participants