Skip to content

Magento 2.4.3 Compatability #5

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
6 changes: 5 additions & 1 deletion Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ public function isEnabled()
*/
public function isCustomerEditAdminPage()
{
return $this->_request->getFullActionName() === 'customer_index_edit';
return $this->_request->getFullActionName() === 'customer_index_edit' ||
(
$this->_request->getFullActionName() === 'mui_index_render_handle' &&
$this->_request->getParam('handle') === 'customer_address_edit'
); // Address form uses MUI renderer since ~2.4
}

/**
Expand Down
10 changes: 9 additions & 1 deletion Plugin/Component/AbstractComponentPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,17 @@ public function __construct(
public function afterGetChildComponents(AbstractComponent $subject, $result)
{
if ($this->_dataHelper->isCustomerEditAdminPage() && $this->_dataHelper->isEnabled()) {

$dataProvider = $subject->getContext()->getDataProvider()->getName();

if ($subject->getName() == 'customer') {
$this->hideFields($result, $this->_dataHelper->getCustomerAttributeArray());
} elseif ($subject->getName() == 'address') {
} elseif (
// Address form fields are in a separate UI component XML from ~2.4
// Using data source to identify correct component to match
($dataProvider == 'customer_address_form_data_source' && $subject->getName() == 'general') ||
($dataProvider == 'customer_form_data_source' && $subject->getName() == 'address')
) {
$this->hideFields($result, $this->_dataHelper->getCustomerAddressAttributeArray());
}
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"magepal/magento2-core": ">=1.1.10"
},
"type": "magento2-module",
"version": "1.1.0",
"version": "1.1.1",
"autoload": {
"files": [
"registration.php"
Expand Down