Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filtering ZIO on informatieobject with CMIS enabled doesnt work #820

Closed
SilviaAmAm opened this issue Jan 14, 2021 · 0 comments · Fixed by #821
Closed

Filtering ZIO on informatieobject with CMIS enabled doesnt work #820

SilviaAmAm opened this issue Jan 14, 2021 · 0 comments · Fixed by #821
Assignees
Labels
bug Something isn't working

Comments

@SilviaAmAm
Copy link
Contributor

Describe the bug
Filtering ZaakInformatieObject on informatieobject when CMIS is enabled returns ZaakInformatieObject that are not related to the requested document.

The tests for filtering have the following pattern (both in the case of CMIS enabled and disabled):

  1. Create a document
  2. Create a zaak
  3. Relate the document and the zaak by creating a ZaakInformatieObject
  4. List the ZaakInformatieObject in the API filtering on the document created in 1.

Since there is only 1 ZaakInformatieObject, the test passes.

To Reproduce
This test should be modified as follows:

def test_filter_by_informatieobject(self):
    self.create_zaak_besluit_services()
    zaak = self.create_zaak()

    # Create two ZIOs
    eio1 = EnkelvoudigInformatieObjectFactory.create()
    eio1_url = f"http://example.com{reverse(eio1)}"
    self.adapter.get(eio1_url, json=serialise_eio(eio1, eio1_url))

    ZaakInformatieObjectFactory.create(informatieobject=eio1_url, zaak=zaak)

    eio2 = EnkelvoudigInformatieObjectFactory.create()
    eio2_url = f"http://example.com{reverse(eio2)}"
    self.adapter.get(eio2_url, json=serialise_eio(eio2, eio2_url))

    ZaakInformatieObjectFactory.create(informatieobject=eio2_url, zaak=zaak)

    zio_list_url = reverse("zaakinformatieobject-list")

    # Test that only 1 of the 2 ZIOs is returned
    response = self.client.get(
        zio_list_url, {"informatieobject": eio1_url}, HTTP_HOST="example.com",
    )

    self.assertEqual(response.status_code, 200)
    self.assertEqual(len(response.data), 1)
    self.assertEqual(response.data[0]["informatieobject"], eio1_url)

Expected behavior
When filtering the ZaakInformatieObject on the informatieobject only the objects that relate to the requested document should be returned.

@SilviaAmAm SilviaAmAm added the bug Something isn't working label Jan 14, 2021
@SilviaAmAm SilviaAmAm self-assigned this Jan 14, 2021
SilviaAmAm added a commit that referenced this issue Jan 14, 2021
SilviaAmAm added a commit that referenced this issue Jan 14, 2021
When the ZIOs are filtered on informatieobject, the URL should be used
rather than the canonical instance.
SilviaAmAm added a commit that referenced this issue Jan 14, 2021
SilviaAmAm added a commit that referenced this issue Jan 14, 2021
When the ZIOs are filtered on informatieobject, the URL should be used
rather than the canonical instance.
SilviaAmAm added a commit that referenced this issue Feb 10, 2021
SilviaAmAm added a commit that referenced this issue Feb 10, 2021
When the ZIOs are filtered on informatieobject, the URL should be used
rather than the canonical instance.
@sergei-maertens sergei-maertens added this to To do in Community support via automation Feb 14, 2021
Community support automation moved this from To do to Done Mar 11, 2021
sergei-maertens added a commit that referenced this issue Mar 11, 2021
Fixes #820 - Filtering ZIOs on informatieobject with CMIS enabled
@felixfaassen felixfaassen added this to Incoming Feature Request in OpenZaak Product Backlog Mar 30, 2021
sergei-maertens pushed a commit that referenced this issue Apr 15, 2021
sergei-maertens pushed a commit that referenced this issue Apr 15, 2021
When the ZIOs are filtered on informatieobject, the URL should be used
rather than the canonical instance.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
OpenZaak Product Backlog
Incoming Feature Request
Development

Successfully merging a pull request may close this issue.

1 participant