Skip to content

[Form] [Hackday] [2.7] Add a deprecation note about the form_enctype helper #12673

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

Merged
merged 1 commit into from
Nov 29, 2014

Conversation

mrcmorales
Copy link
Contributor

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? yes
Tests pass? yes
Fixed tickets #12664
License MIT
Doc PR

@nicolas-grekas
Copy link
Member

👍

@fabpot
Copy link
Member

fabpot commented Nov 29, 2014

Thank you @mrcmorales.

@fabpot fabpot merged commit 2061a88 into symfony:2.7 Nov 29, 2014
fabpot added a commit that referenced this pull request Nov 29, 2014
…`form_enctype` helper (mrcmorales)

This PR was merged into the 2.7 branch.

Discussion
----------

[Form] [Hackday] [2.7] Add a deprecation note about the `form_enctype` helper

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | #12664
| License       | MIT
| Doc PR        |

Commits
-------

2061a88 issue 12664
@dfreudenberger
Copy link

Hi there.. I think this changed has introduced a bug. Executing the compiled version of one of fosuserbundle's templates generates a parse error..

template

{% trans_default_domain 'FOSUserBundle' %}

<form action="{{ path('fos_user_registration_register') }}" {{ form_enctype(form) }} method="POST" class="fos_user_registration_register">
    {{ form_widget(form) }}
    <div>
        <input type="submit" value="{{ 'registration.submit'|trans }}" />
    </div>
</form>

compiled to

<?php

/* FOSUserBundle:Registration:register_content.html.twig */
class __TwigTemplate_b8ccdaee3f5f693a4504c6bdaf93d5496e7461383710c9791f9823624b3a37f3 extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->parent = false;

        $this->blocks = array(
        );
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        // line 2
        echo "
<form action=\"";
        // line 3
        echo $this->env->getExtension('routing')->getPath("fos_user_registration_register");
        echo "\" ";
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock((isset($context["form"]) ? $context["form"] : $this->getContext($context, "form")), 'enctype')        trigger_error('The helper form_enctype(form) is deprecated since version 2.3 and will be removed in 3.0. Use form_start(form) instead.', E_USER_DEPRECATED);
        echo " method=\"POST\" class=\"fos_user_registration_register\">
    ";
        // line 4
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock((isset($context["form"]) ? $context["form"] : $this->getContext($context, "form")), 'widget');
        echo "
    <div>
        <input type=\"submit\" value=\"";
        // line 6
        echo twig_escape_filter($this->env, $this->env->getExtension('translator')->trans("registration.submit", array(), "FOSUserBundle"), "html", null, true);
        echo "\" />
    </div>
</form>
";
    }

    public function getTemplateName()
    {
        return "FOSUserBundle:Registration:register_content.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  33 => 6,  28 => 4,  22 => 3,  19 => 2,);
    }
}

error (line 24)

Parse Error: syntax error, unexpected 'trigger_error' (T_STRING), expecting ',' or ';'

@dfreudenberger
Copy link

just in case you don't get notified about closed issues ... ping @fabpot

@fabpot
Copy link
Member

fabpot commented Dec 3, 2014

@dfreudenberger Can you create a new issue? Thanks.

@fabpot
Copy link
Member

fabpot commented Dec 26, 2014

reverted as it does not work

fabpot added a commit that referenced this pull request Dec 26, 2014
…out the `form_enctype` helper (mrcmorales)"

This reverts commit e8d9857, reversing
changes made to 0c7df58.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants