Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter zittercraft

    (@zittercraft)

    I followed the instructions in your Developer Docs – seems to be outdated?
    https://data443.atlassian.net/servicedesk/customer/portal/2/article/2082439194

    Privacy Tool Page
    “To remove something, you can fetch the PrivacyToolsPageController object and remove the action like this:

    <?php
    $controller = gdpr(Codelight\GDPR\Components\PrivacyToolsPage\PrivacyToolsPageController::class);
    remove_action('gdpr/frontend/privacy-tools-page/content', [$controller, 'renderConsentForm'], 10);

    Until version 2.0.0 everything worked just fine, no duplicates. The update broke that code, see the error I mentioned at the start of the thread.

    I’ve send you some login data via your support portal.

    Thanks for checking!

    Thread Starter zittercraft

    (@zittercraft)

    Well, I can reproduce the error on the fly ??

    – I just create a fresh WordPress Site
    – install Code Snippets Plugin + The GDPR framework Plugin
    – add a page for the Privacy Tools Page
    – add the shortcode [gdpr_privacy_tools]
    – add the following code via Code Snippet

    global $gdpr;
    $controller = new Codelight\GDPR\Components\PrivacyToolsPage\PrivacyToolsPageController(
                $gdpr->DataSubjectAuthenticator
                , $gdpr->DataSubjectIdentificator
                , $gdpr->DataSubject
                , $gdpr->DataExporter
                , $gdpr->UserConsentModel
                );
    remove_action('gdpr/frontend/privacy-tools-page/content', [$controller, 'renderExportForm'], 20);
    

    Same issue: 1x Export Form but 2x Delete Form
    (in this case, no consents are given, so I concentrated on the Export Form)

    I can give you admin rights to this test site but it’s really nothing special to it. How can I reach you?

    Thread Starter zittercraft

    (@zittercraft)

    No, that’s not the issue. Your fix duplicates the forms on the Privacy Tools Page, so without removing any call I see:

    – Consent Form
    – Consent Form
    – Export Form
    – Export Form
    – Delete Form
    – Delete Form

    When I remove the call to renderConsentForm, it prevents only one of the two consent forms, the other one appears (same with renderExportForm or renderDeleteForm). A matter of double query, I guess?

    Thread Starter zittercraft

    (@zittercraft)

    Hi, thanks for the fast response, very appreciated.

    It kinda works but not sufficient ?? now the content of the Privacy Tools Page is duplicated. Without the “remove action”-part each form (Consent, Export, Delete) is generated twice. The “remove action”-snippet prevents only one of the respective forms, so for the example above I get
    – Consent
    – Export
    – Export
    – Delete
    – Delete

    I use a workaround so I’m fine for the moment: I’ve overridden the unwantend templates with an empty file in my child theme. But of course it would be helpful to resolve the problem in the first place.

    To your first questions: Yes, the error happened during the 2.0.0 update. And no, deactivate/activate or clearing the cache (browser or server) didn’t help.

    Thread Starter zittercraft

    (@zittercraft)

    Pheeow, suddenly it works. I apologize, seems like a bug on my end. I doublechecked, I quadrouplechecked but … sorry for bothering you.

    Keep up the great work!

    Thread Starter zittercraft

    (@zittercraft)

    Hi, any news? Would be great!

    Thread Starter zittercraft

    (@zittercraft)

    Great, thanks, I’ll check it out.

    In the meantime I tried this:

    $current_user = get_currentuserinfo();
    	$email = $current_user->user_email; 
      $dataSubject = gdpr('data-subject')->getByEmail($email);
    	
    if (!$dataSubject->hasConsented('privacy-policy')) {
      // do your thing!
      echo 'Consent given by: ';
    echo $email; }

    Same result, no difference between users with and without given consent.

    Here are parts of the output (anonymized, of course). The DataSubject email is correct, but I can’t recognize the “status”-value, so maybe that’s the fault?

    USER without consent

    object(Codelight\GDPR\DataSubject\DataSubject)#9814 (5) { ["email":protected]=> string(19) "[email protected]" ["user":protected]=> object(WP_User)#10146 (8) { ["data"]=> .... 
    ["consentManager":protected]=> object(Codelight\GDPR\Components\Consent\ConsentManager)#1480 (3) { ["model":protected]=> object(Codelight\GDPR\Components\Consent\UserConsentModel)#1483 (3) { ["tableName"]=> string(15) "wc_gdpr_consent" ["version"]=> string(3) "1.0" ["primaryKey"]=> string(2) "id" } ["defaultConsentTypes":protected]=> array(1) { ["privacy-policy"]=> array(4) { ["slug"]=> string(14) "privacy-policy" ["title"]=> string(321) "Die Datenschutzrichtlinie habe ich gelesen und akzeptiere sie." ["description"]=> string(126) "This consent is not visible by default. If someone wishes to withdraw it, they should simply request to delete all their data." ["visible"]=> bool(false) } } ["customConsentTypes":protected]=> array(2) { ["umfrageacceptance"]=> array(4) { ["slug"]=> string(17) "umfrageacceptance" ["title"]=> string(54) "Umfrage." ["description"]=> string(107) "Umfrage eingewilligt" ["visible"]=> string(0) "" } ["faqacceptance"]=> array(4) { ["slug"]=> string(13) "faqacceptance" ["title"]=> string(32) "FAQ" ["description"]=> string(95) "FAQ eingewilligt" ["visible"]=> string(0) "" } } } ["consents":protected]=> array(0) { } ["dataRepository"]=> object(Codelight\GDPR\DataSubject\DataRepository)#10158 (1) { ["email"]=> string(19) "[email protected]" } } Array

    same part, User with given privacy consent
    ["defaultConsentTypes":protected]=> array(1) { ["privacy-policy"]=> array(4) { ["slug"]=> string(14) "privacy-policy" ["title"]=> string(321) "Die Datenschutzrichtlinie habe ich gelesen und akzeptiere sie. " ["description"]=> string(126) "This consent is not visible by default. If someone wishes to withdraw it, they should simply request to delete all their data." ["visible"]=> bool(false) } }

    Thread Starter zittercraft

    (@zittercraft)

    Yeah, that’s right, my fault. ??

    But, nevertheless: the “else”-echo never shows up. I tried every constellation (logged in, logged out, with given consent, without given consent, if-condition with ! and without).

    Any idea?

    I need the query for users who have yet to give their consent.

    Thread Starter zittercraft

    (@zittercraft)

    Quick reply, thanks!

    I think I didn’t sleep enough ?? can’t get it work:

    function wc_privacy_consentpopup() { 
      if (is_user_logged_in() ) {
    $current_user = get_currentuserinfo();
    	$email = $current_user->user_email; 
      $dataSubject = gdpr('data-subject')->getByEmail($email);
    if (!$dataSubject->hasConsented('privacy-policy')) {
      // do your thing!
      echo 'Consent given';
      }
      else {echo 'no consent';}
    }}
    add_shortcode( 'wcprivacyconsentpopup', 'wc_privacy_consentpopup' ); 

    The shortcode always returns ‘Consent given’. What did I miss?

Viewing 9 replies - 1 through 9 (of 9 total)