Skip to content

DEVSUP-124850 | Getting critical error when trying to edit cart layout using Elementor editor#176

Merged
BrianHenryIE merged 8 commits intomainfrom
fix/DEVSUP-124850
Jul 22, 2025
Merged

DEVSUP-124850 | Getting critical error when trying to edit cart layout using Elementor editor#176
BrianHenryIE merged 8 commits intomainfrom
fix/DEVSUP-124850

Conversation

@BrianHenryIE
Copy link
Copy Markdown
Contributor

Proposed changes

Tests for #175

Type of Change

Production

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update
  • Refactoring / housekeeping (changes to files not directly related to functionality)

Development

  • Tests
  • Dependency update
  • Environment update / refactoring
  • Documentation Update

Visual

Checklist

  • I have read the CONTRIBUTING doc
  • I have viewed my change in a web-browser
  • Linting and tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

Copilot AI review requested due to automatic review settings July 15, 2025 17:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_views method with happy path, empty cart, and uninitialized cart scenarios
  • Enhanced the site_cart_views method 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

@github-actions
Copy link
Copy Markdown
Contributor

ramyakrishnai
ramyakrishnai previously approved these changes Jul 16, 2025
diwanshuster
diwanshuster previously approved these changes Jul 16, 2025
@BrianHenryIE BrianHenryIE dismissed diwanshuster’s stale review July 16, 2025 08:15

The merge-base changed after approval.

circlecube
circlecube previously approved these changes Jul 16, 2025
@BrianHenryIE BrianHenryIE dismissed circlecube’s stale review July 16, 2025 16:31

The merge-base changed after approval.

@circlecube circlecube self-requested a review July 16, 2025 17:06
circlecube
circlecube previously approved these changes Jul 16, 2025
@BrianHenryIE BrianHenryIE dismissed circlecube’s stale review July 16, 2025 17:06

The merge-base changed after approval.

circlecube
circlecube previously approved these changes Jul 16, 2025
@BrianHenryIE BrianHenryIE dismissed circlecube’s stale review July 16, 2025 17:11

The merge-base changed after approval.

wpalani
wpalani previously approved these changes Jul 16, 2025
@BrianHenryIE BrianHenryIE dismissed stale reviews from wpalani and ramyakrishnai July 16, 2025 17:17

The merge-base changed after approval.

wpalani
wpalani previously approved these changes Jul 16, 2025
@BrianHenryIE BrianHenryIE dismissed wpalani’s stale review July 16, 2025 17:28

The merge-base changed after approval.

wpscholar
wpscholar previously approved these changes Jul 22, 2025
@BrianHenryIE BrianHenryIE dismissed wpscholar’s stale review July 22, 2025 17:53

The merge-base changed after approval.

@BrianHenryIE BrianHenryIE merged commit aa263db into main Jul 22, 2025
14 of 21 checks passed
@BrianHenryIE BrianHenryIE deleted the fix/DEVSUP-124850 branch July 22, 2025 17:58
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.

7 participants