mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Fixed Revue import
refs https://github.com/TryGhost/Toolbox/issues/523 - When importing a zip with Revue data and no "files" or "media" the importer blew up. This is due to a bug where the files from the root directory are still being copied over (the should not be!) - Added protective extra ".data" check to make sure code doest not blow up when there's no data property to be processed
This commit is contained in:
parent
29b3da26c3
commit
1f95fd50df
1 changed files with 3 additions and 3 deletions
|
@ -73,7 +73,7 @@ class ContentFileImporter {
|
|||
|
||||
preProcess(importData) {
|
||||
if (this.type === 'images') {
|
||||
if (importData.images && importData.data){
|
||||
if (importData.images && importData.data && importData.data.data) {
|
||||
_.each(importData.images, function (image) {
|
||||
preProcessPosts(importData.data.data, image);
|
||||
preProcessTags(importData.data.data, image);
|
||||
|
@ -87,7 +87,7 @@ class ContentFileImporter {
|
|||
// @NOTE: the type === 'media' check does not belong here and should be abstracted away
|
||||
// to make this importer more generic
|
||||
if (this.type === 'media') {
|
||||
if (importData.media && importData.data) {
|
||||
if (importData.media && importData.data && importData.data.data) {
|
||||
_.each(importData.media, function (file) {
|
||||
preProcessPosts(importData.data.data, file);
|
||||
});
|
||||
|
@ -97,7 +97,7 @@ class ContentFileImporter {
|
|||
}
|
||||
|
||||
if (this.type === 'files') {
|
||||
if (importData.files && importData.data) {
|
||||
if (importData.files && importData.data && importData.data.data) {
|
||||
_.each(importData.files, function (file) {
|
||||
preProcessPosts(importData.data.data, file);
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue