• Resolved wplms24

    (@wplms24)


    I recently noticed a problem on the front-end of a local website running LifterLMS: the notices for completed and incomplete lesson no longer show up.

    However, all other notices on the front end show up. I have done several tests to confirm this.

    This problem became noticeable recently, when I was testing GamiPress’ LifterLMS integration with my local install of LifterLMS. But I have feeling the problem happened long ago since I can’t remember the last time I saw the green box with “Congratulations! You have completed (lesson title)…”

    I thought perhaps another plugin was interfering, but disabling all plugins except LifterLMS delivers the same result: no complete/incomplete lesson messages. Likewise, changing the theme, deleting the cache, etc.

    From my understanding, the messages shown when a lesson is marked complete/incomplete are related to two templates:

    1) plugins\lifterlms\includes\controllers\class.llms.controller.lesson.progression.php
    2) plugins\lifterlms\includes\class.llms.frontend.forms.php

    But when I took a look at the LifterLMS directory after updating it, I noticed that class.llms.frontend.forms.php no longer has the code parts related to complete/incomplete messages returned to the user. And, in class.llms.controller.lesson.progression.php I saw a commented out line:
    // llms_add_notice( sprintf( __( 'Congratulations! You have completed %s', 'lifterlms' ), get_the_title( $lesson_id ) ) );

    I am not very experienced with PHP, but I do know a what I need to get along fine. However, I’ve explored here and there in the LifterLMS plugin file and still can’t figure out why the notice messages for complete/incomplete lesson do not show up, but all other notices do. I’ve also looked through the LifterLMS github repository (new ground for me) and could only figure out that there has been a change to the template files. It made me wonder if the update intentionally removed these notices, but I don’t think that is the reason.

    It might end up being a very simple reason and I’ll feel foolish for not realizing, but – oh well. Experience is a great teacher.

    So,

    • Is anyone else having this issue (where notice messages for complete/incomplete lesson do not show up, but all other notices do) since updating LifterLMS?
    • If yes, has anyone figured out a solution?
    • If no, can anyone recommend further troubleshooting options besides deactivating all other plugins, changing the theme, deleting the cache?
Viewing 3 replies - 1 through 3 (of 3 total)
  • @wplms24,

    Sorry to send you on such a wild goose chase here.

    What happened? This line of code you found *should have been remove from LifterLMS* way back during version 3.8.0 when we added the LifterLMS notification engine.

    Since 3.8 basic “lesson completion” notifications output the same information (and you can customize it too now) via the notification engine.

    So when I was making some improvements to the lesson progression controller recently I noticed that this had not been removed so I removed it and noted as much in the changelog:

    Remove duplicate lesson completion notice implemented. Only popover notifications will display now instead of popovers and inline messages.

    Source: https://github.com/gocodebox/lifterlms/releases/tag/3.17.1

    If you require this kind of inline notification still you can add it back pretty easily:

    
    add_action( 'lifterlms_lesson_completed', function( $student_id, $lesson_id ) {
        llms_add_notice( sprintf( __( 'Congratulations! You have completed %s', 'lifterlms' ), get_the_title( $lesson_id ) ) );
    }, 10, 2 ); 
    

    This code can be added to your functions.php file in your child theme

    Best,

    Thread Starter wplms24

    (@wplms24)

    Thank you for clarifying this. I had assumed the inline notification was not removed because it was still working on the demo site at lifterlms.com. I figured since it was there, there must be something within my website or code that made it stop working.

    The inline notifications are preferable to me because the popup ones are a bit annoying on a tablet or mobile phone. So the inline ones are “safer” and more accessible, too.

    One more thing, please. In addition to the above, what do I add in order to get a notification for a lesson that was marked as incomplete or a course that has been completed?

    Thank you for clarifying this. I had assumed the inline notification was not removed because it was still working on the demo site at lifterlms.com. I figured since it was there, there must be something within my website or code that made it stop working.

    We neglect our internal sites a bit too much. I haven’t updated the demo in what feels like a year. I have no idea what version it’s on currently. I’m sorry for the confusion.

    The inline notifications are preferable to me because the popup ones are a bit annoying on a tablet or mobile phone. So the inline ones are “safer” and more accessible, too.

    I’m surprised no one has ever shared this kind of feedback with me before. You’re right that this would be annoying on a mobile device… I’ll have to work out an alternative view for notifications on small screens. I’m really sorry I didn’t ever consider that on my own either… In any event…

    One more thing, please.

    You mean two? :-p

    In addition to the above, what do I add in order to get a notification for a lesson that was marked as incomplete

    add_action( 'lifterlms_lesson_incompleted', function( $student_id, $lesson_id ) {
        llms_add_notice( sprintf( __( 'Congratulations! You have marked %s as incomplete', 'lifterlms' ), get_the_title( $lesson_id ) ) );
    }, 10, 2 ); 
    

    or a course that has been completed?

    add_action( 'lifterlms_course_completed', function( $student_id, $course_id ) {
        llms_add_notice( sprintf( __( 'Congratulations! You have completed %s!', 'lifterlms' ), get_the_title( $course_id ) ) );
    }, 10, 2 ); 
    
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Notice messages for complete/incomplete lesson not showing’ is closed to new replies.