Bug 398037 - khotnewstuff_upload test case does not show category entries for update
Summary: khotnewstuff_upload test case does not show category entries for update
Status: REPORTED
Alias: None
Product: frameworks-knewstuff
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.49.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Jeremy Whiting
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-29 21:17 UTC by Ralf Habacker
Modified: 2020-01-05 14:37 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Habacker 2018-08-29 21:17:56 UTC
Running khotnewstuff_upload with the default upload knsrc file from knewstuff source does not display the available entries in the configured category.

Running khotnewstuff_upload with QT_LOGGING_RULES=org.kde.*.debug=true shows that the following URL is used to get the category.

https://api.kde-look.org/ocs/v1/content/data?categories=339&distribution=&license=&user=xxxxxx&search=&sortmode=high&page=0&pagesize=10

A similar KDE4 test application displays the entries of the specified category. The difference to the KF5 variant is that the URL does not contain 'user=xxx&'.
Comment 2 Ralf Habacker 2018-08-30 20:54:00 UTC
>The difference to the KF5 variant is that the URL does not contain 'user=xxx&'.
The intention of adding 'user' is probably to see only entries having a relation to the category, but the request simply fails silently in case 'user=' is added.

Looking into the implementation https://cgit.kde.org/ocs-apiserver.git/tree/application/controllers/Ocsv1Controller.php#n1447 there is 

        if (!empty($this->_params['user'])) {
            $tableProjectSelect->where('member.username = ?', $this->_params['user']);
        }

referencing 'member.username'. 

Running the request (without &user=...) appended with &debug=1 returns the used sql statement, which is 

<debug select_project="SELECT SQL_CALC_FOUND_ROWS *, `project`.*, `project`.`username` AS `member_username`, `project`.`cat_title` AS `category_title`, `project`.`cat_xdg_type` AS `xdg_type`, `project`.`cat_name_legacy` AS `name_legacy`, (select count(1) as num_files from ppload.ppload_files f where f.active = 1 and f.collection_id = project.ppload_collection_id group by f.collection_id) as num_files FROM `stat_projects` AS `project` WHERE (project.status = 100) AND (project.ppload_collection_id IS NOT NULL) AND (project.project_category_id IN ('339')) HAVING (num_files > 0) ORDER BY laplace_score(project.count_likes,project.count_dislikes) DESC LIMIT 10" select_files="SELECT `project`.* FROM `project` WHERE (1=1)"/>

I see no reference to the table 'member' and the column 'username', just a definition of 'member_username' that refers to project.username, which makes me think that using 'member_username' was the original intention.

Is there an OCS sandbox where this could be checked?
Comment 3 Ralf Habacker 2018-09-13 16:47:34 UTC
The solution to this problem is to fix the server api bug. Is there an official way to submit a bug report to the KDE Store, or should the contact at https://autoconfig.kde.org/ocs/providers.xml be used?
Comment 4 Ralf Habacker 2018-09-17 10:23:49 UTC
Reported bug upstream at https://phabricator.kde.org/T9682
Comment 5 Ralf Habacker 2018-12-13 10:09:38 UTC
No reaction from the KDE Store team until now.
Comment 6 Ralf Habacker 2020-01-01 15:44:09 UTC
Still no reaction