aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-03-20 21:53:39 -0700
committerMario Vavti <mario@mariovavti.com>2017-03-29 14:04:44 +0200
commit515f1e76b05c5b4544b7ee624d73cc3b7878d5ea (patch)
tree49bb603a946d8d3ee057818c54c62de55cdd92b7
parentd95f7efea704069a49fc2d63a88dcba5fd80381f (diff)
downloadvolse-hubzilla-515f1e76b05c5b4544b7ee624d73cc3b7878d5ea.tar.gz
volse-hubzilla-515f1e76b05c5b4544b7ee624d73cc3b7878d5ea.tar.bz2
volse-hubzilla-515f1e76b05c5b4544b7ee624d73cc3b7878d5ea.zip
perform attach_upgrade()
-rw-r--r--Zotlabs/Daemon/Cron.php3
-rw-r--r--include/attach.php23
2 files changed, 26 insertions, 0 deletions
diff --git a/Zotlabs/Daemon/Cron.php b/Zotlabs/Daemon/Cron.php
index 350dda7a0..c84708ba4 100644
--- a/Zotlabs/Daemon/Cron.php
+++ b/Zotlabs/Daemon/Cron.php
@@ -121,6 +121,9 @@ class Cron {
}
}
+ require_once('include/attach.php');
+ attach_upgrade();
+
$abandon_days = intval(get_config('system','account_abandon_days'));
if($abandon_days < 1)
$abandon_days = 0;
diff --git a/include/attach.php b/include/attach.php
index 93401226d..c8582f8d3 100644
--- a/include/attach.php
+++ b/include/attach.php
@@ -2320,3 +2320,26 @@ function attach_syspaths($channel_id,$attach_hash) {
}
+
+function attach_upgrade() {
+
+ $r = q("select id, uid, hash from attach where os_path = '' and display_path = '' limit 100");
+ if($r) {
+ foreach($r as $rv) {
+ $x = attach_syspaths($rv['uid'],$rv['hash']);
+ if($x) {
+ $w = q("update attach set os_path = '%s', display_path = '%s' where id = %d",
+ dbesc($x['os_path']),
+ dbesc($x['path']),
+ intval($rv['id'])
+ );
+ $y = q("update photo set os_path = '%s', display_path = '%s' where uid = %d and resource_id = '%s'",
+ dbesc($x['os_path']),
+ dbesc($x['path']),
+ intval($rv['uid']),
+ dbesc($rv['hash'])
+ );
+ }
+ }
+ }
+} \ No newline at end of file