Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[TwigBridge] Fix Bootstrap 4 form error layout#52373

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
asispts wants to merge4 commits intosymfony:5.4
base:5.4
Choose a base branch
Loading
frompts-contrib:fix/bootstrap-4-form-layout

Conversation

@asispts
Copy link
Contributor

QA
Branch?5.4
Bug fix?yes
New feature?no
Deprecations?no
IssuesFix#52352
LicenseMIT

This PR will fix Bootstrap 4 form layout when using a required marker.

@carsonbot
Copy link

It looks like you unchecked the "Allow edits from maintainer" box. That is fine, but please note that if you have multiple commits, you'll need to squash your commits into one before this can be merged. Or, you can check the "Allow edits from maintainers" box and the maintainer can squash for you.

Cheers!

Carsonbot

@asispts
Copy link
ContributorAuthor

asispts commentedOct 31, 2023
edited
Loading

Here is the result.

@carsonbotcarsonbot changed the titleFix bootstrap 4 form error layout[Form] Fix bootstrap 4 form error layoutOct 31, 2023
@carsonbotcarsonbot changed the title[Form] Fix bootstrap 4 form error layout[TwigBridge] Fix bootstrap 4 form error layoutOct 31, 2023
@asispts
Copy link
ContributorAuthor

I think this failure is related.

1) Symfony\Bridge\Twig\Tests\Node\FormThemeTest::testCompileFailed asserting that two strings are equal.--- Expected+++ Actual@@ @@-'$this->env->getRuntime("Symfony\\Component\\Form\\FormRenderer")->setTheme(($context["form"] ?? null), [0 => "tpl1", 1 => "tpl2"], true);'+'$this->env->getRuntime("Symfony\\Component\\Form\\FormRenderer")->setTheme(($context["form"] ?? null), ["tpl1", "tpl2"], true);'/home/runner/work/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Node/FormThemeTest.php:63

Any idea how to fix the test?

$this->assertEquals(
sprintf(
'$this->env->getRuntime("Symfony\\\\Component\\\\Form\\\\FormRenderer")->setTheme(%s, [1 => "tpl1", 0 => "tpl2"], true);',
$this->getVariableGetter('form')
),
trim($compiler->compile($node)->getSource())
);
$node =newFormThemeNode($form,$resources,0,null,true);
$this->assertEquals(
sprintf(
'$this->env->getRuntime("Symfony\\\\Component\\\\Form\\\\FormRenderer")->setTheme(%s, [1 => "tpl1", 0 => "tpl2"], false);',
$this->getVariableGetter('form')
),
trim($compiler->compile($node)->getSource())
);

@OskarStarkOskarStark changed the title[TwigBridge] Fix bootstrap 4 form error layout[TwigBridge] Fix Bootstrap 4 form error layoutNov 3, 2023
@asisptsasisptsforce-pushed thefix/bootstrap-4-form-layout branch 2 times, most recently fromc91e565 tod9d92e6CompareNovember 12, 2023 19:16
@asispts
Copy link
ContributorAuthor

This failed test doesn't use the recent change. The line inFormThemeTest.php:63 is a comment, and clearly, there's no[0 => "tpl1", 1 => "tpl2"] in the test code.

I can reproduce the failure in Symfony 4 and PHP 8.2 + high-deps. The result of(new Compiler($environment))->subcompile($node->getNode('resources'))->getSource()) is indeed["tpl1", "tpl2"]. While in the recent version of Symfony, the result is[1 => "tpl1", 0 => "tpl2"]

1) Symfony\Bridge\Twig\Tests\Node\FormThemeTest::testCompileFailed asserting that two strings are equal.--- Expected+++ Actual@@ @@-'$this->env->getRuntime("Symfony\\Component\\Form\\FormRenderer")->setTheme(($context["form"] ?? null), [0 => "tpl1", 1 => "tpl2"], true);'+'$this->env->getRuntime("Symfony\\Component\\Form\\FormRenderer")->setTheme(($context["form"] ?? null), ["tpl1", "tpl2"], true);'/home/runner/work/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Node/FormThemeTest.php:63

@fabpotfabpot modified the milestones:5.4,6.4Dec 14, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@OskarStarkOskarStarkOskarStark left review comments

@xabbuhxabbuhxabbuh left review comments

+2 more reviewers

@smnandresmnandresmnandre left review comments

@norkunasnorkunasnorkunas left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

6.4

Development

Successfully merging this pull request may close these issues.

8 participants

@asispts@carsonbot@OskarStark@smnandre@xabbuh@norkunas@fabpot@nicolas-grekas

[8]ページ先頭

©2009-2025 Movatter.jp