Skip to content
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

Funky textField values when passing a list to select(options=list) #663

Closed
chrisdpeters opened this issue Aug 17, 2016 · 12 comments
Closed
Labels
Milestone

Comments

@chrisdpeters
Copy link
Contributor

chrisdpeters commented Aug 17, 2016

This is generally what I'm doing with a select in CFWheels 1.4.5 on CF9:

<cfoutput>

#select(
  objectName="foo",
  property="bar",
  options="Website,Website (SP Referral),All AIMS users,FTRI staff,RDC",
  includeBlank="-- Add submitters --"
)#

</cfoutput>

But the list of options generated ends up looking like this:

<option value="">-- All submitters --</option>
<option value="Website">Website</option>
<option value="Website (SP Referral)">Website ( SP Referral)</option>
<option value="All AIMS users">All  AIMSusers</option>
<option value="FTRI staff">FTRIstaff</option>
<option value="RDC">RDC</option>

Notice that the values are OK, but there's weird stuff going on with spaces in the text displayed.

I doubt this makes a difference, but the list is being returned by a function. I don't see why that would matter though.

@perdjurner perdjurner added the bug label Aug 17, 2016
@perdjurner perdjurner added this to the 2.0.0 milestone Aug 17, 2016
@perdjurner perdjurner self-assigned this Aug 19, 2016
perdjurner added a commit that referenced this issue Aug 19, 2016
@kmd1970
Copy link

kmd1970 commented Oct 16, 2017

Is there a fix for this in version 1.4.6, for people who haven't made the jump to 2.0 as yet?

@perdjurner
Copy link
Contributor

Yes there is.

@neokoenig
Copy link
Contributor

https://github.com/cfwheels/cfwheels/releases/tag/v1.4.6
"Made humanize() keep spaces in input."

Nice one @perdjurner

@kmd1970
Copy link

kmd1970 commented Oct 16, 2017

I tested 1.4.6 before I posted. Looks like the issue remains.

img

@kmd1970
Copy link

kmd1970 commented Oct 16, 2017

FYI, my company firewall blocks the "cfwheels.1.4.6.zip" link for some reason, so I used the "Source code (zip)" link to download 1.4.6. Are they different?

@perdjurner
Copy link
Contributor

File content should be the same (in terms of relevant code anyway).
Perhaps we didn't get the fix done properly then.
Are you able to run that test code you posted on Wheels 2.0 and see if it works?
Just want to make sure which versions are broken exactly.

Thanks.

@kmd1970
Copy link

kmd1970 commented Oct 16, 2017

My localhost is not worthy of 2.0. :)
"Adobe ColdFusion 11,0,08,298512 is not supported by CFWheels."

Also, set(disableEngineCheck=true); in settings.cfm doesn't work.
Edit: This worked in URL, /index.cfm?reload=development&disableEngineCheck=true

@perdjurner perdjurner reopened this Oct 16, 2017
@kmd1970
Copy link

kmd1970 commented Oct 16, 2017

Ok, I was able to verify it's still broken in 2.0. Sorry for the delay.

@perdjurner perdjurner modified the milestones: 2.0.0, 2.0.1 Oct 16, 2017
@kmd1970
Copy link

kmd1970 commented Oct 16, 2017

This may fix the issue with Humanize()

// add a space before every capitalized word
loc.rv = REReplace(arguments.text, "([[:upper:]])", " \1", "all");
// remove space after punctuation chars *Added*
loc.rv = REReplace(loc.rv, "([[:punct:]])([[:space:]])", "\1", "all");

Edit: removed the + to handle multiple punctuation characters like in Website (( SP Referral))

@perdjurner perdjurner removed their assignment Oct 17, 2017
@kmd1970
Copy link

kmd1970 commented Oct 25, 2017

Found another issue.

//test
#humanize("All AIMS users")#<br>
#humanize("FTRI staff")#<br>

//will output
All AIMSusers
FTRIstaff

Replace

// fix abbreviations so they form a word again (example: aURLVariable)
local.rv = REReplace(local.rv, "([[:upper:]]) ([[:upper:]])(?:\s|\b)", "\1\2", "all");

with

// fix abbreviations so they form a word again (example: aURLVariable)
local.rv = REReplace(local.rv, "([[:upper:]]) ([[:upper:]])(?:\s|\b)(?![a-z])", "\1\2", "all");

//test
#humanize("Website (SP Referral)")#<br>
#humanize("Website ( SP Referral )")#<br>
#humanize("Website (( SP Referral))")#<br>
#humanize("All AIMS users")#<br>
#humanize("FTRI staff")#<br>
#humanize("aURLVariable")#<br>
#humanize("wheelsIsAFramework")#

//will output
Website (SP Referral)
Website ( SP Referral )
Website (( SP Referral))
All AIMS users
FTRI staff
A URL Variable
Wheels Is A Framework 

@perdjurner
Copy link
Contributor

perdjurner commented Oct 25, 2017 via email

@kmd1970
Copy link

kmd1970 commented Oct 25, 2017

Oops, you are correct.

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

No branches or pull requests

4 participants