Status

RESOLVED FIXED
8 years ago
8 years ago

People

(Reporter: mspear, Unassigned)

Tracking

Details

Attachments

(1 attachment)

(Reporter)

Description

8 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.1 (KHTML, like Gecko) Chrome/6.0.437.3 Safari/534.1
Build Identifier: tip (changeset:   1980:f583805647a7)

The settings persister object is set after all the plugin data is loaded in loginController in userident/index.js 

While loading the plugins, however, in registerMetadata() (bespin/plugins.js) there is a usage of util.clone() that is called on something that is undefined. The result is util.clone() throwing an Exception ("object is undefined" / "Uncaught TypeError: Cannot read property 'clone' of undefined"), preventing loginController from continuing and setting the Persister.

This was another easy fix. Instead of the current
  if (object.clone && typeof(object.clone) === 'function') {
Use:
  if (object && typeof(object.clone) === 'function') {

At least I think that will always work, as testing for object.clone is redundant. Even if object.clone is not defined typeof will still work on it (assuming object *is* defined in the first place (which I now test for), even if object is a number or boolean)


Reproducible: Always

Steps to Reproduce:
1. Use a fresh copy of bespin (I haven't pinpointed how "fresh" the copy needs to be. It might happen even in a well worn in copy. On the other hand you might need to clear local storage/cookies, and work off fresh clones (and run the usual bootstrap and paver incantations, perhaps even with a new server.port so the browser thinks it is a new site))
2. "set theme white" (or any setting you desire to use)
3. refresh
4. See the standard theme
Actual Results:  
Default settings are used

Expected Results:  
Saved/persisted settings should be used
(Reporter)

Comment 1

8 years ago
Created attachment 454920 [details] [diff] [review]
Prevent trying to access clone property of an undefined object. (Fixes a problem preventing usage of persisted settings)

Updated

8 years ago
Summary: Bespin not using persisted settings → Clone of undefined fails

Comment 2

8 years ago
Pushed in b9bb8bd133ca, thanks!
Status: UNCONFIRMED → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.