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

Tw2.core 2.1.5 and TurboGears 2.2.2 webob version conflicts leads to multiselect widget bugs #77

Closed
g02Gesanto opened this issue Mar 15, 2013 · 3 comments

Comments

@g02Gesanto
Copy link

Hello, there appears to be a version synchronization issue with TurboGears 2.2.2, the most current version as of writing this, and tw2.core 2.1.5, also the current version of tw2.core.

TurboGears 2.2.2 requires WebOb version 1.1.1 which uses the UnicodeMultiDict to store request params. It appears that WebOb >= 1.2 has since replaced the UnicodeMultiDict with the MultiDict object and tw2 has correctly accommodated for this change but tg2 hasn't.

Because current version of tg2 and tw2 are dependent on different versions of webob, this causes a nasty bug where multiselect widgets in tg2 are only able to save one value.

I think the simplest fix would be to modify the "Hack" for webob versions at the top of tw2.core.validation from (line 13) from:

if not hasattr(webob, 'MultiDict'):
webob.MultiDict = webob.multidict.MultiDict

to:

if not hasattr(webob, 'MultiDict'):

Check for webob versions with UnicodeMultiDict

if hasattr(webob.multidict,'UnicodeMultiDict'):
    webob.MultiDict = webob.multidict.UnicodeMultiDict
else:
    webob.MultiDict = webob.multidict.MultiDict

I tested this and it works. It would be awesome if we can keep tg2 and tw2 compatible!

Thanks
Gregg

@ralphbean
Copy link
Contributor

Thanks, @g02Gesanto. Does that look like I put your change in correctly?

@g02Gesanto
Copy link
Author

That's it, thanks a lot for the quick response!

@ralphbean
Copy link
Contributor

Cool. 😄

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

No branches or pull requests

2 participants