commit | c8f311b9f978fea8dfca1bb5755f66c369e01a94 | [log] [tgz] |
---|---|---|
author | Edwin Kempin <ekempin@google.com> | Thu Jun 23 12:00:00 2016 +0200 |
committer | Edwin Kempin <ekempin@google.com> | Thu Jun 23 10:54:25 2016 +0000 |
tree | 257f0bd58ead73812cd3619349e3a1421f10e97a | |
parent | 09034c03f1f6500c9a88933286fc12f4bb744771 [diff] |
RemoteSuggestOracle: Fix JavaScript TypeError If Gerrit is configured to show suggestions only after typing n characters (see gerrit config parameter suggest.from) typing characters in the suggest box causes a JavaScript TypeError while n characters are not reached yet: Caused by: Class$S146: (TypeError) : Cannot read property 'start_5' of undefined at Unknown.onSuggestionsReady_2(gerrit_ui-0.js) at Unknown.onSuggestionsReady_4(gerrit_ui-0.js) at Unknown.onRequestSuggestions_0(gerrit_ui-0.js) at Unknown.requestSuggestions(gerrit_ui-0.js) at Unknown.start_5(gerrit_ui-0.js) at Unknown.requestSuggestions_0(gerrit_ui-0.js) at Unknown.showSuggestions_0(gerrit_ui-0.js) at Unknown.refreshSuggestions(gerrit_ui-0.js) at Unknown.onKeyUp_5(gerrit_ui-0.js) ... This is because the query is started before assigning it to the 'query' variable, which the callback expects to be non-null. If n characters are not typed yet, there is no remote call and the callback is immediately invoked with empty results as soon as the query is started. This means the 'query' variable is still not set and this results in the TypeError as shown above. If a remote call was done to get the suggestions, there was no problem, because then the callback was always invoked after the 'query' variable has been assigned. Change-Id: Ia41102a8cc87237b9e7ed728259daf2b6b86996c Signed-off-by: Edwin Kempin <ekempin@google.com>
Gerrit is a code review and project management tool for Git based projects.
Gerrit makes reviews easier by showing changes in a side-by-side display, and allowing inline comments to be added by any reviewer.
Gerrit simplifies Git based project maintainership by permitting any authorized user to submit changes to the master Git repository, rather than requiring all approved changes to be merged in by hand by the project maintainer.
For information about how to install and use Gerrit, refer to the documentation.
Our canonical Git repository is located on googlesource.com. There is a mirror of the repository on Github.
Please report bugs on the issue tracker.
Gerrit is the work of hundreds of contributors. We appreciate your help!
Please read the contribution guidelines.
Note that we do not accept Pull Requests via the Github mirror.
The IRC channel on freenode is #gerrit. An archive is available at: echelog.com.
The Developer Mailing list is repo-discuss on Google Groups.
Gerrit is provided under the Apache License 2.0.
Install Buck and run the following:
git clone --recursive https://gerrit.googlesource.com/gerrit cd gerrit && buck build release
The instruction how to configure GerritForge/BinTray repositories is here
On Debian/Ubuntu run:
apt-get update & apt-get install gerrit=<version>-<release>
NOTE: release is a counter that starts with 1 and indicates the number of packages that have been released with the same version of the software.
On CentOS/RedHat run:
yum clean all && yum install gerrit-<version>[-<release>]
NOTE: release is optional. Last released package of the version is installed if the release number is omitted.