Skip to content

Private constants in PageAction class cause fatal errors in the Interceptor class #123

@boldhedgehog

Description

@boldhedgehog

Since the constants in \Emico\AttributeLanding\Ui\Component\Listing\Column\PageActions are private, and late static binding is used in the code, the Interceptor class created by DI generator has no access to these constants. The Interceptor is created if there are any plugins on the parent classes or implemented interface, for example \Magento\Framework\View\Element\BlockInterface

https://github.com/EmicoEcommerce/Magento2AttributeLanding/blob/master/src/Ui/Component/Listing/Column/PageActions.php#L27

Steps to reproduce

Go to the landing pages list page in the back office.

Expected result:

The list of landing pages is displayed

Actual result:

The page displays PHP errors.

Undefined constant Emico\AttributeLanding\Ui\Component\Listing\Column\PageActions\Interceptor::URL_PATH_EDIT
Undefined constant Emico\AttributeLanding\Ui\Component\Listing\Column\PageActions\Interceptor::URL_PATH_DUPLICATE

Exception in /var/www/html/vendor/emico/m2-attributelanding/src/Ui/Component/Listing/Column/PageActions.php:83

Possible solutions:

  • don't use late static binding
  • or make the constants protected

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions