diff options
author | Mario <mario@mariovavti.com> | 2025-05-17 16:19:05 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2025-05-17 16:19:05 +0000 |
commit | 7b8e47b49d886e27afed5ef423dddb1d52c44994 (patch) | |
tree | f112a529a7c9e29e3d6c9dac05c629182e0abf71 | |
parent | cf317aa1a116e43b0ae4d6ec513d018dbe7151a4 (diff) | |
download | volse-hubzilla-7b8e47b49d886e27afed5ef423dddb1d52c44994.tar.gz volse-hubzilla-7b8e47b49d886e27afed5ef423dddb1d52c44994.tar.bz2 volse-hubzilla-7b8e47b49d886e27afed5ef423dddb1d52c44994.zip |
revert moving thr_parent retrieval to SQL in favor of a more simple solution (fixes SQL error in postgres and strict mysql)
-rw-r--r-- | Zotlabs/Lib/ThreadItem.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php index 929792916..649b98361 100644 --- a/Zotlabs/Lib/ThreadItem.php +++ b/Zotlabs/Lib/ThreadItem.php @@ -34,6 +34,7 @@ class ThreadItem { private $channel = null; private $display_mode = 'normal'; private $reload = ''; + private $mid_uuid_map = []; public function __construct($data) { @@ -54,6 +55,8 @@ class ThreadItem { continue; } + $this->mid_uuid_map[$item['mid']] = $item['uuid']; + $child = new ThreadItem($item); $this->add_child($child); } @@ -452,7 +455,7 @@ class ThreadItem { 'wait' => t('Please wait'), 'thread_level' => $thread_level, 'settings' => $settings, - 'thr_parent_uuid' => ((isset($item['thr_parent_uuid']) && $item['thr_parent'] !== $item['parent_mid']) ? $item['thr_parent_uuid'] : ''), + 'thr_parent_uuid' => (($item['parent_mid'] !== $item['thr_parent'] && isset($this->mid_uuid_map[$item['thr_parent']])) ? $this->mid_uuid_map[$item['thr_parent']] : ''), 'contact_id' => (($contact) ? $contact['abook_id'] : ''), 'moderate' => ($item['item_blocked'] == ITEM_MODERATED), 'moderate_approve' => t('Approve'), |