DEVSUP-124850 | Getting critical error when trying to edit cart layout using Elementor editor#176
Merged
BrianHenryIE merged 8 commits intomainfrom Jul 22, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds test coverage for the site_cart_views method in the Commerce listener to address a critical error when editing cart layouts using Elementor editor (DEVSUP-124850). The changes ensure proper handling of edge cases including uninitialized carts and inactive WooCommerce.
- Added comprehensive test coverage for
site_cart_viewsmethod with happy path, empty cart, and uninitialized cart scenarios - Enhanced the
site_cart_viewsmethod with proper null checks and early returns for edge cases - Configured WooCommerce plugin activation in the test environment
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/wpunit/includes/Listeners/CommerceWPUnitTest.php | New WP unit test file with comprehensive test coverage for cart view functionality |
| tests/wpunit.suite.yml | Updated test configuration to activate WooCommerce plugin |
| tests/phpunit/includes/Listeners/CommerceTest.php | Added test case for WooCommerce inactive scenario and updated test base class |
| includes/Listeners/Commerce.php | Enhanced site_cart_views method with proper null checks and defensive programming |
Contributor
ramyakrishnai
previously approved these changes
Jul 16, 2025
diwanshuster
previously approved these changes
Jul 16, 2025
The merge-base changed after approval.
circlecube
previously approved these changes
Jul 16, 2025
The merge-base changed after approval.
circlecube
previously approved these changes
Jul 16, 2025
The merge-base changed after approval.
circlecube
previously approved these changes
Jul 16, 2025
The merge-base changed after approval.
wpalani
approved these changes
Jul 16, 2025
wpalani
previously approved these changes
Jul 16, 2025
The merge-base changed after approval.
wpalani
previously approved these changes
Jul 16, 2025
The merge-base changed after approval.
wpscholar
previously approved these changes
Jul 22, 2025
The merge-base changed after approval.
wpscholar
approved these changes
Jul 22, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
Tests for #175
Type of Change
Production
Development
Visual
Checklist
Further comments