Keyword

Attachment doesn't work with advanced sef

  • Nicola
  • Nicola's Avatar Topic Author
  • Offline
  • New Member
More
7 years 6 months ago #157868 by Nicola
Hello, I've opened an issue on github ( github.com/getk2/k2/issues/361 ). Here is the problem:
I've a category called news and a subcategory called breaking news.
I also have a menu item called news that show all news from subcategories (like breaking news).

With Advanced SEF and this settings:
URL Prefix for Category: none
use ID for article: no
use alias for article: yes
use category id: no
use category alias: yes

It works
But, If I set "URL Prefix for Category" to "article category", attachments return error 404
the url is domain.tld/news/download/"hash".html ->error 404

if I disable URL Prefix for Category the url is
domain.tld/news/download/"hash".html ->work

Am I doing something wrong?

Thank you

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 6 months ago #157882 by Krikor Boghossian
Replied by Krikor Boghossian on topic Attachment doesn't work with advanced sef
So the alias is printed in the attachment.

As a temporary measure, until we fix it, you can try a quick and dirty solution.

In the item.php file you change:
<?php echo $attachment->link; ?>[code]

with:
[code]
<?php $realLink = str_replace('news/', '', $attachment->link); ?>
<?php echo $realLink; ?>

The end result should be:
<?php $realLink = str_replace('news/', '', $attachment->link); ?>
<a title="<?php echo K2HelperUtilities::cleanHtml($attachment->titleAttribute); ?>" href="<?php echo $realLink; ?>">

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • Nicola
  • Nicola's Avatar Topic Author
  • Offline
  • New Member
More
7 years 6 months ago - 7 years 6 months ago #157888 by Nicola
Replied by Nicola on topic Attachment doesn't work with advanced sef
Hello, I wrote wrong things and I'm sorry for that:
without advanced sef:
www.domain.tld/news/item/{id}-title.html
www.domain.tld/news/download/*hash*.html <- it works

with advanced sef but without category prefix
www.domain.tld/news/{id}-title.html
www.domain.tld/news/download/*hash*.html <- it works

with advanced sef and category prefix
www.domain.tld/news/sport/{id}-title.html
www.domain.tld/news/download/*hash*.html <- it doesn't work

if I manually wrote
www.domain.tld/news/sport/download/*hash*.html <- it works
Last edit: 7 years 6 months ago by Nicola.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 6 months ago #157900 by Krikor Boghossian
Replied by Krikor Boghossian on topic Attachment doesn't work with advanced sef
I tested all prefixes with advanced SEF using the 2.7.2 DEV version.
It is working as expected.

I will map the master category in a menu item to replicate your setup.
Is sport a menu item as well?

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • Nicola
  • Nicola's Avatar Topic Author
  • Offline
  • New Member
More
7 years 6 months ago - 7 years 6 months ago #157904 by Nicola
Replied by Nicola on topic Attachment doesn't work with advanced sef
I'm sending you via PM the correct urls of this website :-)

EDIT: I don't see the PM function, so no, the category is called "notizie" (I've translated for you from italian to english). The subcategory is called "discipline".
The attachment doesn't have spaces or something else.

Thank you
Last edit: 7 years 6 months ago by Nicola.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 6 months ago #157905 by Krikor Boghossian
Replied by Krikor Boghossian on topic Attachment doesn't work with advanced sef
You can use the contact form
www.joomlaworks.net/support/contact

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • Nicola
  • Nicola's Avatar Topic Author
  • Offline
  • New Member
More
7 years 6 months ago #157928 by Nicola
Replied by Nicola on topic Attachment doesn't work with advanced sef

Krikor wrote: You can use the contact form
www.joomlaworks.net/support/contact


Hello, I've sent the email yesterday, hope it's arrived :-)

Thanks

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 6 months ago #157935 by Krikor Boghossian
Replied by Krikor Boghossian on topic Attachment doesn't work with advanced sef
Yes, It arrived I will look into it.
Thank you once again Nicola for reporting this.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • Nicola
  • Nicola's Avatar Topic Author
  • Offline
  • New Member
More
7 years 6 months ago #158079 by Nicola
Replied by Nicola on topic Attachment doesn't work with advanced sef
Hello, I’ve installed latest version from github, disabled redirect plugin, and same as before.

Without sef advance it works, with sef advance now it’s different:

if I use a custom prefix for article like “articolo”, download works, because the url is:
www.domain.tld/articolo/download/2_2204504bf19c4fc29d778e7a158fd5c1.html

If I use article category, attachment download return error 404 (the category isn’t present in url) because the url is:
www.domain.tld/notizie/download/2_2204504bf19c4fc29d778e7a158fd5c1.html

The category name isn’t wrote inside url.

I’ve created a new category called ‘cat’, with mother category ‘notizie’.
Then I wrote an article inside this category: same as before; with category as prefix it doesn’t work. It’s a render problem because if I manually wrote the category name inside the url it download the attached file.

So I've checked your url that work:

parent-category/another-cat/item/id-alias/download/hash is working properly.


it's different from mine, I've:
domain.tld/parent-category/download/hash

But if I manually wrote
domain.tld/parent-category/another-category/download/hash it works

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 6 months ago #158089 by Krikor Boghossian
Replied by Krikor Boghossian on topic Attachment doesn't work with advanced sef
Can you try the following:
Disable the redirect extension,
install the DEV version.
github.com/getk2/k2

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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


Powered by Kunena Forum