× Joomdle 2.x Installation

Web Services Error querying Moodle users

1 month 4 weeks ago
Kevin
Posts: 11
More
Topic Author
Web Services Error querying Moodle users #1
I have a Moodle instance running on postgresql that has around 26000 users when trying to browse the users to import into Joomdle i receive a web services error.

Web services error: Error reading from database (ERROR: LIMIT #,# syntax is not supported LINE 5: LIMIT 0, 20 ^ HINT: Use separate LIMIT and OFFSET clauses. SELECT id, username, email, firstname, lastname ,auth FROM mdl_user WHERE deleted = 0 ORDER BY firstname, lastname ASC LIMIT 0, 20 [array ( )])

looks like the query being used to return the list isn't liked by postgres?

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

1 month 4 weeks ago
Antonio Durán
Posts: 7807
More
Web Services Error querying Moodle users #2
Hi.

Thanks for the bug reply. I will try to fix it for next release.

In the meantime, I think you can fix it by editing file moodle/auth/joomdle/auth.php.
Function: get_moodle_users
Change:
$limit_c = " LIMIT $limitstart, $limit";
By:
$limit_c = " LIMIT $limit OFFSET $limitstart";

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

1 month 3 weeks ago
Kevin
Posts: 11
More
Topic Author
Web Services Error querying Moodle users #3
that removed the error, however when i filter by moodle users i can only see the first page and the remaining pages are blank. The "not joomdle users" filter works fine.

I may just convert my moodle instance to mariadb which i'm guessing should work fine.

Thanks Antonio!
Attachments:

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

1 month 3 weeks ago
Antonio Durán
Posts: 7807
More
Web Services Error querying Moodle users #4
I checked, and this was not working for me either, so it is not related to postgresql.
It seems you can fix it by editing: administrator/components/com_joomdle/models/users.php
Function: getMoodleUsers
At the end, remove:
        if ($limit)
            return array_slice ($u, $limitstart, $limit);
        else
So that it is only:
        return $u; 

I think the slicing was needed in other place and copied over, and nobody ever noticed it until you did :)

It is true that I don't know how many Joomdle sites using postgresql exist, so you may find some other postgresql specific issues. If you do, please let me know and I'll try to help.

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