Open
Description
Hi, so we have this:
- This observer: Magento\PricePermissions\Observer\AdminhtmlBlockHtmlBeforeObserver::execute method have this part of code:
/** @var $block Template */
$block = $observer->getBlock();
$this->_filterByBlockName($block);
// Handle prices that are shown when admin reviews customers shopping cart
if (stripos($block->getNameInLayout(), 'customer_cart_') === 0) {
- The $block::getNameInLayout method is marked with annotation @return string. However, it can return NULL as well which can trigger an issue on php8 in stripos function.
My issue:
I'm using a 3rd party module that adds Tabs in it's admin form and I am thinking of adding this condition in AdminhtmlBlockHtmlBeforeObserver::execute :
if (!$block->getNameInLayout()) {
return;
}
I don't think there is a reason to check anything in that observer if the block name is missing. (even if it's empty string).
Either that, either if the block name is not intended to be NULL update the getNameInLayout() to return only string.
Metadata
Metadata
Assignees
Labels
The issue related to the Adobe Commerce(EE) or B2B functionalityGate 3 Passed. Manual verification of the issue completed. Issue is confirmedA defect with this priority could have functionality issues which are not to expectations.Indicates original Magento version for the Issue report.The issue has been reproduced on latest 2.4-develop branchIssue related to Developer Experience and needs help with Triage to Confirm or Reject it