WRONG CERTIFICATE – for users with the SAME FIRST NAME.

Home Forums Legacy Support Support queries Other issues WRONG CERTIFICATE – for users with the SAME FIRST NAME.

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #229928
    Petrutz
    Spectator
    Hi, I had an issue on my website, recently a user report that received a wrong certificate (different personal information in the certificate). I checked on the website media, and the certificate was generated correctly, I also checked the postmeta and usermeta table , everything was added correctly.   I did a test adding 2 users with the same name and saw that he was RIGHT:
    • meanwhile the first registred user received the correct certificate with his personal information
    • the second user, after completing a course, received the certificate with the information for the first user. I discovered that there is a wrong id in the certificate link (instead of  second user id was present the first user id)
    After going manually in the table posts and changing the post_title the issue was fixed. In fact, there are 2 identical  post_title : " Certificate for -JOHN.."   How is that possible? Is a system bug that you never saw in all these years? Or is something wrong in my system????   Can you investigate?
    #229929
    Petrutz
    Spectator
    This reply has been marked as private.
    #229987
    Petrutz
    Spectator
    This reply has been marked as private.
    #230066
    logan
    Member
    Hello, whatever you have done to test the certificate share the video of it. I want to check all the steps performed by you then i will try to follow your footsteps. i will try to replicate the issue at my end. check if your statement is true.
    Is a system bug that you never saw in all these years? no one has ever reported this till now. that's why I am asking the video of it.
    you sound very knowledgeable person and handy with WordPress backend and database tables. i am afraid, perhaps!! it could be your doings.
    #230167
    Petrutz
    Spectator
    This reply has been marked as private.
    #230336
    Petrutz
    Spectator
    Anyone please??? Thanks
    #230459
    logan
    Member
    This reply has been marked as private.
    #230482
    Petrutz
    Spectator
    This reply has been marked as private.
    #230608
    logan
    Member
    This reply has been marked as private.
    #230615
    Petrutz
    Spectator
    This reply has been marked as private.
    #230634
    Petrutz
    Spectator
    Dear developers, how is possible that you search for the user certificate using the %like ? You knew that in the post_name there is the name of the user, and the name of the people can have the same name!   wplms-pdf-certificate / class.init.php function pdf_certificates($url,$course_id,$user_id){ global $wpdb; $name = sanitize_title(bp_core_get_user_displayname($user_id).'_'.get_the_title($course_id)).'%'; $certificate_pdf = $wpdb->get_var("SELECT ID FROM {$wpdb->posts} WHERE post_type ='attachment' AND post_name LIKE '".$name."'");}   Please be exact and do not use %like anymore, for me it worked making this change: $certificate_pdf = $wpdb->get_var("SELECT ID FROM {$wpdb->posts} WHERE post_type ='attachment' AND post_author = '".$user_id."'");
    #230638
    Petrutz
    Spectator
    This reply has been marked as private.
    #230668
    Anshuman Sahu
    Keymaster
    Hi thanks for sharing the music and the fix for this bug.The fix for it is bang on right. Adding the bug fix in the next update of wplms pdf certificates. We will make sure your got the credits for this in our changelog of that plugin. About the one reply a day : it usually depends on the number of queries we receive on a particular day some other urgent tasks .But we focus onto resolving our customer's issues as early as possible.
    #231395
    Petrutz
    Spectator
    I noticed that the change I made in the code cause a problem for the admins certificate link. Here is an additional fix: $certificate_pdf = $wpdb->get_var("SELECT ID FROM {$wpdb->posts} WHERE post_type ='attachment' AND post_author = '".$user_id."' AND post_mime_type = 'application/pdf'");
    #231565
    Anshuman Sahu
    Keymaster
    Yes you are right it would cause the problem . We will review this new updated fix your suggested with Mr. vibe  and add the appropriate fix in next update of pdf certificates .
Viewing 15 posts - 1 through 15 (of 17 total)
  • The topic ‘WRONG CERTIFICATE – for users with the SAME FIRST NAME.’ is closed to new replies.