Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Fieldset ignore disabled elements #6295

Merged

Conversation

scroach
Copy link
Contributor

@scroach scroach commented May 20, 2014

As discussed in #6143 - in my opinnion disabled elements should be automatically ignored by zf2.

I've changed Fieldset to extract the original value from the bound object and also added a unit test.

@Ocramius Ocramius self-assigned this Jul 28, 2014
@Ocramius Ocramius added this to the 2.3.2 milestone Jul 28, 2014
@Ocramius
Copy link
Member

Re-assigning to @weierophinney for review as per discussion in #6143

@Ocramius Ocramius assigned weierophinney and unassigned Ocramius Jul 28, 2014
weierophinney added a commit that referenced this pull request Aug 7, 2014
weierophinney added a commit that referenced this pull request Aug 7, 2014
@weierophinney weierophinney merged commit 63255db into zendframework:master Aug 7, 2014
weierophinney added a commit that referenced this pull request Aug 7, 2014
@ZeinEddin
Copy link
Contributor

This issue spawned a new bug: #6585

@@ -584,7 +585,12 @@ public function bindValues(array $values = array())
$value = $element->bindValues($value);
}

$hydratableData[$name] = $value;
// skip post values for disabled elements, get old value from object
if(!$element->hasAttribute('disabled')) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should verify with getAttribute instead of hasAttribute in my case, disabled is false but already exists!

@andreigabreanu
Copy link

This also broke for me a form where I had continue_if_empty on the input set to true. I wanted to run a validator on an element composer of other elements. So I added the element, its NOT disabled and is required, but I don't want to throw the Not Empty validator error.

Need to start digging for what changed and how it impacted my code. Meh...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants