Open lunetics opened 3 weeks ago
@diffy0712 can you look into it?
Hello,
I had a quick look and unfortunately this test was not covering this case and did not fail on the latest fix for twig3.9 support. This for sure needs to be handled. I think I can add another test, which would fail on the same error.
The problem is indeed the 'ob_get_clean' call again, which in case of the 'end_page' could be moved outside of twig's render (the previous fix for the twig3.9 support pr), but in this case it cannot be done as the form can be anywhere in the content. I figured that any 'Widget' which relies on the ob to have the content to override will fail similarly.
I try to come up with a solution for this one and keep you guys updated.
Until then, you can fix the package version to 2.4.3
, which will prevent the 'unsupported twig version' from installing and was merged in this pr. composer require "yiisoft/yii2-twig:2.4.3"
I think I can add another test, which would fail on the same error.
That would be great as a first step.
Thanks for looking into it. I'm currently debugging another case, will do a seperate ticket for that.
What steps will reproduce the problem?
Update
yii2-twig
to v2.5.0 (support for twig 3.9 -> see https://github.com/yiisoft/yii2-twig/pull/154 )What's expected?
Forms are rendered correctly
What do you get instead?
The form is rendered, but after the fields. e.g. instead of
it renders:
following twig form code is used:
I'm not proficient in yii2, but from what I discovered, it happends in
yii\widgets\ActiveForm::run()
method. https://github.com/yiisoft/yii2/blob/52e4a3e645eaece47c3f9dddac7c1771a5bd7804/framework/widgets/ActiveForm.php#L225The $content is empty (I assume because of the
ob_get_clean()
behaviour in twig 3.9? resulting in returned $html string:<form id="customer-signup-form" action="/account/register" method="post" data-form></form>
Since I'm new into this yii2 project, I have limited knowledge of the inner workings
Additional info