From d7e8893325ab31bb121cd54ea64bcc54962924a1 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Tue, 16 Jul 2024 11:01:40 -0600 Subject: [PATCH] Update voicemail_messages.php Initializing the new object for messages prevents a problem where running the message method twice on the same object returns no results. Running once to get the count and then using that result with paging to get the voicemail messages. --- app/voicemails/voicemail_messages.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/app/voicemails/voicemail_messages.php b/app/voicemails/voicemail_messages.php index 3a5c8f0e9b..f292da5ae6 100644 --- a/app/voicemails/voicemail_messages.php +++ b/app/voicemails/voicemail_messages.php @@ -281,6 +281,16 @@ unset($num_rows); //get the voicemail + //running $vm->messages() is used to get the count and then that information is used for paging and then we need to run $vm->messages() again to get the results with the paging + //when the messages method is run twice on the same object the second time fails so creating a new object resolves this issue. + $vm = new voicemail; + $vm->domain_uuid = $_SESSION['domain_uuid']; + if (!empty($voicemail_uuid) && is_uuid($voicemail_uuid)) { + $vm->voicemail_uuid = $voicemail_uuid; + } + else if (!empty($voicemail_id) && is_numeric($voicemail_id)) { + $vm->voicemail_id = $voicemail_id; + } $vm->order_by = $order_by; $vm->order = $order; $vm->offset = $offset; @@ -424,7 +434,7 @@ //set the list row url as a variable $list_row_url = "javascript:recording_play('".escape($row['voicemail_message_uuid'])."','".$row['voicemail_id'].'|'.$row['voicemail_uuid']."','message');"; - + //playback progress bar echo "\n"; echo "\n"; // dummy row to maintain alternating background color @@ -521,4 +531,4 @@ //include the footer require_once "resources/footer.php"; -?> \ No newline at end of file +?>