Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions api/src/org/labkey/api/query/QueryForeignKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,20 @@ public TableInfo getLookupTableInfo()
return _table;
}

@Override
public SchemaKey getLookupSchemaKey()
{
if (_lookupSchemaKey != null)
{
return _lookupSchemaKey;
}
if (_schema != null)
{
return _schema.getSchemaPath();
}
return super.getLookupSchemaKey();
}

@Override
protected QuerySchema getLookupSchema()
{
Expand Down
5 changes: 5 additions & 0 deletions api/src/org/labkey/api/query/QuerySchema.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ default ContainerFilter getDefaultLookupContainerFilter()
@NotNull
String getSchemaName();

default SchemaKey getSchemaPath()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UserSchema already has getPath(), we should probably use that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad it has both getPath() and getSchemaPath(). That doesn't seem like a good idea.

{
return SchemaKey.decode(getSchemaName());
}

/** @return short description of the content and purpose of the schema */
@Nullable String getDescription();

Expand Down
8 changes: 2 additions & 6 deletions api/src/org/labkey/api/query/UserSchema.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,7 @@ public UserSchema(@NotNull SchemaKey path, @Nullable String description, User us
{
return _name;
}

public SchemaKey getPath()
{
return _path;
}


@Override
@Nullable
public String getDescription()
Expand Down Expand Up @@ -374,6 +369,7 @@ public List<TableInfo> getSortedTables()
return _path.toString();
}

@Override
public SchemaKey getSchemaPath()
{
return _path;
Expand Down
4 changes: 2 additions & 2 deletions query/src/org/labkey/query/QueryServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -1160,7 +1160,7 @@ else if (MODULE_QUERIES_DIRECTORY.equals(path.get(0)))

for (CustomView view : qd.getSchema().getModuleCustomViews(container, qd))
{
Path key = new Path(schema.getPath().toString(), view.getQueryDefinition().getName(), StringUtils.defaultString(view.getName(), ""));
Path key = new Path(schema.getSchemaPath().toString(), view.getQueryDefinition().getName(), Objects.toString(view.getName(), ""));
if (!views.containsKey(key))
views.put(key, view);
}
Expand All @@ -1172,7 +1172,7 @@ else if (MODULE_QUERIES_DIRECTORY.equals(path.get(0)))
// custom views in the database get highest precedence, so let them overwrite the module-defined views in the map
for (CstmView cstmView : QueryManager.get().getAllCstmViews(container, null, null, owner, inheritable, sharedOnly))
{
Path key = new Path(cstmView.getSchema(), cstmView.getQueryName(), StringUtils.defaultString(cstmView.getName(), ""));
Path key = new Path(cstmView.getSchema(), cstmView.getQueryName(), Objects.toString(cstmView.getName(), ""));
// The database custom views are in priority order so check if the view has already been added
if (!views.containsKey(key))
{
Expand Down
10 changes: 7 additions & 3 deletions query/webapp/query/browser/view/QueryDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -849,10 +849,14 @@ Ext4.define('LABKEY.query.browser.view.QueryDetails', {
scope : this,
fn : function(cmp) {
cmp.getEl().mask('loading dependencies');
this.queriesCache.load(null, this.refreshQueryDependencies, function(error) {
this.queriesCache.load(null, this.refreshQueryDependencies, LABKEY.Utils.getCallbackWrapper(function(error) {
this.removeQueryDependencies();
this.onLoadError(error);
}, this);
this.getContent().add({
xtype : 'box',
itemId : 'lk-dependency-report',
html : '<br/>Failed to load dependency information. ' + Ext4.htmlEncode(error.exception ? error.exception : ''),
});
}, this, true), this);
}
}
}
Expand Down