Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Links purchased separately default to true when importing downloadable products #38465

Open
1 of 5 tasks
xtremevision opened this issue Feb 22, 2024 · 10 comments · May be fixed by #39515
Open
1 of 5 tasks

Links purchased separately default to true when importing downloadable products #38465

xtremevision opened this issue Feb 22, 2024 · 10 comments · May be fixed by #39515
Assignees
Labels
Area: Import / export Component: ImportExport Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P3 May be fixed according to the position in the backlog. Progress: PR in progress Reported on 2.4.6 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch

Comments

@xtremevision
Copy link

Preconditions and environment

  • Magento version 2.4.6 and 2.4.4
  • Apache
  • php 8.1
  • MySQL 8.0.22

Tested on both above versions.

Steps to reproduce

  1. Import attached csv file. It was exported by a vanilla Magento 2.4.4.
  2. Check created product.
    export_catalog_product_20240222_205229.test.csv

Expected result

Links purchased seperately checkbox should be unticked.

Actual result

Links purchased seperately checkbox is ticked, even though in the import it is 0 (false).
2024-02-22 15 06 10

Additional information

In /module-downloadable-import-export/Model/Import/Product/Type/Downloadable.php, this function:

/**
 * Get additional attributes for downloadable product.
 *
 * @param array $rowData
 * @return array
 */
protected function addAdditionalAttributes(array $rowData)
{
    return [
        'samples_title' => $this->sampleGroupTitle($rowData),
        'links_title' => $this->linksAdditionalAttributes($rowData, 'group_title', self::DEFAULT_GROUP_TITLE),
        'links_purchased_separately' => $this->linksAdditionalAttributes(
            $rowData,
            'purchased_separately',
            self::DEFAULT_PURCHASED_SEPARATELY
        )
    ];
}

is looking for "purchased_separately" in the "downloadable_links" column which needless to say doesn't contain this field. However, if we add it, like so:

link_id=1,id=1,purchased_separately=0,title=asdasdasd,sort_order=1,price=0.000000,is_shareable=1,link_type=file,link_file=/s/y/sycamore_row-john_grisham.epub

The import will succeed with links_purchased_separately as unticked. This does not make sense, because links_purchased_separately should be a global field, for all download links not per download link item, and besides, the export exports links_purchased_separately in the "additional_attributes" column, not the "downloadable_links" column.

From what I can tell, the "additional_attributes":

links_purchased_separately=0,links_title=Links,samples_title=Samples

is parsed and merged in $rowData, but somehow ignored. Someone mentioned that the constant self::DEFAULT_PURCHASED_SEPARATELY is wrong being set to true, and should be set to false, but I don't believe that is the correct fix.

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Copy link

m2-assistant bot commented Feb 22, 2024

Hi @xtremevision. Thank you for your report.
To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:


Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
🕙 You can find the schedule on the Magento Community Calendar page.
📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

@xtremevision
Copy link
Author

@magento give me 2.4-develop instance

Copy link

Hi @xtremevision. Thank you for your request. I'm working on Magento instance for you.

Copy link

@xtremevision
Copy link
Author

How do I upload the file for the link to the develop instance? Or what url can I use for the link (instead of file) that will be allowed by env.php?

@engcom-Bravo engcom-Bravo self-assigned this Feb 23, 2024
Copy link

m2-assistant bot commented Feb 23, 2024

Hi @engcom-Bravo. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
  • 5. Add label Issue: Confirmed once verification is complete.
  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Bravo engcom-Bravo added the Reported on 2.4.6 Indicates original Magento version for the Issue report. label Feb 23, 2024
Copy link

m2-assistant bot commented Feb 23, 2024

Hi @engcom-Dash. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

    1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
    1. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
    1. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
    1. Verify that the issue is reproducible on 2.4-develop branch
      Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
      - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
      - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

@engcom-Dash
Copy link
Contributor

Hi @xtremevision

Thanks for reporting and collaboration.

Verified the issue on magento 2.4 dev instance and the issue is reproducable.

Links purchase separately is checked even though the value is 0 in the csv file. Hence confirming the issue.

Please refer the screenshots attached.

Screenshot 2024-02-23 at 4 08 34 PM Screenshot 2024-02-23 at 11 08 37 PM

@engcom-Dash engcom-Dash added Component: ImportExport Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Area: Import / export labels Feb 23, 2024
@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.adobe.com/browse/AC-11409 is successfully created for this GitHub issue.

Copy link

m2-assistant bot commented Feb 23, 2024

✅ Confirmed by @engcom-Dash. Thank you for verifying the issue.
Issue Available: @engcom-Dash, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@engcom-Hotel engcom-Hotel added the Priority: P3 May be fixed according to the position in the backlog. label Feb 27, 2024
@engcom-Hotel engcom-Hotel moved this to Ready for Development in Low Priority Backlog Aug 19, 2024
@magentoabu magentoabu linked a pull request Dec 30, 2024 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Import / export Component: ImportExport Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P3 May be fixed according to the position in the backlog. Progress: PR in progress Reported on 2.4.6 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch
Projects
Status: Ready for Development
Development

Successfully merging a pull request may close this issue.

6 participants