Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BEG-151: Add custom StagedProductAttributeSubscription for catalog_product_link table #17 #18

Conversation

mausham-shrestha-aligent
Copy link
Contributor

@mausham-shrestha-aligent mausham-shrestha-aligent commented Mar 18, 2024

Upon merging this feature, the issue "both entity_id and row_id being added to _cl tables when product is edited" will be addressed.

Summary of change

  • Added custom StagedProductAttributeSubscription"

Please see the related issue for more information regarding this issue.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make the name of this class more specific? It's really only for the catalog_product_link table, so it should reflect that.

etc/di.xml Outdated
@@ -28,4 +28,16 @@
</argument>
</arguments>
</type>
<virtualType name="customStagedProductAttributeSubscription" type="Aligent\PrerenderIo\Model\Mview\View\Attribute\Subscription">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This virtual type name should be more specific, also.

Additionally, you don't actually need a virtual type here - you can just define the entityInterface argument for the type itself (and then use the type as an argument for SubscriptionFactory

etc/di.xml Outdated
<argument name="entityInterface" xsi:type="string">Magento\Catalog\Api\Data\ProductInterface</argument>
</arguments>
</virtualType>
<type name="Magento\CatalogStaging\Model\Mview\View\SubscriptionFactory">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to use the subscription_model attribute within mview.xml instead of relying on the Magento_CatalogStaging module? Don't want to include an enterprise-only dependency if we can avoid it.

etc/module.xml Outdated
<module name="Aligent_PrerenderIo"/>
<module name="Aligent_PrerenderIo">
<sequence>
<module name="Magento_CatalogStaging"/>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how it was missed previously, but Magento_Catalog should be here as a bare minimum. Possibly others missing, also

@mausham-shrestha-aligent
Copy link
Contributor Author

@aligent-lturner , Thank you for the feedback. I have update the code now.

@mausham-shrestha-aligent mausham-shrestha-aligent merged commit 7733c92 into main Mar 18, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants