Master magic input bc #909

Merged
merged 4 commits into from Oct 25, 2012

Conversation

Projects
None yet
3 participants
Member

ADmad commented Oct 23, 2012

How about moving the new tests to a more appropriate function than testInputWithMatchingFieldAndModelName()

Member

dereuromark commented Oct 23, 2012

what do you propose?

testInputWithMagicSelect()

Member

ADmad commented Oct 23, 2012

testInputWithMagicSelectForNumericField() 😄

Member

dereuromark commented Oct 23, 2012

testInputMagicSelectForTypeNumber - as testInputMagicSelectChangeToRadio comes next then

lib/Cake/View/Helper/FormHelper.php
}
$autoLength = (
!array_key_exists('maxlength', $options) &&
isset($fieldDef['length']) &&
- is_scalar($fieldDef['length'])
+ is_scalar($fieldDef['length']) &&
+ $options['type'] !== 'select'
@markstory

markstory Oct 23, 2012

Owner

Funny whitespace here.

Owner

markstory commented Oct 23, 2012

So if I understand the point of this, it allows fields with the inferred type of number/text that have matching inflected variables to create select boxes? Doesn't that create the possibility of inputs that used to be text/number to magically swap into select boxes when upgrading?

Member

dereuromark commented Oct 23, 2012

well, the current way of doing things breaks BC for sure. at least compared to 1.3. as my lighthouseapp example shows.
new cake2.x apps could possibly run into your issue, yes.

Owner

markstory commented Oct 23, 2012

Ah I missed the link to the lighthouse issue. With that information I think this makes a bit more sense to fix then.

markstory added a commit that referenced this pull request Oct 25, 2012

@markstory markstory merged commit 555bfc3 into cakephp:master Oct 25, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment