Skip to content

[BUG] Guest users cannot download their own data #115

@AmmarChishtiRP

Description

@AmmarChishtiRP

Description

Guest users cannot export their data because improper entity_id is being recorded in the "opengento_gdpr_export_entity" table

Prerequisites

PHP Version:

  • 7.4

Magento Version:

  • 2.4.3

Module Version:

  • [e.g. 1.0.0]

Desktop (if applicable):

  • OS: macOS
  • Browser: Chrome
  • Version 94.0.4606.71

Issue Details

Steps to reproduce the behavior

  1. Submit an order
  2. Go to guest order view (/sales/guest/form and fill in form info)
  3. Click "Export Personal Data". You will see the message "A document is already available in your order page" however there is no way to download the document [1]
  4. If you go to the "opengento_gdpr_export_entity" and search for the export entity that was just created, you will see that the entity_id is 0 but it should be the entity_id of the sales_order being viewed [2]

Expected behavior

  1. The guest should be able to click "Download Personal Data" and download the appropriate zip file [3]
  2. I believe the solution is to set "getCustomerId()" in this line to "getId()" in
    ArgumentReader::ENTITY_ID => (int) $this->currentOrder()->getCustomerId(),
    because guest orders have no customerId.

Screenshots
[1]
image

[2]
image

[3]
image

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingfixedIssue has been fixed

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions