Open michaelborn opened 2 years ago
I highly recommend we change Import.php
to not attempt to find the content by slug if the slug is null
:
$content = null; // NEW LINE
if ( !is_null( $slug ) ){ // NEW LINE
$content = $this->contentRepository->findOneBySlug(Str::slug($slug), $contentType);
} // NEW LINE
if (! $content) {
$content = new Content($contentType);
$content->setAuthor($user);
}
See https://github.com/bobdenotter/conimex/blob/master/src/Import.php#L143
It looks as though we'll need to wrap an is_null()
check around line 356 as well:
if ( !is_null( $item ) ){
$this->contentEditController->updateField($field, $item, null);
}
See https://github.com/bobdenotter/conimex/blob/master/src/Import.php#L359
I think this PR fixes this issue, but it hasn't been merged in yet: https://github.com/bobdenotter/conimex/pull/64
If we have a content type with no
slug
field defined, and we useconimex
to export that content, theslug
field will benull
.Attempting to import this content fails, even though the content worked fine in the source Bolt website.
Error: