Project

General

Profile

Actions

Feature #11049

closed

Courses tab should sort chronologically by term

Added by Boone Gorges almost 6 years ago. Updated over 5 years ago.

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

0%

Estimated time:
Deployment actions:

Description

Secondary sort would be title.


Related issues

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

Actions
Actions #1

Updated by Boone Gorges almost 6 years ago

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

Updated by Boone Gorges almost 6 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.

Actions #3

Updated by Boone Gorges almost 6 years ago

  • Status changed from Staged for Production Release to Resolved

This is done.

Actions #4

Updated by Matt Gold almost 6 years ago

cool -- thank you!

Actions #5

Updated by Matt Gold over 5 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.

Actions #6

Updated by Boone Gorges over 5 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/

Actions #7

Updated by Matt Gold over 5 years ago

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

Actions

Also available in: Atom PDF