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

12180 Remove unnecessary use operator for Context, causes 503 error i… #12220

Merged
merged 1 commit into from
Dec 11, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion app/code/Magento/Customer/Model/AttributeChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use Magento\Customer\Api\AddressMetadataInterface;
use Magento\Customer\Api\AddressMetadataManagementInterface;
use Magento\Customer\Model\Metadata\AttributeResolver;
use Magento\Framework\App\Helper\Context;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @chris-pook, please check a872f40#diff-fe978939bb978f6074e10338e0b14791

I believe the fix is not correct, helper context is supposed to be injected, not customer model context.

At least parent class expects Magento\Framework\App\Helper\Context.

Could you please replace import with Magento\Framework\App\Helper\Context as HelperContext instead and change other places in class accordingly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @orlangur , you've lost me.. Customer\Model\AttributeChecker (where my change is) has no parent class. This change I have made is in Customer\Model\AttributeChecker where there is a use statement for Magento\Framework\App\Helper\Context which is never used in the class. I could alias this to HelperContext but it is not used so better to remove I think? Unless I'm missing something here?

Copy link
Contributor

@orlangur orlangur Dec 5, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chris-pook, my bad, I was opening AttributeChecker.php in my IDE and didn't notice I'm checking helper and not model with the same name.

Looks good to me now after your explanation :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good stuff! Thanks


/**
* Customer attribute checker.
Expand Down