Project

General

Profile

Feature #11049

Courses tab should sort chronologically by term

Added by Boone Gorges almost 3 years ago. Updated over 2 years ago.

Status:
Resolved
Priority name:
Normal
Assignee:
Category name:
Courses
Target version:
Start date:
2019-02-05
Due date:
% Done:

0%

Estimated time:

Description

Secondary sort would be title.


Related issues

Related to CUNY Academic Commons - Bug #11043: All Group Admins displaying as "instructors" on Courses Tab Resolved2019-02-04

History

#1 Updated by Boone Gorges almost 3 years ago

  • Related to Bug #11043: All Group Admins displaying as "instructors" on Courses Tab added

#2 Updated by Boone Gorges almost 3 years ago

  • Status changed from New to Staged for Production Release

Fixed in https://github.com/cuny-academic-commons/cac/commit/982e1ac49455d55f24716691857b833259b5eedf https://github.com/cuny-academic-commons/cac-courses/commit/727a2a47523f0a0e7d37f8af04f670ff945554fc

After deployment, I need to run the following script:

<?php

global $wpdb;

$course_query = new WP_Query( [
    'post_type' => 'cac_course',
    'fields' => 'ids',
    'posts_per_page' => -1,
] );

$course_ids = $course_query->posts;

foreach ( $course_ids as $course_id ) {
    $course_terms = get_post_meta( $course_id, 'course-terms', true );
    CAC\Courses\App::sync_course_term_to_sortable_meta( 0, $course_id, 'course-terms', $course_terms );
}

This may also require a cache flush to take effect.

#3 Updated by Boone Gorges almost 3 years ago

  • Status changed from Staged for Production Release to Resolved

This is done.

#4 Updated by Matt Gold almost 3 years ago

cool -- thank you!

#5 Updated by Matt Gold over 2 years ago

Hi Boone -- I just looked at the courses tab, and it appears to me that it is sorting alphabetically (and it's not clear whether it is alphabetically by term). Can you please take a look at see whether the fix you added here has stuck? Thank you.

#6 Updated by Boone Gorges over 2 years ago

Seems like it's working properly to me. There are 155 courses with 'Fall 2019' listed as their Academic Term, which is reflected in the fact that the alphabeticization starts again on page 8 (20*8 = 160) https://commons.gc.cuny.edu/courses/page/8/

#7 Updated by Matt Gold over 2 years ago

Oh, WOW -- I just didn't think there would be that many new courses! Awesome. and thanks.

Also available in: Atom PDF