X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=update.php;h=25e64d659a2f0504fa8639f2d18209232e716689;hb=f5a49b06ee37af4bc74a4a4ebec4990f7b8cf7ac;hp=6a53c83f167959d2b95f5c5b18a0ab4c6e64da6b;hpb=1274fe6f9bdf0ecf4d1fe74a3ff241e8b57d8c0f;p=friendica.git diff --git a/update.php b/update.php index 6a53c83f16..25e64d659a 100644 --- a/update.php +++ b/update.php @@ -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; +}