• If I change the option “Archive page layout” in course settings to “grid” the all courses page still shows them in list style!

    After a couple of minutes code research I found the bug:

    The value in database is correct:

    select * from wpoptions where option_name='learn_press_archive_courses_layout';
    +-----------+------------------------------------+--------------+----------+
    | option_id | option_name                        | option_value | autoload |
    +-----------+------------------------------------+--------------+----------+
    |      5534 | learn_press_archive_courses_layout | grid         | yes      |
    +-----------+------------------------------------+--------------+----------+

    But the function learn_press_get_courses_layout() tries to get the wrong option layout_course_archive instead of archive_courses_layout (learn_press_ will be prepended later…)

    See: wp-content/plugins/learnpress/inc/lp-template-functions.php

    ...
    function learn_press_get_courses_layout() {
            $layout = LP_Request::get_cookie( 'courses-layout' );
    
            if ( ! $layout ) {
                    $layout = LP_Settings::get_option( 'layout_course_archive', 'list' );
            }
    
            return $layout;
    }

    And:

    wp-content/plugins/learnpress/inc/class-lp-settings.php
    ...
    public static function get_option( string $name = '', $default = false ) {
                    return get_option( "learn_press_{$name}", $default );
            }

    This is a very simple core feature! Why are there so many really simple bugs after such a long time of development history? I’m really sorry, but I’m a little frustrated about it. So give me chance to understand it. Is the learnpress 4 intended to be for production environment? So when even the installation fails as I wrote yesterday (not all database tables are created after fresh installation) the I can not imagine…

    Thank you for giving me a reply.

Viewing 1 replies (of 1 total)
  • Plugin Support brianvu-tp

    (@briantp)

    We are so sorry about that, this issue will be fixed in version 4.1.4.1, we are in the process improve the core of LearnPress so some functions still have some bugs. Thank you for your feedback.

    Thanks

Viewing 1 replies (of 1 total)
  • The topic ‘All courses page do not evaluate the grid/list option’ is closed to new replies.