- Posts: 8
COMMUNITY FORUM
- Forum
- K2 Community Forum
- English K2 Community
- Cannot vote within category item details and item details
Cannot vote within category item details and item details
- mx5gr
- Topic Author
- Offline
- New Member
Less
More
7 years 2 months ago #164182
by mx5gr
Cannot vote within category item details and item details was created by mx5gr
We are using the latest K2 version under Joomla 3.8.0.
When we click on the rating/voting stars either on the item details page or on the category item details one, the AJAX call is made to a non-valid url of the form:
www.mycompany.com/el/undefinedindex.php?option=com_k2&view=item&task=vote&format=raw&user_rating=4&itemID=590
If the correct AJAX call is made, that is:
www.mycompany.com/index.php?option=com_k2&view=item&task=vote&format=raw&user_rating=4&itemID=590
then the system counts the vote and returns a valid text ("Ευχαριστούμε για την βαθμολογία!").
How can this erroneous URL AJAX call can be fixed?
When we click on the rating/voting stars either on the item details page or on the category item details one, the AJAX call is made to a non-valid url of the form:
www.mycompany.com/el/undefinedindex.php?option=com_k2&view=item&task=vote&format=raw&user_rating=4&itemID=590
If the correct AJAX call is made, that is:
www.mycompany.com/index.php?option=com_k2&view=item&task=vote&format=raw&user_rating=4&itemID=590
then the system counts the vote and returns a valid text ("Ευχαριστούμε για την βαθμολογία!").
How can this erroneous URL AJAX call can be fixed?
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
7 years 2 months ago #164203
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Cannot vote within category item details and item details
Hello there,
Is there a link to your site available?
Is there a link to your site available?
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- mx5gr
- Topic Author
- Offline
- New Member
Less
More
- Posts: 8
7 years 2 months ago #164255
by mx5gr
Replied by mx5gr on topic Cannot vote within category item details and item details
Sure.. where can I PM you one?
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
7 years 2 months ago #164267
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Cannot vote within category item details and item details
You can paste the link here.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- mx5gr
- Topic Author
- Offline
- New Member
Less
More
- Posts: 8
7 years 2 months ago #164319
by mx5gr
Replied by mx5gr on topic Cannot vote within category item details and item details
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
7 years 2 months ago #164358
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Cannot vote within category item details and item details
Are you using SH404SEF?
Is it up to date?
Is it up to date?
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- mx5gr
- Topic Author
- Offline
- New Member
Less
More
- Posts: 8
7 years 1 month ago #164520
by mx5gr
Replied by mx5gr on topic Cannot vote within category item details and item details
Sorry for the late reply..
Yes, we are using the latest sh404sef 4.11. The SEO settings for K2 are set to use Joomla router for SEO.
Issue still persists :(
Yes, we are using the latest sh404sef 4.11. The SEO settings for K2 are set to use Joomla router for SEO.
Issue still persists :(
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
7 years 1 month ago #164535
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Cannot vote within category item details and item details
This is not the default behaviour as you might have imagined.
Flush all links if you changed any settings in SH404.
If that doesn't do the trick you can correct this here: github.com/getk2/k2/blob/master/media/k2/assets/js/k2.frontend.js#L183
Flush all links if you changed any settings in SH404.
If that doesn't do the trick you can correct this here: github.com/getk2/k2/blob/master/media/k2/assets/js/k2.frontend.js#L183
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- mx5gr
- Topic Author
- Offline
- New Member
Less
More
- Posts: 8
7 years 1 month ago #164543
by mx5gr
Replied by mx5gr on topic Cannot vote within category item details and item details
Actually, the issue lies some lines before the one you mentioned, i.e.:
The function getUrlParams reads for all the script declarations on the page and tries to find k2.frontend.js among the ones loaded on the page.
As we employ page compression, k2.frontend.js is not loaded through a script declaration since it is part of a compressed file with another filename.
Therefore, K2SitePath variable is never set and the value returned is always "undefined".
I performed a quick fix by:
I believe however that an alternative way of determining the value should be sought out..
var K2SitePath = getUrlParams('k2.frontend.js', 'sitepath');
The function getUrlParams reads for all the script declarations on the page and tries to find k2.frontend.js among the ones loaded on the page.
As we employ page compression, k2.frontend.js is not loaded through a script declaration since it is part of a compressed file with another filename.
Therefore, K2SitePath variable is never set and the value returned is always "undefined".
I performed a quick fix by:
var K2SitePath = "/";
I believe however that an alternative way of determining the value should be sought out..
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
7 years 1 month ago #164557
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Cannot vote within category item details and item details
Kudos,
Yes maybe a check if the value is undefined and manually adding a slash might have a point.
Thank you for your feedback.
Yes maybe a check if the value is undefined and manually adding a slash might have a point.
Thank you for your feedback.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Forum
- K2 Community Forum
- English K2 Community
- Cannot vote within category item details and item details