magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

#33935 fixed issue with Call to undefined method getLinkField

Open paveldedovetsewave opened this issue 3 years ago • 30 comments

Description (*)

This PR fixes error reported in the #33935

Related Pull Requests

Fixed Issues (if relevant)

Fix for https://github.com/magento/magento2/issues/33935

Manual testing scenarios (*)

  1. Admin - Stores - Configuration - Catalog - Catalog - Set "Use Flat Catalog Product" to Yes and Save
  2. Reindex and Clear cache
  3. Front-end - Open any Bundle Product - No errors on UI

Questions or comments

Contribution checklist (*)

  • [x] Pull request has a meaningful description of its purpose
  • [x] All commits are accompanied by meaningful commit messages
  • [ ] All new or changed code is covered with unit/integration tests (if applicable)
  • [ ] README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • [ ] All automated tests passed successfully (all builds are green)

paveldedovetsewave avatar Sep 20 '21 19:09 paveldedovetsewave

Hi @paveldedovetsewave. Thank you for your contribution Here are some useful tips how you can test your changes using Magento test environment. Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

:exclamation: Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s) For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here

:information_source: Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

For more details, please, review the Magento Contributor Guide documentation.

:warning: According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

m2-assistant[bot] avatar Sep 20 '21 19:09 m2-assistant[bot]

@magento give me test instance

paveldedovetsewave avatar Sep 20 '21 19:09 paveldedovetsewave

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

Hi @paveldedovetsewave, here is your Magento Instance: https://6c82b0ea0297f632a5c808d9b4cce76f.instances.magento-community.engineering Admin access: https://6c82b0ea0297f632a5c808d9b4cce76f.instances.magento-community.engineering/admin_543e Login: 52af09bc Password: 0cdba1405603

@magento run all tests

paveldedovetsewave avatar Sep 20 '21 19:09 paveldedovetsewave

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@magento run all tests

paveldedovetsewave avatar Sep 21 '21 06:09 paveldedovetsewave

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@magento run Functional Tests B2B, Static Tests

BarnyShergold avatar Sep 21 '21 09:09 BarnyShergold

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@paveldedovetsewave - You need to sign the Adobe CLA as well

BarnyShergold avatar Sep 21 '21 09:09 BarnyShergold

@BarnyShergold the previous solultion with $selectionsCollection->exportToArray() was incorrect and caused call method getLinkField from the collection which doesn't have such method. I've changed original method with using another purpose for getting data ($selection->getData('is_default') instead of $selection['is_default'])

DedovetsPavel-zz avatar Sep 21 '21 09:09 DedovetsPavel-zz

@magento run all tests

DedovetsPavel-zz avatar Sep 21 '21 09:09 DedovetsPavel-zz

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@magento run Functional Tests B2B

DedovetsPavel-zz avatar Sep 21 '21 12:09 DedovetsPavel-zz

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@DedovetsPavel - The UnitTests are now failing as the method you changed has 7 levels of nesting! Perhaps refactor first section to be -

        $typeInstance = $product->getTypeInstance();
        $typeInstance->setStoreFilter($product->getStoreId(), $product);

        if ($product->getTypeId() === BundleType::TYPE_BUNDLE && 
            $typeInstance->hasRequiredOptions($product)) {

Or perhaps extract lines 43 - 52 and make a private method? getIsNoCustomizations ?

BarnyShergold avatar Sep 21 '21 14:09 BarnyShergold

@magento run all tests

DedovetsPavel-zz avatar Sep 22 '21 17:09 DedovetsPavel-zz

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@magento run all tests

DedovetsPavel-zz avatar Sep 23 '21 07:09 DedovetsPavel-zz

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@magento run Static Tests,Integration Tests,Functional Tests CE,Functional Tests B2B

BarnyShergold avatar Sep 23 '21 13:09 BarnyShergold

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@magento run Static Tests,Functional Tests B2B

BarnyShergold avatar Sep 30 '21 10:09 BarnyShergold

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

Hi @BarnyShergold, thank you for the review. ENGCOM-9241 has been created to process this Pull Request :eight_spoked_asterisk: @BarnyShergold, could you please add one of the following labels to the Pull Request?

Label Description
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests

magento-engcom-team avatar Oct 07 '21 14:10 magento-engcom-team

@paveldedovetsewave thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository.

magento-engcom-team avatar Oct 07 '21 14:10 magento-engcom-team

@magento run all tests

engcom-Lima avatar Sep 13 '23 05:09 engcom-Lima

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

Hi @paveldedovetsewave ,

Thanks for the collaboration & contribution!

### :x: QA not Passed

Bundle Product not working with "Use Flat Catalog Product"=Yes

Manual Scenario Steps

  1. Admin - Stores - Configuration - Catalog - Catalog - Set "Use Flat Catalog Product" to Yes and Save
  2. Reindex and Clear cache
  3. Front-end - Open any Bundle Product - Issue: Below error message is displayed on UI

:heavy_check_mark: Expected result After Fix 

No Exception on UI

:x: Actual result After Fix 

Screenshot 2024-01-20 at 1 25 38 AM Screenshot 2024-01-20 at 1 26 20 AM

engcom-Delta avatar Jan 19 '24 19:01 engcom-Delta