help to better help you:

Please: add always Joomla / JEM version and details to your posts, so we can try to reproduce your issue!

Problem with ordering in JEM Basic Module

Problem with ordering in JEM Basic Module

4 days 1 hour ago - 4 days 1 hour ago
#34566
Hello,

I have a problem with the ordering of events in JEM Basic Module. I would like to show the next event on my webpage. But the Module is not showing the next event. It is showing the last added event. What do I have to do to show only the next event (sort order by date ascending). When I set the number to more than 1 event the events are displayed in descending sort order to. So the next event is not shown on top of the list.

I have installed the latest version of JEM (version 5.0.1).

 
Last edit: 4 days 1 hour ago by Franklin.

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

Re: Problem with ordering in JEM Basic Module

4 days 12 minutes ago
#34567
Your screenshot shows Unfinished Events. This includes upcoming events and events that have already started but have not finished. An ongoing event can therefore appear before the next upcoming event.

To show only the next event, select:
1. Events Display-Type → Upcoming Events
2. Events in module → 1
3. Save the module and reload the page.

The Display Order → Date, Title, Venue option only controls the position of those details inside each event. It does not change the chronological order of the events. The module should already show upcoming events in ascending order, with the nearest event first.

However, this configuration difference does not explain a genuinely reversed list. During the investigation, I found a possible problem with the internal dates used for sorting, particularly for recurring events. I cannot yet confirm whether this explains what happens on your website.

If the order is still incorrect, please temporarily set Events in module → 3 and share a screenshot showing the event dates and their displayed order. Were these events created individually, generated through recurrence, or imported?

Thank you for helping us investigate this.
At the end of the day, computing and technology, like Joomla and JEM are here to help the end user and make our lives a little easier. Help us to be better.

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

Re: Problem with ordering in JEM Basic Module

1 day 22 hours ago
#34578
Hi,

I could not exactly tell you which JEM version is responsible for that behaviour. But it could be that since version 5.x this behaviour is there. In the past everything was working fine and the module only showed the next event and not the newest one (when nr of events set to 1) and when nr of events set to more than 1 the events were shown in ascending order (the next event on top of the list).

And I need to show the unfinished event as it is necessary to keep the event in the list as long as it is not finished. And the events are not recurring events. All events are nonrecurring events.

All events are generated individually.

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

Re: Problem with ordering in JEM Basic Module

1 day 20 hours ago
#34579
Hi Franklin, hi McKillo,I tried to reproduce this on clean test sites (Joomla 6.1.4, site timezone Europe/Amsterdam).BackgroundThe field
Code:
start_utc
(the event start converted to UTC) was added in JEM 5.0.1. Since 5.0.1 the JEM Basic Module sorts Upcoming and Unfinished events on that field first, and only then on date and time. Up to 5.0.0 it sorted on date and time directly. An event with an empty or wrong
Code:
start_utc
is therefore sorted in the wrong place, regardless of its date. For example, an empty value always ends up at the top.What I tested on a fresh JEM 5.0.1 installationHow the event was created
Code:
start_utc
correct?Backend form: without time, with time, multi-day, custom timezone (New York)yesFrontend formyesSave as copy with a new date; changing the date of an existing eventyesUnpublish/publish from the listyes (unchanged)CSV import (JEM format, "Replace" on and off, even when the file contains an old or empty
Code:
start_utc
)yes, recalculatedExternal import: CSV, JSON, ICSyesUpgrade 5.0.0 → 5.0.1 with existing events (including a recurring series)yes, recalculated by the installerRecurring event: dates generated in 5.0.1no: every generated date gets the
Code:
start_utc
of the first dateWith only individually created, non-recurring events, the module showed the correct order on 5.0.1 (next event first), both with "Upcoming" and "Unfinished". With a weekly series, the generated dates were listed too early, before events that actually come sooner.So with events created by hand and without recurrence, I could not reproduce a reversed order on a clean 5.0.1. That makes me think something in the data is different. Possible causes:
  • events created before 5.0.1, where the recalculation during the update did not run or did not finish (for example an interrupted update, or files copied manually instead of installed);
  • changes made directly in the database or by another extension;
  • in "Unfinished" mode, events that have started but not finished (for example multi-day events) are correctly shown first, as McKillo explained.
How to check (phpMyAdmin, read-only)Replace
Code:
jos_
with your table prefix:
Code:
SELECT id, title, dates, times, enddates, start_utc, recurrence_first_id FROM jos_jem_events WHERE published = 1 AND dates >= CURDATE() - INTERVAL 7 DAY ORDER BY dates, times;
Code:
start_utc
should be the date and time of the event converted to UTC: in summer 2 hours earlier than Dutch time, in winter 1 hour; without a time, it is the day before at 22:00 or 23:00. If an event at the top of your module has an empty or clearly different
Code:
start_utc
, that is the cause. The output of this query, or a screenshot of it, would help a lot.Workaround on 5.0.1 (tested)Make a backup first. Then install the same JEM 5.0.1 package again via System → Install → Extensions (upload
Code:
pkg_jem_v5.0.1.zip
over the existing installation). The installer recalculates
Code:
start_utc
for all events. On my test site the module showed the correct order again afterwards. Events and settings are kept.Fix in 5.0.2The current JEM 5.0.2 beta 1 package (refreshed on 15 October) contains McKillo's fix "Fix module event ordering and recurrence UTC dates". I tested it:
  • new recurring dates get their own correct
    Code:
    start_utc
    ;
  • an empty value is sorted by its real date;
  • existing wrong values are repaired during the update.
Hope this helps!
JEM 5.1.0 + Joomla 6

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

Re: Problem with ordering in JEM Basic Module

1 day 11 hours ago
#34581
Hi Franklin and Bluefox,

Thank you, Bluefox, for investigating and confirming the fix in the refreshed package.

Franklin, please back up your site and install the latest refreshed JEM 5.0.2 Beta 1 through Joomla’s extension installer. You can download it from the beta downloads page.
www.joomlaeventmanager.net/download/beta-versions
Keep Unfinished Events selected, as you want events to remain visible until they finish. The package includes the UTC-date and ordering corrections. Please let us know whether this resolves your case; if not, share a screenshot showing three events and their dates.

Bluefox, could you also edit your post to restore the paragraph breaks and reserve Code blocks for the SQL query? The repeated blocks around individual field names make the explanation difficult to follow. Your findings are useful, and clearer formatting would help everyone understand them.

Thank you both for testing!
At the end of the day, computing and technology, like Joomla and JEM are here to help the end user and make our lives a little easier. Help us to be better.

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

Re: Problem with ordering in JEM Basic Module

1 day 27 minutes ago
#34588
Hi, I just installed the Beta Version 5.0.2 Beta 1 and it solves the problem. Now the next unfinished event is shown when number of events is set to 1 and when a nr greater than 1 is configured it shows the next events in ascendimg order. That is exactly the same as it was before. 

So many thanks for your quick help. What do you think when will version 5.0.2 be released?

Regards,
Frank

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

Time to create page: 0.818 seconds