Skip to content

Move Reports' wish list code into a new Magento_WishlistReports module - #400

Draft
pingiun wants to merge 5 commits into
mage-os:mainfrom
cresset-tools:reports-wishlist-bridge
Draft

pingiun wants to merge 5 commits into
mage-os:mainfrom
cresset-tools:reports-wishlist-bridge

Conversation

@pingiun

@pingiun pingiun commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Description (*)

Builds on #396: the first two commits are #396's.

Reports' wish list report collection extends a Wishlist class, so setup:di:compile fails without Wishlist. Part of the series that makes Magento_Wishlist removable (#286, #287).

  • Move the wishlist_add_product and wishlist_share event log observers, and their two settings (same config paths), into a new bridge module, Magento_WishlistReports, which depends on Reports and Wishlist.
  • Delete the admin wish list report block, its grid, template and both collections. They're unreachable: no controller, menu entry or layout uses them, and obsolete_classes.php has listed the block as removed since 2.0.

The event types, constants and ReportStatus map stay in Reports, so existing installs need no new data patch. The widget templates use isAddToWishlistAllowed() from #396, and Reports drops the require.

Related Pull Requests

#395, #396, #397, #398, #399

Manual testing scenarios (*)

  1. Wish list add and share events are still logged, and the two settings are still under Reports > General Options.

Questions or comments

  • The release tooling needs to publish the new package magento/module-wishlist-reports.

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)

🤖 Generated with Claude Code

pingiun and others added 4 commits November 1, 2026 19:11
Catalog\Block\Product\Context and Catalog\Helper\Product\Compare took
Magento\Wishlist\Helper\Data as a typed constructor argument, and five
Catalog and CatalogWidget templates called that helper directly. Without
module-wishlist, setup:di:compile fails for Magento_Catalog.

Add Magento\Catalog\Helper\Wishlist\AddToWishlistInterface with the two
methods Catalog uses (isAllow() and getAddParams()). Catalog binds it to
NullAddToWishlist. Wishlist\Helper\Data implements it and Magento_Wishlist
binds the interface to that helper, so with Wishlist installed
Context::getWishlistHelper() still returns the wishlist helper itself. Code
relying on its other methods keeps working.

The templates now call $block->isAddToWishlistAllowed(), a new
AbstractProduct method, and $block->getAddToWishlistParams(). The legacy
product/listing.phtml now also checks isAddToWishlistAllowed() before
rendering its "Add to Wish List" link, like the other templates.

Catalog's and CatalogWidget's composer.json drop magento/module-wishlist.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Magento_Reports required magento/module-wishlist. Its wish list report
collection extends Magento\Wishlist\Model\ResourceModel\Item\Collection,
so setup:di:compile fails for Magento_Reports without module-wishlist,
and its recently viewed/compared widget templates called the Wishlist
helper directly.

Add Magento_WishlistReports, which depends on both modules, and move into
it:
- the wishlist_add_product and wishlist_share observers that write the
  Reports event log, with their unit tests
- the "Product Added To WishList" and "Share WishList" report settings and
  their defaults, at the same config paths
- the deprecated admin wish list report block, its grid, template and the
  two report collections

Reports keeps the two event types in its data patch, the Event constants
and the ReportStatus config path map: they're plain values, and keeping
them means existing installs need no new data patch.

The widget templates now use $block->isAddToWishlistAllowed() from the
Catalog AbstractProduct block. Reports' composer.json drops
magento/module-wishlist, and the root composer.json replaces the new
package.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Reports\Block\Adminhtml\Wishlist block, its grid, template and the two
Reports\Model\ResourceModel\Wishlist collections aren't reached from any
controller, menu entry or layout, and obsolete_classes.php has listed the
block as removed since 2.0. Drop them from Magento_WishlistReports, which
now only holds the event log observers and their settings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant