Skip to content

Commit

Permalink
fix: download fails with empty $expand parameter (#703)
Browse files Browse the repository at this point in the history
  • Loading branch information
marianfoo authored Feb 7, 2025
1 parent 6fe3c90 commit 0a930c2
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/opa5-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
with:
ref: ${{ github.head_ref }}

- run: corepack enable pnpm
- run: npm i -g --force corepack && corepack enable
- name: use node 20
uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
ui5-test-runner --url http://localhost:${{ env.TESTAPPPORT }}/test/integration/opaTests.qunit.html --screenshot false
- name: upload artifact of report folder
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ui5testrunner-report-${{ matrix.scenario }}-${{ matrix.ui5version }}
path: ./report
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ui5-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
with:
ref: ${{ github.head_ref }}

- run: corepack enable pnpm
- run: npm i -g --force corepack && corepack enable
- name: use node 20
uses: actions/setup-node@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wdi5-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
with:
ref: ${{ github.head_ref }}

- run: corepack enable pnpm
- run: npm i -g --force corepack && corepack enable
- name: use node 20
uses: actions/setup-node@v4
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,15 +278,25 @@ export default class ODataV4 extends OData {
}

getBindingFromBinding(binding: ODataListBinding, expand?: any): ODataListBinding {
const expandParameter = expand ? expand : "";
let path = binding.getPath();
if (binding.getResolvedPath) {
path = binding.getResolvedPath();
} else {
// workaround for getResolvedPath only available from 1.88
path = (binding.getModel() as ODataModel).resolve(binding.getPath(), binding.getContext());
}
return binding.getModel().bindList(path, null, [], [], { $$updateGroupId: this.updateGroupId, $count: true, $expand: expand }) as ODataListBinding;

const bindingParameters: any = {
$$updateGroupId: this.updateGroupId,
$count: true
};

// Only add $expand if it exists and is not empty
if (expand && Object.keys(expand).length > 0) {
bindingParameters.$expand = expand;
}

return binding.getModel().bindList(path, null, [], [], bindingParameters) as ODataListBinding;
}

fetchBatch(customBinding: ODataListBinding, batchSize: number): Promise<any> {
Expand Down

0 comments on commit 0a930c2

Please sign in to comment.