Git Product home page Git Product logo

Comments (11)

KaterynaBoiko avatar KaterynaBoiko commented on May 29, 2024 2

There's the following piece of code in the library. It filters all the entities and decides if they should be published or not:

const entityIdsToPublish = sourceEntities
    .filter(({ original }) => original.sys.publishedVersion)
    .map(({ original }) => original.sys.id)

Only after finding this, it get clear that if an entity has to be published, it should contain sys.publishedVersion field

from contentful-cli.

scaccogatto avatar scaccogatto commented on May 29, 2024

I am sorry, does anyone have a solution for this?

Example:

{
    "entries": [
        {
            "sys": {
                "publishedVersion": 1,
                "space": {
                    "sys": {
                        "type": "Link",
                        "linkType": "Space",
                        "id": "4zg16q5vss6b"
                    }
                },
                "environment": {
                    "sys": {
                        "id": "staging",
                        "type": "Link",
                        "linkType": "Environment"
                    }
                },
                "contentType": {
                    "sys": {
                        "type": "Link",
                        "linkType": "ContentType",
                        "id": "model"
                    }
                }
            },
            "fields": {
                "tesyId": {
                    "it-IT": "0049130"
                },
                "synced": {
                    "it-IT": false
                }
            }
        }
    ]
}

from contentful-cli.

phoebeschmidt avatar phoebeschmidt commented on May 29, 2024

Hi @scaccogatto

Is there already content in the space you're importing into?

You can read more about the publishing strategy of the import tool when there is existing content here: https://github.com/contentful/contentful-import#bulb-importing-to-a-space-with-existing-content

The sys properties are ignored, so sending published data in the sys payload will not force a publish.

from contentful-cli.

scaccogatto avatar scaccogatto commented on May 29, 2024

I solved by using the cli manually, so I don't need this feature anymore.
If it helps, yes, there is already content in the space.

from contentful-cli.

phoebeschmidt avatar phoebeschmidt commented on May 29, 2024

glad you were able to solve it.

The existing content in the space, and its status (published, draft, etc) was likely having an effect on whether the import tool published the content.

from contentful-cli.

scaccogatto avatar scaccogatto commented on May 29, 2024

I am sorry, this was 10 day ago. I forgot almost everything. I did NOT solve this problem with the cli.
I cannot make it publish after importing.
The content imports correctly but it tets itself to draft.
There is more content in the space but not the one that I am importing. I am stuck.

from contentful-cli.

phoebeschmidt avatar phoebeschmidt commented on May 29, 2024

@scaccogatto could you open a new issue and we can continue debugging there?

from contentful-cli.

nmercado-modus avatar nmercado-modus commented on May 29, 2024

Hi, @scaccogatto did you get any feedback on this? I'm facing the same issue. Imported assets are set as drafts.

Thanks in advance.

from contentful-cli.

scaccogatto avatar scaccogatto commented on May 29, 2024

Hi, @scaccogatto did you get any feedback on this? I'm facing the same issue. Imported assets are set as drafts.

Thanks in advance.

I had to rewrite my logic with the contentful js sdk.
Never had the chance to write the whole thing as I wanted because of this bug.

from contentful-cli.

dsacramone avatar dsacramone commented on May 29, 2024

figured it out

from contentful-cli.

Francois-Stevenart avatar Francois-Stevenart commented on May 29, 2024

@KaterynaBoiko is right, and to clarify: for each entry to contain the sys.publishedVersion, the --include-drafts option (when exporting the content in the first place) should be set to true. Then when the content is imported, it will hold the correct draft/published status.

from contentful-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.