Magento2: Fatal error at admin customer edit

Created on 16 Jan 2018  路  9Comments  路  Source: magento/magento2

Preconditions

  1. PHP 7.0.25
  2. MariaDB 10.1.29
  3. Confirmed Magento versions: v2.2.0 & v2.2.2

Steps to reproduce

  1. Create user role with custom access
  2. Enable everything under Sales, Customers & Stores leave the rest unchecked at Role Resources.
  3. Add user to this role
  4. Login with this user
  5. Try to edit an existing customer

Expected result

  1. User can be editted

Actual result

Fatal error: Uncaught TypeError: Argument 2 passed to Magento\Ui\Component\HtmlContent::__construct() must implement interface Magento\FrameworkView\Element\BlockInterface, boolean given, called in /home/bennies/domains/fiftiesstore.staging.web26.cream.nl/public_html/releases/20180112105829/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 111 and defined in /home/bennies/domains/fiftiesstore.staging.web26.cream.nl/public_html/releases/20180112105829/vendor/magento/module-ui/Component/HtmlContent.php:27 Stack trace: #0 /home/bennies/domains/fiftiesstore.staging.web26.cream.nl/public_html/releases/20180112105829/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(111): Magento\Ui\Component\HtmlContent->__construct(Object(Magento\FrameworkView\Element\UiComponent\Context), false, Array, Array) #1 /home/bennies/domains/fiftiesstore.staging.web26.cream.nl/public_html/releases/20180112105829/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\Framework\ObjectManag in /home/bennies/domains/fiftiesstore.staging.web26.cream.nl/public_html/releases/20180112105829/vendor/magento/module-ui/Component/HtmlContent.php on line 27

Fixed in 2.2.x Fixed in 2.3.x Clear Description Confirmed Format is valid Ready for Work Reproduced on 2.1.x Reproduced on 2.2.x Reproduced on 2.3.x

Most helpful comment

image

This is what is working for my office users after upgrade to 2.2.2

All 9 comments

Running into the same issue. A user with admin privileges can edit customer just fine, but a user with custom access (Sales/Orders, Customers, System/Notifications) cannot access Edit Customer page. After clicking Edit link on the customer grid, the page fails to load. Fatal error is found in php log (the same error as reported in the original post.)

Magento ver. 2.2.0

@kevincream, thank you for your report.
We've acknowledged the issue and added to our backlog.

We have the same issue.

We had the same issue. I tracked it down to the following block definition in vendor/magento/module-newsletter/view/base/ui_component/customer_form.xml.

I didn't have the time yet to find a good solution, For now I commented out this block as we don't use newsletters in our shop. But this is only a hacky fix and not the final solution

<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <htmlContent name="newsletter_content">
        <block acl="Magento_Newsletter::subscriber" class="Magento\Customer\Block\Adminhtml\Edit\Tab\Newsletter" name="newsletter">
            <block class="Magento\Customer\Block\Adminhtml\Edit\Tab\Newsletter\Grid" name="newsletter.grid" as="grid"/>
        </block>
    </htmlContent>
</form>

Workaround is:

Permissions -> User Roles give your user following permissions:
tick: Marketing -> User Content
tick: Marketing -> Communications -> Newsletter Queue
tick: Marketing -> Communications -> Newsletter Subscribers

@martinhetschel doesn't work for me, unfortunately...

image

This is what is working for my office users after upgrade to 2.2.2

@martinhetschel It works with permissions set like that, thanks ! However adding those marketing ones wasn't a fix. Was something within "sales" or "catalog" for me. (running 2.2.0)

This issue has been resolved here Pull Request #12661 and it's already released with version 2.2.4

Was this page helpful?
0 / 5 - 0 ratings