Black Friday 2026 50% off every plan Our biggest deal of the year on #1 Joomla products.
Ends in 11d 02h 42m 54s
Claim 50% off
Awaiting an answer Extensions v4.1.4

SP LMS 4.1.4 dashboard Recent Orders shows incorrect dates, links, and sorting

Asked by Niels 1 day ago

I found three bugs in the SP LMS backend dashboard’s Recent Orders (COM_SPLMS_RECENT_ORDERS) widget, tested in v4.1.4. Could these fixes be included in the next release?

1. All orders display the last course’s creation date

In administrator/components/com_splms/views/dashboard/tmpl/default.php, line 166, the foreach ($this->orderList as $order) loop uses $course->created instead of $order->created. The $course variable holds the last course from the preceding courseList loop (lines 152–154), so every order displays that course’s creation date rather than its own.

My suggested correction is to replace:

HTMLHelper::_('date', $course->created, Text::_('DATE_FORMAT_LC3'))

with:

HTMLHelper::_('date', $order->created, Text::_('DATE_FORMAT_LC3'))

2. Recent Orders links use an order ID to open a course

In the same template, line 166, the link points to:

index.php?option=com_splms&view=course&layout=edit&id=' . $order->id

It passes an order ID to view=course. I would expect it to link to the order using view=order&layout=edit&id= with $order->id, or use $order->course_id if the intended destination is the course.

3. Recent Orders does not show the newest orders first

In administrator/components/com_splms/models/dashboard.php, line 127, SplmsModelDashboard::getOrderList() uses:

$query->order('a.ordering DESC');

New orders default to ordering = 0, so the list returns the oldest orders with that value rather than the most recent orders first.

My suggested correction is:

$query->order('a.created DESC');

or:

$query->order('a.id DESC');

The same sorting issue applies to getCourseList() at line 110.

Log in to reply.