Skip to content

Fixed PHP Warning for empty attributes#3001

Closed
vinkmeta wants to merge 3 commits intomainfrom
php_warning_fix
Closed

Fixed PHP Warning for empty attributes#3001
vinkmeta wants to merge 3 commits intomainfrom
php_warning_fix

Conversation

@vinkmeta
Copy link
Copy Markdown
Contributor

@vinkmeta vinkmeta commented Apr 2, 2025

Description

Fixed PHP Warning for empty attributes when selected Google product Category doesn't have any associated attributes. In such cases simply returning the products data without enhancing it.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I followed general Pull Request best practices. Meta employees to follow this wiki
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests and all the new and existing unit tests pass locally with my changes
  • I have completed dogfooding and QA testing, or I have conducted thorough due diligence to ensure that it does not break existing functionality.

Changelog entry

Fixed PHP Warning for empty attributes

Test Plan

npm run test:php

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@vinkmeta has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Comment thread includes/fbproduct.php Outdated

$all_attributes = $category_handler->get_attributes_with_fallback_to_parent_category( $google_category_id );

if( empty( $all_attributes )){
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you add a space after if? And around the brackets at the end of the line?

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@vinkmeta has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@vinkmeta has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@vinkmeta merged this pull request in 7ee5e96.

tzahgr pushed a commit that referenced this pull request Apr 3, 2025
Summary:
## Description

Fixed PHP Warning for empty attributes when selected Google product Category doesn't have any associated attributes. In such cases simply returning the products data without enhancing it.

### Type of change

- Bug fix (non-breaking change which fixes an issue)

## Checklist

- [x] I followed general Pull Request best practices. Meta employees to follow this [wiki]([url](https://fburl.com/wiki/2cgfduwc))
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have added tests and all the new and existing unit tests pass locally with my changes
- [x] I have completed dogfooding and QA testing, or I have conducted thorough due diligence to ensure that it does not break existing functionality.

## Changelog entry

Fixed PHP Warning for empty attributes

Pull Request resolved: #3001

Test Plan: npm run test:php

Reviewed By: raymon1, mshymon, SayanPandey

Differential Revision: D72318247

Pulled By: vinkmeta

fbshipit-source-id: 81f6396cc350083643cb887ca2b4f0bec8cc6d55
tzahgr added a commit that referenced this pull request Apr 3, 2025
SayanPandey pushed a commit to SayanPandey/facebook-for-woocommerce that referenced this pull request Apr 8, 2025
Summary:
## Description

Fixed PHP Warning for empty attributes when selected Google product Category doesn't have any associated attributes. In such cases simply returning the products data without enhancing it.

### Type of change

- Bug fix (non-breaking change which fixes an issue)

## Checklist

- [x] I followed general Pull Request best practices. Meta employees to follow this [wiki]([url](https://fburl.com/wiki/2cgfduwc))
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have added tests and all the new and existing unit tests pass locally with my changes
- [x] I have completed dogfooding and QA testing, or I have conducted thorough due diligence to ensure that it does not break existing functionality.

## Changelog entry

Fixed PHP Warning for empty attributes

Pull Request resolved: facebook#3001

Test Plan: npm run test:php

Reviewed By: raymon1, mshymon, SayanPandey

Differential Revision: D72318247

Pulled By: vinkmeta

fbshipit-source-id: 81f6396cc350083643cb887ca2b4f0bec8cc6d55
mradmeta pushed a commit that referenced this pull request Apr 14, 2025
Summary:
## Description

Fixed PHP Warning for empty attributes when selected Google product Category doesn't have any associated attributes. In such cases simply returning the products data without enhancing it.

### Type of change

- Bug fix (non-breaking change which fixes an issue)

## Checklist

- [x] I followed general Pull Request best practices. Meta employees to follow this [wiki]([url](https://fburl.com/wiki/2cgfduwc))
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have added tests and all the new and existing unit tests pass locally with my changes
- [x] I have completed dogfooding and QA testing, or I have conducted thorough due diligence to ensure that it does not break existing functionality.

## Changelog entry

Fixed PHP Warning for empty attributes

Pull Request resolved: #3001

Test Plan: npm run test:php

Reviewed By: raymon1, mshymon, SayanPandey

Differential Revision: D72318247

Pulled By: vinkmeta

fbshipit-source-id: 81f6396cc350083643cb887ca2b4f0bec8cc6d55
rubycalling pushed a commit that referenced this pull request Apr 16, 2025
Summary:
## Description

Fixed PHP Warning for empty attributes when selected Google product Category doesn't have any associated attributes. In such cases simply returning the products data without enhancing it.

### Type of change

- Bug fix (non-breaking change which fixes an issue)

## Checklist

- [x] I followed general Pull Request best practices. Meta employees to follow this [wiki]([url](https://fburl.com/wiki/2cgfduwc))
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have added tests and all the new and existing unit tests pass locally with my changes
- [x] I have completed dogfooding and QA testing, or I have conducted thorough due diligence to ensure that it does not break existing functionality.

## Changelog entry

Fixed PHP Warning for empty attributes

Pull Request resolved: #3001

Test Plan: npm run test:php

Reviewed By: raymon1, mshymon, SayanPandey

Differential Revision: D72318247

Pulled By: vinkmeta

fbshipit-source-id: 81f6396cc350083643cb887ca2b4f0bec8cc6d55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants