]> git.mxchange.org Git - friendica.git/blobdiff - update.php
DE translation updates
[friendica.git] / update.php
index 6a53c83f167959d2b95f5c5b18a0ab4c6e64da6b..25e64d659a2f0504fa8639f2d18209232e716689 100644 (file)
@@ -55,6 +55,7 @@ use Friendica\Model\Photo;
 use Friendica\Model\Post;
 use Friendica\Model\Profile;
 use Friendica\Model\Storage;
+use Friendica\Security\PermissionSet\Depository\PermissionSet;
 use Friendica\Worker\Delivery;
 
 // Post-update script of PR 5751
@@ -206,7 +207,7 @@ function update_1332()
        $profiles = DBA::select('profile', [], $condition);
 
        while ($profile = DBA::fetch($profiles)) {
-               DI::profileField()->migrateFromLegacyProfile($profile);
+               Profile::migrate($profile);
        }
        DBA::close($profiles);
 
@@ -1028,3 +1029,27 @@ function update_1439()
        }
        DBA::close($intros);
 }
+
+function update_1440()
+{
+       // Fix wrong public permissionset
+       DBA::p("UPDATE `profile_field` SET `psid` = ? WHERE psid IN (SELECT `id` FROM `permissionset` WHERE `id` != ? AND `allow_cid` = '' AND `allow_gid` = '' AND `deny_cid` = '' AND `deny_gid` = '')", PermissionSet::PUBLIC, PermissionSet::PUBLIC);
+       DBA::delete('permissionset', ["`id` != ? AND `allow_cid` = '' AND `allow_gid` = '' AND `deny_cid` = '' AND `deny_gid` = ''", PermissionSet::PUBLIC]);
+
+       return Update::SUCCESS;
+}
+
+function update__1441()
+{
+       $languages = DI::l10n()->getAvailableLanguages();
+
+       $albums = [Photo::PROFILE_PHOTOS];
+       foreach ($languages as $language) {
+               $albums[] = DI::l10n()->withLang($language)->t(Photo::PROFILE_PHOTOS);
+       }
+       $albums = array_unique($albums);
+
+       Photo::update(['photo-type' => Photo::USER_AVATAR], ['album' => $albums]);
+
+       return Update::SUCCESS;
+}