Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-j-m committed Feb 1, 2021
2 parents 0550e1f + 391be74 commit 92a6580
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v2.1.1
## 02-02-2021

1. [](#bugfix)
* Fixed issue with initial save on new pages

# v2.1.0
## 15-12-2020

Expand Down
7 changes: 4 additions & 3 deletions aura.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,17 +122,18 @@ public function onAdminSave(Event $event)
}

$original = $page->getOriginal();
if (!isset($original->header()->aura) && isset($page->header()->metadata) && is_array($page->header()->metadata)) {
if ($original && !isset($original->header()->aura) && isset($page->header()->metadata) && is_array($page->header()->metadata)) {
// Page has not been saved since installation of Aura and includes some custom metadata
$legacyMetadata = ['metadata' => []];
foreach ($page->header()->metadata as $key => $val) {
if (!array_key_exists($key, $metadata)) {
// A new value has not been supplied via Aura, salvage existing metadata
$metadata[$key] = $val;
$page->header()->aura['metadata'] = array($key => $val);
$legacyMetadata['metadata'][$key] = $val;
}
}
$page->header()->aura = array_merge($legacyMetadata, isset($page->header()->aura) ? $page->header()->aura : []);
}

$page->header()->metadata = array_merge($metadata, isset($page->header()->aura['metadata']) ? $page->header()->aura['metadata'] : []);

}
Expand Down
2 changes: 1 addition & 1 deletion blueprints.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Aura
slug: aura
type: plugin
version: 2.1.0
version: 2.1.1
description: Automatically add meta tags and structured data to your pages for visually appealing and informative search results and social media sharing.
icon: code
author:
Expand Down

0 comments on commit 92a6580

Please sign in to comment.