Keyword

Attachment Issue with SVN

More
12 years 11 months ago #100261 by Lee Noble
Replied by Lee Noble on topic Attachment Issue with SVN
I notice that the attachments at the link you provided above are now working? What did you do to get them to function?Troponin said:
Work !!!

thx Lefteris for the Information and thx William for take a look at your Installation

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

  • troponin
  • troponin's Avatar Topic Author
  • Offline
  • Platinum Member
More
12 years 11 months ago #100262 by troponin
Replied by troponin on topic Attachment Issue with SVN
You use a custom K2 Template.

 

All you have to do is to replace your custom item.php div class="itemAttachmentsBlock" with the standard.

Open components/com_k2/templates/default/item.php and search for <!-- Item attachments -->.

 

Copy the complete div to your custom item.php and replace the old one:

 

Here is the new Code:

 

<div class="itemAttachmentsBlock">          <span><?php echo JText::_('K2_DOWNLOAD_ATTACHMENTS'); ?></span>          <ul class="itemAttachments">            <?php foreach ($this->item->attachments as $attachment): ?>            <li>                <a title="<?php echo htmlentities($attachment->titleAttribute, ENT_QUOTES, 'UTF-8'); ?>" href="<?php echo $attachment->link; ?>">                    <?php echo $attachment->title ; ?>                </a>                <?php if($this->item->params->get('itemAttachmentsCounter')): ?>                <span>(<?php echo $attachment->hits; ?> <?php echo (count($attachment->hits)==1) ? JText::_('K2_DOWNLOAD') : JText::_('K2_DOWNLOADS'); ?>)</span>                <?php endif; ?>            </li>            <?php endforeach; ?>          </ul>      </div>

 

 

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

More
12 years 11 months ago #100263 by Lee Noble
Replied by Lee Noble on topic Attachment Issue with SVN
Issue is, I'm not using a custom template (yet). So, there is nothing to replace as it is there already. Furthermore, the issue also exists when editing the item in the frontend. Downloading in edit gives the 404 and deleting, whilst asking "are you sure" does nothing. All functions ok in the backend.

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

More
12 years 11 months ago #100264 by Lee Noble
Replied by Lee Noble on topic Attachment Issue with SVN
I notice that you have now closed issue 179. However, in my case this issue exists with the default template both in he frontend and in the frontend edit where it can niether be downloaded or deleted. All functions ok in the backend. Any ideas?

Lefteris Kavadas said:

We have added some logic on the downloads of the attachments to prevent users from guessing ids and download attachments that they cannot see. The side effect of this is that there are some template changes. Please upgrade your templates  download links by looking at the default templates that come with K2. A complete list of these changes will be published once version 2.5 goes stable.

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


Powered by Kunena Forum