Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickdemooij9 committed Jul 10, 2022
2 parents 2582a08 + c7f8b3c commit 718a757
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
}

function save() {
$http.post("backoffice/SeoToolkit/SeoSettings/Set",
return $http.post("backoffice/SeoToolkit/SeoSettings/Set",
{
contentTypeId: $scope.model.id,
enabled: vm.model.enableSeoSettings
Expand All @@ -58,11 +58,11 @@

$scope.$on("formSubmitting",
function () {
save();

if (vm.model.enableSeoSettings) {
$scope.$broadcast("seoSettingsSubmitting");
}
save().then(function() {
if (vm.model.enableSeoSettings) {
$scope.$broadcast("seoSettingsSubmitting");
}
});
});

init();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using Umbraco.Cms.Infrastructure.Migrations;
using NPoco;
using SeoToolkit.Umbraco.Sitemap.Core.Models.Database;
using Umbraco.Cms.Infrastructure.Migrations;
using Umbraco.Extensions;

namespace SeoToolkit.Umbraco.Sitemap.Core.Migrations
{
Expand All @@ -10,7 +13,18 @@ public SitemapChangeFrequencyOptionalMigration(IMigrationContext context) : base

protected override void Migrate()
{
if (ColumnExists("SeoToolkitSitemapPageType", "ChangeFrequency"))
if (!ColumnExists("SeoToolkitSitemapPageType", "ChangeFrequency")) return;

if (DatabaseType == DatabaseType.SQLite)
{
//SQLite doesn't support normal altering of columns. https://github.com/umbraco/Umbraco-CMS/issues/12676
Database.Execute("ALTER TABLE SeoToolkitSitemapPageType RENAME TO old_SeoToolkitSitemapPageType;");
Create.Table<SitemapPageTypeEntity>().Do();
Database.InsertBulk(Database.Fetch<SitemapPageTypeEntity>(Sql()
.SelectAll()
.From("old_SeoToolkitSitemapPageType")));
}
else
{
Alter.Table("SeoToolkitSitemapPageType").AlterColumn("ChangeFrequency").AsString().Nullable().Do();
}
Expand Down

0 comments on commit 718a757

Please sign in to comment.