Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(36)

Issue 2977041: set userPrefs key with wrong default value in DefaultIframeUriManager for new common container

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 5 months ago by Kai Feng Zhang
Modified:
13 years, 5 months ago
Reviewers:
Paul Lindner, dev-remailer, Han Nguyen
Base URL:
http://svn.apache.org/repos/asf/shindig/trunk
Visibility:
Public.

Description

When using new common container to render gadget, the ifr request url will be from gadget metadata request. At the back end, method makeRenderingUri() will be called on DefaultIframeUriManager class to generate the ifr url. In this method, there are following code snippet to add default user prefs into url. // Add all UserPrefs UserPrefs prefs = context.getUserPrefs(); for (UserPref up : gadget.getSpec().getUserPrefs().values()) { String name = up.getName(); String data = prefs.getPref(name); if (data == null) { data = up.getDefaultValue(); } boolean upInFragment = !view.needsUserPrefSubstitution(); addParam(uri, UriCommon.USER_PREF_PREFIX + up.getName(), data, useTpl, upInFragment); } Such as if gadget spec xml defined a pref named "mycolor" with default value "Green", but the addParam method will change the "mycolor" value to "%up_mycolor%" because useTpl is true. Thus, ifr url will be requested with all invalid user prefs values. And when you try to get some default value from user prefs, it return invalid value.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -1 line) Patch
java/gadgets/src/main/java/org/apache/shindig/gadgets/uri/DefaultIframeUriManager.java View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 2
Kai Feng Zhang
13 years, 5 months ago (2010-11-08 06:56:08 UTC) #1
Kai Feng Zhang
13 years, 5 months ago (2010-11-08 06:59:49 UTC) #2
On 2010/11/08 06:56:08, Kai Feng Zhang wrote:

JIRA: https://issues.apache.org/jira/browse/SHINDIG-1465
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b