Skip to content

Commit

Permalink
Avoid ApplicationSession.get() and always use the session from a wick…
Browse files Browse the repository at this point in the history
…et page. Trying to fix #231
  • Loading branch information
Willem Elbers committed Oct 31, 2024
1 parent 67912de commit 41ac766
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class BrowsePrivateCollectionsPage extends BasePage {

public BrowsePrivateCollectionsPage() {
final BrowseEditableCollectionsPanel pnl =
new BrowseEditableCollectionsPanel("collections", new PrivateCollectionsProvider(), getPageReference());
new BrowseEditableCollectionsPanel("collections", new PrivateCollectionsProvider(getSession()), getPageReference());
pnl.setOutputMarkupId(true);
add(pnl);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public MergeCollectionsPage(PageParameters params) throws VirtualCollectionRegis
throw new RestartResponseException(ErrorPage.class);
}

this.provider = new PrivateCollectionsProvider();
this.provider = new PrivateCollectionsProvider(getSession());

addLabel(this, "heading_submitted_collection");
addLabel(this, "heading_actions");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,15 @@
@SuppressWarnings("serial")
public class PrivateCollectionsProvider extends CollectionsProvider {

private final ApplicationSession session;

public PrivateCollectionsProvider(final ApplicationSession session) {
this.session = session;
}

@Override
protected void addSpaceFilter(QueryOptions.Filter filter) {
ApplicationSession session = ApplicationSession.get();
//ApplicationSession session = ApplicationSession.get();
filter.add(QueryOptions.Property.VC_OWNER,
QueryOptions.Relation.EQ,
session.getUser());
Expand Down

0 comments on commit 41ac766

Please sign in to comment.