Merge lp:~deryck/launchpad/bug-description-fixes-opera-414755 into lp:launchpad

Proposed by Deryck Hodge
Status: Merged
Approved by: Barry Warsaw
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~deryck/launchpad/bug-description-fixes-opera-414755
Merge into: lp:launchpad
Diff against target: None lines
To merge this branch: bzr merge lp:~deryck/launchpad/bug-description-fixes-opera-414755
Reviewer Review Type Date Requested Status
Barry Warsaw (community) code Approve
Review via email: mp+10547@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Deryck Hodge (deryck) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Bug 414755 reports a problem with the inline description editing widget
not working properly in Opera. This branch disables the editor widget
for Opera (for now) because the fix could be quite involved.

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  lib/canonical/widgets/lazrjs.py

== Pylint notices ==

lib/canonical/widgets/lazrjs.py
    352: [W0102, vocabulary_to_choice_edit_items] Dangerous default
value [] as argument
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkqO77MACgkQ4glRK0DaE8hNZACglsQNRHKn28tWmV6Mgf1EXeoG
hH0AoMwixo7Ml6vCiEnn5QYYpI6X5GBK
=Sb/r
-----END PGP SIGNATURE-----

Revision history for this message
Barry Warsaw (barry) wrote :

> Bug 414755 reports a problem with the inline description editing widget
> not working properly in Opera. This branch disables the editor widget
> for Opera (for now) because the fix could be quite involved.

Could you perhaps update the bug with some thoughts about how you'd go about
fixing this in the future? I have but don't use Opera, but it's still a
bummer to have to disable this.

> = Launchpad lint =
>
> Checking for conflicts. and issues in doctests and templates.
> Running jslint, xmllint, pyflakes, and pylint.
> Using normal rules.
>
> Linting changed files:
> lib/canonical/widgets/lazrjs.py
>
>
> == Pylint notices ==
>
> lib/canonical/widgets/lazrjs.py
> 352: [W0102, vocabulary_to_choice_edit_items] Dangerous default
> value [] as argument

This isn't your code, but here's a suggested change in case you want to clean this up while you're here.

=== modified file 'lib/canonical/widgets/lazrjs.py'
--- lib/canonical/widgets/lazrjs.py 2009-08-10 21:05:33 +0000
+++ lib/canonical/widgets/lazrjs.py 2009-08-21 19:27:50 +0000
@@ -348,7 +348,7 @@

 def vocabulary_to_choice_edit_items(
- vocab, css_class_prefix=None, disabled_items=[], as_json=False,
+ vocab, css_class_prefix=None, disabled_items=None, as_json=False,
     name_fn=None, value_fn=None):
     """Convert an enumerable to JSON for a ChoiceEdit.

@@ -359,6 +359,8 @@
     :name_fn: A function receiving an item and returning its name.
     :value_fn: A function receiving an item and returning its value.
     """
+ if disabled_items is None:
+ disabled_items = []
     items = []
     for item in vocab:
         if name_fn is not None:

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/widgets/lazrjs.py'
2--- lib/canonical/widgets/lazrjs.py 2009-08-10 21:05:33 +0000
3+++ lib/canonical/widgets/lazrjs.py 2009-08-21 18:58:33 +0000
4@@ -229,7 +229,9 @@
5 }
6 }
7 }});
8- widget.render();
9+ if (!Y.UA.opera) {
10+ widget.render();
11+ }
12 });
13 </script>
14 """)