aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-09-10 12:29:05 +0000
committerMario <mario@mariovavti.com>2021-09-10 12:29:05 +0000
commite5dc3c05dfb79df79f4fd14496bc5e646217c27e (patch)
tree3d57250415940472e53f4f94526b74b0b914031e
parente2d0269b5c9f1f1b865e1c0473a6bc0a0a0a1740 (diff)
downloadvolse-hubzilla-e5dc3c05dfb79df79f4fd14496bc5e646217c27e.tar.gz
volse-hubzilla-e5dc3c05dfb79df79f4fd14496bc5e646217c27e.tar.bz2
volse-hubzilla-e5dc3c05dfb79df79f4fd14496bc5e646217c27e.zip
when updating the channel name from profiles make sure to lookup the xchan entry by xchan_hash since xchan_url is set to the primary location but we might be updating from a clone
-rw-r--r--Zotlabs/Lib/Libzot.php1
-rw-r--r--Zotlabs/Module/Profiles.php4
2 files changed, 2 insertions, 3 deletions
diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php
index 9c232f34d..3f1f16b09 100644
--- a/Zotlabs/Lib/Libzot.php
+++ b/Zotlabs/Lib/Libzot.php
@@ -2745,7 +2745,6 @@ class Libzot {
}
$e = $r[0];
-
$id = $e['channel_id'];
$sys_channel = (intval($e['channel_system']) ? true : false);
diff --git a/Zotlabs/Module/Profiles.php b/Zotlabs/Module/Profiles.php
index 452af4d78..631a41ddc 100644
--- a/Zotlabs/Module/Profiles.php
+++ b/Zotlabs/Module/Profiles.php
@@ -606,10 +606,10 @@ class Profiles extends \Zotlabs\Web\Controller {
$channel = \App::get_channel();
if($namechanged && $is_default) {
- $r = q("UPDATE xchan SET xchan_name = '%s', xchan_name_date = '%s' WHERE xchan_url = '%s'",
+ $r = q("UPDATE xchan SET xchan_name = '%s', xchan_name_date = '%s' WHERE xchan_hash = '%s'",
dbesc($name),
dbesc(datetime_convert()),
- dbesc(z_root() . '/channel/' . $channel['channel_address'])
+ dbesc($channel['xchan_hash'])
);
$r = q("UPDATE channel SET channel_name = '%s' WHERE channel_hash = '%s'",
dbesc($name),