Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-16971

Fix Collection json serialization in select2

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 7.3-SNAPSHOT
    • Fix Version/s: 7.3
    • Component/s: Automation

      Description

      Step to reproduce:

      1- Go to the search tab
      2- In Collections search criteria, select 'Favoirtes'
      3- Click Filter
      4- See that the criteria are indeed applied

      But the Collections field does not display the selected Collection i.e. Favorites.

      This is because org.nuxeo.ecm.core.io.marshallers.json.ExtensibleEntityJsonWriter.write(DocumentModel, JsonGenerator) used in org.nuxeo.ecm.platform.ui.select2.Select2ActionsBean.resolveMultipleReferences(Object, String, String, String, String) does not serialize properly the document anymore and in the html, we have:

      <input id="nxl_gridSearchLayout:nxw_searchLayout_form:nxl_default_search_layout:nxw_visible_collection_select2_init" type="hidden" name="nxl_gridSearchLayout:nxw_searchLayout_form:nxl_default_search_layout:nxw_visible_collection_select2_init" value="[{"entity-type":"document","repository":"default","uid":"fcf2710f-0c19-4aa6-8bbc-70e52c081b6e","path":"/default-domain/UserWorkspaces/Administrator/Favorites","type":"Favorites","state":"project","parentRef":"9adcdbbe-7a67-4fd1-8de6-098c17a7ad38","isCheckedOut":true,"changeToken":"1429542184459","title":"My Favorites","lastModified":"2015-04-20T15:03:04.45Z","properties":{"common:size":null,"common:icon-expanded":null,"common:icon":"/icons/pin.png","dc:description":"","dc:language":null,"dc:coverage":null,"dc:valid":null,"dc:creator":"Administrator","dc:modified":"2015-04-20T15:03:04.45Z","dc:lastContributor":"Administrator","dc:rights":null,"dc:expired":null,"dc:format":null,"dc:created":"2015-04-20T15:03:04.45Z","dc:title":"My Favorites","dc:issued":null,"dc:nature":null,"dc:subjects":[],"dc:contributors":["Administrator"],"dc:source":null,"dc:publisher":null},"facets":["Collection","NotCollectionMember"],"contextParameters":{"documentURL":"http://localhost:8080/nuxeo/nxdoc/default/fcf2710f-0c19-4aa6-8bbc-70e52c081b6e/view_documents"]">
      

      Note that the json is incorrect.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: