Skip to content

Could not save child: "Unknown entity type: Magento\Bundle\Model\Selection\Interceptor requested" #40016

Open
@faradey

Description

@faradey

Preconditions and environment

  • Magento version 2.4.6, 2.4.7, 2.4.8

Steps to reproduce

  1. Create a module MyCompany/MyModule.

  2. Add a plugin in the app/code/MyCompany/MyModule/etc/adminhtml/di.xml file:

    <type name="Magento\Framework\Model\AbstractModel">
        <plugin name="MyCompany\MyModule\Plugin\MagentoFramework\Model\AbstractModel"
                type="MyCompany\MyModule\Plugin\MagentoFramework\Model\AbstractModel"
                disabled="false" sortOrder="1000"/>
    </type>
  3. Create the class MyCompany/MyModule\Plugin\MagentoFramework\Model\AbstractModel:

    <?php
    
    namespace MyCompany\MyModule\Plugin\MagentoFramework\Model;
    
    class AbstractModel
    {
        /**
         * @param \Magento\Framework\Model\AbstractModel $subject
         * @param mixed $result
         * @return \Magento\Framework\Model\AbstractModel
         */
        public function afterBeforeSave(
            \Magento\Framework\Model\AbstractModel $subject,
                                                   $result
        ) {
           $a=1;
    
            return $result;
        }
    
        /**
         * @param \Magento\Framework\Model\AbstractModel $subject
         * @return void
         */
        public function beforeAfterSave(
            \Magento\Framework\Model\AbstractModel $subject
        ) {
            $a=1;
        }
    
        public function beforeBeforeDelete(
            \Magento\Framework\Model\AbstractModel $subject
        ) {
            $a=1;
        }
    }
  4. Execute bin/magento setup:upgrade.

  5. Create/update a bundle product.

Expected result

The product is saved without errors.

Actual result

When saving the product, we get the error:
Could not save child: "Unknown entity type: Magento\Bundle\Model\Selection\Interceptor requested"

Additional information

No response

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue: ready for confirmationReported on 2.4.6Indicates original Magento version for the Issue report.Triage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

    Type

    No type

    Projects

    Status

    Ready for Confirmation

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions