×
Kunena 5.1.15 Released (27 Oct 2019)

The Kunena team has announce the arrival of Kunena 5.1.15 [K 5.1.15] which is now available for download as a native Joomla extension for J! 3.9.x. This version addresses most of the issues that were discovered in K 5.1 and issues discovered during the development stages of K 5.1.

× Topics that are moved into this category are generally considered to be closed. Users may want to add additional information but these topics should not be resurrected in order to discuss new problems or unrelated matters.

Question [Resolved] Issues with attachments not showing in K 1.7

More
8 years 2 months ago #21 by manityodthong
Attachments:

Please Log in or Create an account to join the conversation.

More
More
8 years 2 months ago #23 by Sabby
Not sure how to resolve this issue with the attachments but in the mean time I found an alternate forums module I can use until I figure out the Kunena issue, thanks for everyone's help.

Please Log in or Create an account to join the conversation.

More
8 years 2 months ago #24 by Sabby
Just an FYI, I am still actively working on trying to track this down.
I have discovered that before the actual post are displayed the 'this->attachments' has a count of more than 0 if there is an attachment. However once you get to the post the attachment array has a size of 0.
So when it gets to running displayAttachments, it always seems to think the this->attachments is empty.
Even if within display(..) message->attachments is not empty. Maybe this will help.

Please Log in or Create an account to join the conversation.

More
8 years 2 months ago #25 by Sabby
I may be onto something, some code tweaking and I have attachments now.

Please Log in or Create an account to join the conversation.

More
8 years 2 months ago #26 by Matias
I think that these two issues are separate.

In order to find out why text isn't showing up, you need to create another text topic and paste all text from the broken message into there. Then just edit the topic and remove a few lines until you find out what is causing this bug to happen.

Please Log in or Create an account to join the conversation.

More
8 years 2 months ago #27 by Matias
So the attachments count changes from > 0 into 0? It should only happen if BBCode renders the attachments into the message. It basically prevents attachments from being displayed twice.

Check into:
(frontend)/lib/kunena.parser.php and search for 'attachment' -- it should show you the code that renders attachments into the topic.

Also: do the attachments show up if you're not adding them into the message?

Please Log in or Create an account to join the conversation.

More
8 years 2 months ago #28 by sozzled
I have asked Sabby to provide us of details about what and where he made some changes.

Please Log in or Create an account to join the conversation.

More
8 years 2 months ago #29 by Sabby
Here is what I had to do to get them to show up.
First, here is a link so you can see what it looks like.
www.fragaholics.net/forum/30-general/249...nt-testing.html#2498

Keep in mind I do not know the inner workings of Kunena and the flow of information, so I am sure this is not what you would call a "perminant fix" but, it's a work around for me until a perminant solution is found, if one is found. This may just be related to my PHP/Apache, who knows.

funcs/view.php
Here I created a new message object from the msg object, I then set Attachments from the new object, without this it never sees that I have attachments.
function displayAttachments() {
     $mymessage = $this->msg;
     $this->Attachments = $mymessage->attachments;  
     if ( empty ( $this->Attachments ) ) return;
          CKunenaTools::loadTemplate('/view/message.attachments.php');
}

These next two changes were with template files.

template/%templatefolder%/view/message.attachments.php
I check if there is an attachment because, if there is no attachment I want to run the original code over my modified code. I was running into an issue with the text not showing with an attachment so I had to display that as well. Again, I don't understand the functions within the Kunena backend so I 'guessed'.
<div class="kmsgtext">
	<?php 
		if(!empty($this->msg->message)) {
			$mymessage = $this->msg;
			echo KunenaParser::parseBBCode ( $mymessage->message, '' );
		} 
	?>
	</div>
 
	<div class="kmsgattach">
    <?php
	if(empty($this->attachments) && !empty($this->msg->attachments)) {
		$mymessage = $this->msg;
		$this->attachments = $mymessage->attachments;
	}
	?>

Finally, again another template file I had to modify, I ran into an issue where the attachments started showing but if you typed some text with the attachment it wouldn't so it so this was the workaround for that.

template/%templatefolder%/view/message.contents.php
 
<div class="kmsgbody">
<?php
if(empty($this->attachments) && empty($this->msg->attachments))
{
	echo '
	<div class="kmsgtext">';
		echo $this->messageHtml; 
	echo '
	</div>';
}
?>
</div>

I know this isn't probably the best way to fix it, but it worked so maybe it will help figure out what the original or real problem is. Sorry about my bad PHP, I spend most my day writing C# and its been a few years since I wrote PHP.
The following user(s) said Thank You: sozzled

Please Log in or Create an account to join the conversation.

More
8 years 1 month ago #30 by manityodthong

same topic but difference result
Attachments:

Please Log in or Create an account to join the conversation.

  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to edit your message.
Time to create page: 0.753 seconds