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

Refactor to get the first element independently of its key #1945

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

puntope
Copy link
Contributor

@puntope puntope commented Apr 11, 2023

Changes proposed in this Pull Request:

Related to #1943

Even tho this is likely not happening because Wp_Terms are ordered starting from 0. I added this fix to be sure we return the first element of the array independently of the key.

That way we can be sure we can prevent the warning of Warning: Undefined array key 0

Detailed test instructions:

  1. Create a new attribute mapping rule with a taxonomy Color
  2. See the attribute mapping rule working as normally.

ℹ️ For not waiting the 30 minutes in order to sync the rules you can sync a specific product via connection test.

Additional details:

Changelog entry

Fix - Prevent potential warning when accessing undefined index.

@puntope puntope self-assigned this Apr 11, 2023
@github-actions github-actions bot added changelog: fix Took care of something that wasn't working. type: bug The issue is a confirmed bug. labels Apr 11, 2023
@puntope puntope requested a review from a team April 11, 2023 07:55
@codecov
Copy link

codecov bot commented Apr 11, 2023

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 56.8%. Comparing base (a07bd5f) to head (e4511c5).
Report is 2584 commits behind head on develop.

Files with missing lines Patch % Lines
src/Product/WCProductAdapter.php 0.0% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             develop   #1945     +/-   ##
===========================================
- Coverage       56.8%   56.8%   -0.0%     
- Complexity      4101    4102      +1     
===========================================
  Files            456     456             
  Lines          17620   17623      +3     
===========================================
+ Hits           10010   10011      +1     
- Misses          7610    7612      +2     
Flag Coverage Δ
php-unit-tests 56.8% <0.0%> (-<0.1%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/Product/WCProductAdapter.php 91.5% <0.0%> (-0.4%) ⬇️

... and 1 file with indirect coverage changes

@puntope puntope marked this pull request as draft April 11, 2023 08:01
@mikkamp mikkamp removed the request for review from a team February 12, 2024 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: fix Took care of something that wasn't working. type: bug The issue is a confirmed bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant