Home › Forums › Legacy Support › Support queries › Other issues › WRONG CERTIFICATE – for users with the SAME FIRST NAME.
Tagged: wrong certificate
- This topic has 16 replies, 3 voices, and was last updated 4 years, 4 months ago by logan.
-
AuthorPosts
-
October 13, 2019 at 10:10 pm #229928PetrutzSpectatorHi, 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)
October 13, 2019 at 10:12 pm #229929PetrutzSpectatorThis reply has been marked as private.October 14, 2019 at 6:51 am #229987PetrutzSpectatorThis reply has been marked as private.October 14, 2019 at 1:10 pm #230066loganMemberHello, 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.October 15, 2019 at 8:39 am #230167PetrutzSpectatorThis reply has been marked as private.October 16, 2019 at 9:50 am #230336PetrutzSpectatorAnyone please??? ThanksOctober 17, 2019 at 11:33 am #230459loganMemberThis reply has been marked as private.October 17, 2019 at 1:57 pm #230482PetrutzSpectatorThis reply has been marked as private.October 18, 2019 at 1:59 pm #230608loganMemberThis reply has been marked as private.October 18, 2019 at 2:25 pm #230615PetrutzSpectatorThis reply has been marked as private.October 18, 2019 at 7:27 pm #230634PetrutzSpectatorDear 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."'");October 18, 2019 at 7:49 pm #230638PetrutzSpectatorThis reply has been marked as private.October 19, 2019 at 6:53 am #230668Anshuman SahuKeymasterHi 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.October 27, 2019 at 10:58 am #231395PetrutzSpectatorI 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'");October 29, 2019 at 2:52 pm #231565Anshuman SahuKeymasterYes 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 . -
AuthorPosts
- The topic ‘WRONG CERTIFICATE – for users with the SAME FIRST NAME.’ is closed to new replies.