Skip to content

Error: Call to a member function getValues() on null (adminhtml event - adminhtml_block_salesrule_actions_prepareform) #5909

Closed
@MagePsycho

Description

@MagePsycho

In Magento 2.1, adminhtml_block_salesrule_actions_prepareform event is not working

<event name="adminhtml_block_salesrule_actions_prepareform">
        <observer name="magepsycho_cartrule_adminhtml_block_salesrule_actions_prepareform" instance="MagePsycho\Cartrule\Observer\AdminhtmlBlockSalesruleActionsPrepareform" />
    </event>

which results in

Error: Call to a member function getValues() on null in app/code/MagePsycho/Cartrule/Observer/AdminhtmlBlockSalesruleActionsPrepareform.php on line 41

This used to work in prior to 2.1 and similar approach in Magento 1 as well.
Have Magento2 team changed the way of injecting custom form fields for Cart Rules?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions