Uploaded image for project: 'Offre de formation'
  1. Offre de formation
  2. ODF-131

The root org unit provider throws an exception on live workspace when the root org unit is not validated

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.0
    • None
    • Composantes
    • None

      When calling RootOrgUnitProvider.getRoot(), the provider gets the OrgUnit by stored node ID (in the "default" workspace), which means the "back-office" object is returned whether we call it from the "default" or "live" workspace. This can lead to UnknownAmetysObjectException.
      Moreover, when calling getSubOrgUnits(), we get IDs of contents that are not validated, and therefore not present in the live workspace.

      This snippet from the ODF search service

      ODFSearch.java
      OrgUnit mainOu = _rootOrgUnitProvider.getRoot();
      [...]
      Collection<String> childrenIDs = mainOu.getSubOrgUnits();
      for (String id : childrenIDs)
      {
          OrgUnit ou = _resolver.resolveById(id);
          [...]
      }
      

      should cause the following unknown object exception when called in the live version/front-office if either the root org unit or one of its children is not yet validated:

      Caused by: org.ametys.plugins.repository.UnknownAmetysObjectException: There's no node for id orgunitContent://003d2e03-2ef4-4137-907d-79115a440c50
      	at org.ametys.plugins.repository.jcr.SimpleAmetysObjectFactory.getNode(SimpleAmetysObjectFactory.java:170)
      	at org.ametys.plugins.repository.jcr.SimpleAmetysObjectFactory.getAmetysObjectById(SimpleAmetysObjectFactory.java:117)
      	at org.ametys.plugins.repository.jcr.SimpleAmetysObjectFactory.getAmetysObjectById(SimpleAmetysObjectFactory.java:58)
      	at org.ametys.plugins.repository.AmetysObjectResolver.resolveById(AmetysObjectResolver.java:241)
      	at org.ametys.odf.orgunit.RootOrgUnitProvider.getRoot(RootOrgUnitProvider.java:70)
      

            Unassigned Unassigned
            ngavalda Nicolas Gavalda (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: