mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-07 15:54:26 +02:00
Fix user-contact rows not being updated in Contact\User::updateByContactUpdate
- Add new update function to regenerate potentially outdated user-contact rows
This commit is contained in:
parent
fd0d17df31
commit
f7714c09e6
2 changed files with 22 additions and 12 deletions
25
update.php
25
update.php
|
@ -1000,14 +1000,6 @@ function update_1434()
|
|||
return Update::SUCCESS;
|
||||
}
|
||||
|
||||
function update_1435()
|
||||
{
|
||||
$contacts = DBA::select('contact', [], ["`uid` != ?", 0]);
|
||||
while ($contact = DBA::fetch($contacts)) {
|
||||
Contact\User::insertForContactArray($contact);
|
||||
}
|
||||
}
|
||||
|
||||
function update_1438()
|
||||
{
|
||||
DBA::update('photo', ['photo-type' => Photo::USER_AVATAR], ['profile' => true]);
|
||||
|
@ -1061,3 +1053,20 @@ function update_1442()
|
|||
|
||||
return Update::SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* A bug in Contact\User::updateByContactUpdate prevented any update to the user-contact table since the rows have been
|
||||
* created in version 1435. This version fixes this bug but the user-contact rows are outdated, we need to regenerate
|
||||
* them.
|
||||
*/
|
||||
function update_1444()
|
||||
{
|
||||
DBA::e('TRUNCATE TABLE `user-contact`');
|
||||
|
||||
$contacts = DBA::select('contact', [], ["`uid` != ?", 0]);
|
||||
while ($contact = DBA::fetch($contacts)) {
|
||||
Contact\User::insertForContactArray($contact);
|
||||
}
|
||||
|
||||
return Update::SUCCESS;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue