lazurey / strapi-plugin-content-export-import

Strapi plugin for content export and import
166 stars 47 forks source link

Plugin does not support singleTypes #23

Open FredWahlqvistDrop opened 3 years ago

FredWahlqvistDrop commented 3 years ago

great plugin, not sure if its a bug, issue or feature request but currently the plugin don't support single types, would be great to get support for that

SalahAdDin commented 3 years ago

It also has not support for the last version (which includes localization).

lazurey commented 2 years ago

Sorry for the very late response, I'm working on supporting v4 at the moment. It's in progress with basic export & import features.

TonyBogdanov commented 2 years ago

Description says it works with Strapi v4.0.3, which was the whole reason to even try it out... Any idea when will it support single types?

lazurey commented 2 years ago

@TonyBogdanov I did a fix a couple days ago, did you try it again? I think the export of single type is definitely working, but I'm not sure about what the right behaviour of import single type should be like, e.g. overwrite existing?

TonyBogdanov commented 2 years ago

@lazurey I pulled the latest commit in master and re-built everything. I have a single type with a repeated component containing 5 simple text fields. When I go to the export section and click on Fetch, this is what I get:

{
    "data": {
        "id": 1,
        "createdAt": "2022-02-09T20:13:30.655Z",
        "updatedAt": "2022-02-09T20:44:49.447Z"
    }
}

When I open the API directly: /api/bundle-doctrine-security I get this:

{
   "data":{
      "id":1,
      "attributes":{
         "createdAt":"2022-02-09T20:13:30.655Z",
         "updatedAt":"2022-02-09T20:44:49.447Z"
      }
   },
   "meta":{}
}

Following the advice of some GitHub issues I can append ?populate=* to the URL and it properly returns the results:

{
   "data":{
      "id":1,
      "attributes":{
         "createdAt":"2022-02-09T20:13:30.655Z",
         "updatedAt":"2022-02-09T20:44:49.447Z",
         "content":[
            {
               "id":1,
               "en":"Identity: {{ identity }} is not allowed to perform action: {{ action }} on: {{ subject }}.",
               "de":"Identität: {{ identity }} ist nicht berechtigt, eine Aktion durchzuführen: {{ action }} an: {{ subject }}.",
               "it":"Identità: {{ identity }} non è autorizzato ad eseguire l'azione: {{ action }} su: {{ subject }}.",
               "fr":"Identité : {{ identity }} n'est pas autorisée à effectuer l'action : {{ action }} sur : {{ subject }}.",
               "bg":"Самоличност: {{ identity }} няма нужните права за изпълняване на действие: {{ action }} върху: {{ subject }}.",
               "key":"Identity: {{ identity }} is not allowed to perform action: {{ action }} on: {{ subject }}."
            }
         ]
      }
   },
   "meta":{}
}

Perhaps this populate parameter is missing in your case?

lazurey commented 2 years ago

Hi @TonyBogdanov Thanks for the detailed explanation. I did a quick fix to export the populated components/relations in cf3fb82 But I didn't get time to figure out how to import them back, any ideas?