Uploaded image for project: 'CMS'
  1. CMS
  2. CMS-8489

Inline edition of a metadata File in the EditContentGrid does not work

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 4.1.0
    • 4.0.0
    • None
    • None
    • 4.1 RC1

      Currently, you can display a metadata of type File in the result of an EditContentGrid, such as the content search tool, but inline editing does not work :

      • The widget shows "no file" even if the value was set in the content
      • After uploading a local file, the field is not marked as dirty, and the previous value is still displayed. The "content has unsaved modifications" banner is not displayed.

       

          [CMS-8489] Inline edition of a metadata File in the EditContentGrid does not work

          Some work done here :

          • Widgets are displayed
          • Deleting a file works
          • Adding a file (upload or shared) works graphically, but not the save part
          • There is a focus problem after adding a file
          • Some graphical changes to the widget could be done to fit in a grid

          Search for "TODO CMS-8489" in the code to find the revelant places where work to do is still needed.

           

          For the save part, in EditContentsGrid, L794 (saveEditionWithContents), the datas are flattened, so the grid sends

              "values":
             {
                 "content.input.files.file.id": "resource://bf8ddbb5-471f-4bf5-9f14-965490226d83",
                 "content.input.files.file.filename": "red-cross.png",
                 "content.input.files.file.size": "1944",
                 "content.input.files.file.viewUrl": "/cms/plugins/explorer/resource?id=resource%3A%2F%2Fbf8ddbb5-471f-4bf5-9f14-965490226d83",
                 "content.input.files.file.downloadUrl": "/cms/plugins/explorer/resource?id=resource%3A%2F%2Fbf8ddbb5-471f-4bf5-9f14-965490226d83&download=true",
                 "content.input.files.file.type": "explorer"
             }
          

          instead of

              "values":
             {
          ....
                 "content.input.files.file":
                 {
                     "id": "resource://bf8ddbb5-471f-4bf5-9f14-965490226d83",
                     "filename": "red-cross.png",
                     "size": "1944",
                     "viewUrl": "/cms/plugins/explorer/resource?id=resource%3A%2F%2Fbf8ddbb5-471f-4bf5-9f14-965490226d83",
                     "downloadUrl": "/cms/plugins/explorer/resource?id=resource%3A%2F%2Fbf8ddbb5-471f-4bf5-9f14-965490226d83&download=true",
                     "type": "explorer"
                 },
          .....
             }
          

          When this is fixed, the file will be handled normally by the editContentFunction

          Pierre Gros (Inactive) added a comment - Some work done here : Widgets are displayed Deleting a file works Adding a file (upload or shared) works graphically, but not the save part There is a focus problem after adding a file Some graphical changes to the widget could be done to fit in a grid Search for "TODO CMS-8489 " in the code to find the revelant places where work to do is still needed.   For the save part, in EditContentsGrid, L794 (saveEditionWithContents), the datas are flattened, so the grid sends     "values" :    {        "content.input.files.file.id" : "resource: //bf8ddbb5-471f-4bf5-9f14-965490226d83" ,        "content.input.files.file.filename" : "red-cross.png" ,        "content.input.files.file.size" : "1944" ,        "content.input.files.file.viewUrl" : "/cms/plugins/explorer/resource?id=resource%3A%2F%2Fbf8ddbb5-471f-4bf5-9f14-965490226d83" ,        "content.input.files.file.downloadUrl" : "/cms/plugins/explorer/resource?id=resource%3A%2F%2Fbf8ddbb5-471f-4bf5-9f14-965490226d83&download= true " ,        "content.input.files.file.type" : "explorer"    } instead of     "values" :    { ....        "content.input.files.file" :        {            "id" : "resource: //bf8ddbb5-471f-4bf5-9f14-965490226d83" ,            "filename" : "red-cross.png" ,            "size" : "1944" ,            "viewUrl" : "/cms/plugins/explorer/resource?id=resource%3A%2F%2Fbf8ddbb5-471f-4bf5-9f14-965490226d83" ,            "downloadUrl" : "/cms/plugins/explorer/resource?id=resource%3A%2F%2Fbf8ddbb5-471f-4bf5-9f14-965490226d83&download= true " ,            "type" : "explorer"        }, .....    } When this is fixed, the file will be handled normally by the editContentFunction

            laurence Laurence Aumeunier
            glefebvre Grégory Lefebvre (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: