Add BC for importing older exported templates
We allow exporting templates as JSON and templates exported from the older plugin versions use thumbnail key for storing the image data. [MAILPOET-2686]
This commit is contained in:
committed by
Veljko V
parent
5134713c2d
commit
dd0a19a314
@@ -49,7 +49,12 @@ class NewsletterTemplatesRepository extends Repository {
|
||||
}
|
||||
|
||||
if (isset($data['thumbnail'])) {
|
||||
$template->setThumbnail($data['thumbnail']);
|
||||
// Backward compatibility for importing templates exported from older versions
|
||||
if (strpos($data['thumbnail'], 'data:image') === 0) {
|
||||
$data['thumbnail_data'] = $data['thumbnail'];
|
||||
} else {
|
||||
$template->setThumbnail($data['thumbnail']);
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($data['thumbnail_data'])) {
|
||||
|
Reference in New Issue
Block a user