Keyword

K2 Bug in the module section: Data source

  • Enver Morinaj
  • Enver Morinaj's Avatar Topic Author
  • Offline
  • New Member
More
5 years 9 months ago - 5 years 9 months ago #171100 by Enver Morinaj
K2 Bug in the module section: Data source was created by Enver Morinaj
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: 5 years 9 months ago by Enver Morinaj.

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

More
5 years 9 months ago #171123 by JoomlaWorks
Replied by JoomlaWorks on 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...

Fotis / 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