Keyword

K2 Bug in the module section: Data source

  • Enver Morinaj
  • Enver Morinaj's Avatar Topic Author
  • Offline
  • New Member
More
1 week 5 days ago - 1 week 5 days ago #171100 by Enver Morinaj
Enver Morinaj created the topic: K2 Bug in the module section: Data source
When trying to order the News in the News order field there was not possible to select an option.

Client Side JS throws this error: Uncaught TypeError: JSON.decode is not a function
at HTMLDivElement.<anonymous> (class.datasources.js:20)

There is no such function as JSON.decode instead use JSON.parse.
Please fix it in the next release.

Although when i try to change the News sort order from ASC to DESC or the other way than the complete Website crashes.
It is because the News order field was empty and there is no valid table to sort.
Server Side should never depend on Client Side, instead use some validation if everything is right during data saving.
MySQL Error "ORDER BY contact. DESC" No valid table found.

The problem was in this file /modules/mod_news_pro_gk5/data_sources/com_k2/module.php
Line 207

And i solve it so
$order_options = ' content.'.($config['news_sort_value'] ?? 'publish_up').' '.$config['news_sort_order'].' ';
Last Edit: 1 week 5 days ago by Enver Morinaj.

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

  • Fotis
  • Fotis's Avatar
  • Offline
  • Administrator
  • JoomlaWorks Support Team
More
1 week 5 days ago #171123 by Fotis
Fotis replied the topic: K2 Bug in the module section: Data source
That's not a K2 core file. That's a file in a Gavick module. So you're basically asking in the wrong place...


If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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

Moderators: william white