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

Remove spaces at start and end of text field values. #20

Merged
merged 3 commits into from Jun 9, 2014
Merged

Remove spaces at start and end of text field values. #20

merged 3 commits into from Jun 9, 2014

Conversation

tdesvenain
Copy link
Contributor

No description provided.

@tdesvenain
Copy link
Contributor Author

Hi, do you agree with this pull request ?
Thanks

Thomas

@@ -46,6 +46,8 @@ def toFieldValue(self, value):
"""See interfaces.IDataConverter"""
if value == u'':
return self.field.missing_value
if value is not None:
value = value.strip()
Copy link
Member

Choose a reason for hiding this comment

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

So '' is converted to self.field.missing_value but ' ' is converted to ''. Does that make sense?

(I don't know, I must admit I never understood missing values).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right ! i will intervert 49-50 and 47-48

@mgedmin
Copy link
Member

mgedmin commented Apr 19, 2014

Other than that question, this looks good to me.

It is, however, backwards-incompatible. Is that important? I don't know! Is anyone out there relying on extra spaces in text fields being preserved? I don't know! Therefore I'm not going to be the one who merges this.

@tdesvenain
Copy link
Contributor Author

Hi, i considered mgedmin diff

Anyone could review/merge the pull request ?

Thanks
cc @vincentfretin

@tdesvenain
Copy link
Contributor Author

Hi, can we merge this ?
cc @vincentfretin

@agroszer
Copy link
Contributor

agroszer commented Jun 3, 2014

The biggest question is "Is anyone out there relying on extra spaces in text fields being preserved?"
The problem is that this change is at the very bottom -- quite hard to override.
Let's think about to provide BBB. Very very worst case add a module global that switches off strip'ing.

@tdesvenain
Copy link
Contributor Author

Hi @agroszer i added a class variable to do that. Is it ok now ?
Personnaly, I think that preserving extra spaces is very uncommon, and I never saw such a case. Whereas we have many cases where preserving them generates unexpected behaviour, for example when we copy-paste an email and we save it with an extra space.

@strichter
Copy link
Contributor

In general I am for accepting the patch. I do not have time for the merge and release, but Adam, feel free to do so.

@agroszer agroszer merged commit e1baf77 into zopefoundation:master Jun 9, 2014
@tdesvenain
Copy link
Contributor Author

Thanks !

2014-06-09 15:09 GMT+02:00 Adam Groszer notifications@github.com:

Merged #20 #20.

Reply to this email directly or view it on GitHub
#20 (comment).

Thomas Desvenain

Téléphone : 09 51 37 35 18

@thet
Copy link
Member

thet commented Jun 13, 2014

that merge broke tests in Plone, in which tests' we rely on spaces in fields. for a discussion on this see: plone/plone.app.portlets@a8330bd#commitcomment-6667480

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.

None yet

5 participants