This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component
Fabien Potencier 04a549bf6e merged branch cordoval/patch-1 (PR #1890)
Commits
-------

8a980bd $node->hasAttribute('disabled') sf2 should not create disagreement between implementation and practice for a crawler. If sahi real browser can find an element that is disabled, then sf2 should too. https://github.com/Behat/Mink/pull/58#issuecomment-1712459

Discussion
----------

$node->hasAttribute('disabled') sf2 should not create disagreement betwee

$node->hasAttribute('disabled') sf2 should not create disagreement between implementation and practice for a crawler. If sahi real browser can find an element that is disabled, then sf2 should too.
https://github.com/Behat/Mink/pull/58#issuecomment-1712459

---------------------------------------------------------------------------

by cordoval at 2011/08/09 20:34:56 -0700

@fabpot please let me know if this is going to be in sometime soon or not, just wondering why it is deviating ...

---------------------------------------------------------------------------

by fabpot at 2011/08/23 01:11:42 -0700

I have just checked in a browser and the Symfony2 implementation is actually the right one.

Try this in a browser:

    <form action='#' method="post">
        <input name="foo" disabled="disabled" value="foo" />
        <input name="bar" value="bar" />

        <input type="submit" />
    </form>

    <?php

    print_r($_POST);

    // output: Array ( [bar] => bar ) when the form is submitted

And here is the discussion about it in the HTML4 spec: http://www.w3.org/TR/html4/interact/forms.html#h-17.12:

"In this example, the INPUT element is disabled. Therefore, it cannot receive user input nor will its value be submitted with the form."

And the same is tru for HTML5: http://www.w3.org/TR/html5/association-of-controls-and-forms.html#constructing-form-data-set

---------------------------------------------------------------------------

by cordoval at 2011/08/23 01:29:53 -0700

@fabpot I guess you got my scenario wrong. I am not trying to submit any form. I am just happen to have a disabled box that is checked and I want to read with the DOM Crawler that is checked. Not to submit or anything but for the purposes of testing.

Please consider also that this request comes from asserting values using behat mink, mink is fully dependent on sf2 driver for when it is used except it is told to use a different driver like a real browser like sahi. When testing in chrome and firefox, the verification with the DOM is made that the disabled box is checked properly. Symfony2 DOM Crawler however misses that spot for that use.

Even in the case where Symfony2 DOM Crawler component would have been thought not for this purpose of testing, or further for this particular scenario it would be good to make it more reusable for this kind of scenario.

Just saying....

---------------------------------------------------------------------------

by fabpot at 2011/08/23 02:00:34 -0700

Indeed, I didn't get your issue right. So, basically, all fields should be in the form, but the disabled field values should not be submitted (that makes sense).

I've prepared a fix in this patch: e8852586073bc23d4a41f4cd9cbe0d17a2f0c76d which is in the symfony/domcrawler-disabled-fields branch for now as I don't know if we can make this change in 2.0 or if we need to put it in 2.1.

---------------------------------------------------------------------------

by cordoval at 2011/08/23 02:15:01 -0700

oh no I was hoping to enter the authors, you already did the fix :'(
2011-08-23 11:21:17 +02:00
..
BrowserKit merged branch sasezaki/BrowserKit_useragent (PR #1789) 2011-07-26 09:21:10 +02:00
ClassLoader [ClassLoader] fixed CS 2011-08-13 10:30:20 +02:00
Config [Config] removed extra whitespace. 2011-07-01 09:35:17 +02:00
Console Revert "expanded namespaces within phpdoc (special for PhpStorm)" 2011-08-13 19:27:36 +02:00
CssSelector [CssSelector] fixed exception namespace 2011-06-29 19:11:00 +02:00
DependencyInjection [DependencyInjection] tagged the public @api 2011-07-20 10:50:27 +02:00
DomCrawler merged branch cordoval/patch-1 (PR #1890) 2011-08-23 11:21:17 +02:00
EventDispatcher [EventDispatcher] Change the license of EventDispatcher from LGPL to MIT 2011-08-21 14:32:21 +02:00
Finder [Finder] added a convenience method Finder::create() 2011-06-14 14:18:24 +02:00
Form merged branch stloyd/issue_1986 (PR #2000) 2011-08-23 08:44:09 +02:00
HttpFoundation merged branch martinmayer/session_saving (PR #1937) 2011-08-19 14:17:33 +02:00
HttpKernel Revert "expanded namespaces within phpdoc (special for PhpStorm)" 2011-08-13 19:27:36 +02:00
Locale [Locale] fixed CS 2011-06-24 01:49:48 +02:00
Process [Process] fixed CS 2011-07-12 08:16:22 +02:00
Routing Revert "expanded namespaces within phpdoc (special for PhpStorm)" 2011-08-13 19:27:36 +02:00
Security merged branch Abhoryo/patch-1 (PR #1956) 2011-08-23 08:52:35 +02:00
Serializer Added $format in serialize() method, to keep consistence and give a hint to the normalizer. 2011-08-12 12:01:28 +03:00
Templating [Templating] tagged the public @api 2011-07-20 10:27:25 +02:00
Translation removed usage of \Exception as PHPUnit won't allow to catch them anymore in the next major version 2011-07-11 11:54:00 +02:00
Validator merged branch hidenorigoto/validator_pattern_late_static_bind (PR #1914) 2011-08-19 14:11:41 +02:00
Yaml [Yaml] made a small optimization 2011-08-22 15:06:47 +02:00