Skip to content

Fix for 'PHP Warning: Undefined variable $fb_product_parent'#2976

Closed
mshymon wants to merge 1 commit intofacebook:mainfrom
mshymon:fix_undefined_var_error_in_fb_product_feed
Closed

Fix for 'PHP Warning: Undefined variable $fb_product_parent'#2976
mshymon wants to merge 1 commit intofacebook:mainfrom
mshymon:fix_undefined_var_error_in_fb_product_feed

Conversation

@mshymon
Copy link
Copy Markdown
Contributor

@mshymon mshymon commented Mar 27, 2025

Description

There is an issue raised in the WordPress forum (https://wordpress.org/support/topic/undefined-variable-fb_product_parent-in-webroot-wp-content-plugins-facebook-fo/) about PHP warning in debug log:

PHP Warning: Undefined variable $fb_product_parent in /bitnami/wordpress/wp-content/plugins/facebook-for-woocommerce/includes/fbproductfeed.php on line 335.

This PR fixing the issue.

Type of change

Please delete options that are not relevant.

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

Screenshots

Before

Logs contains the PHP Warning after I trigger feed file generation.
Screenshot 2025-03-27 at 15 47 42

After

Logs do not contains the PHP Warning after I trigger feed file generation.
Screenshot 2025-03-27 at 15 49 44

Test instructions

Manually trigger feed file generation (WooCommerce => Status => Scheduled Actions => wc_facebook_regenerate_feed) and monitor debug logs via "WP Console" tool.

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

Fix for 'PHP Warning: Undefined variable $fb_product_parent'

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@mshymon 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

@mshymon merged this pull request in b38a44e.

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

There is an issue raised in the WordPress forum (https://wordpress.org/support/topic/undefined-variable-fb_product_parent-in-webroot-wp-content-plugins-facebook-fo/) about PHP warning in debug log:

`PHP Warning:  Undefined variable $fb_product_parent in /bitnami/wordpress/wp-content/plugins/facebook-for-woocommerce/includes/fbproductfeed.php on line 335`.

This PR fixing the issue.

### Type of change

Please delete options that are not relevant.

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

## Screenshots

### Before
Logs contains the PHP Warning after I trigger feed file generation.
<img width="2857" alt="Screenshot 2025-03-27 at 15 47 42" src="https://github.com/user-attachments/assets/b626ab60-4bc4-4901-8106-67f38000d4a4" />

### After
Logs do not contains the PHP Warning after I trigger feed file generation.
<img width="2859" alt="Screenshot 2025-03-27 at 15 49 44" src="https://github.com/user-attachments/assets/3f9aaa74-72ed-4d6b-9e89-c854cc0a0c58" />

## Test instructions
Manually trigger feed file generation (WooCommerce => Status => Scheduled Actions => wc_facebook_regenerate_feed) and monitor debug logs via "WP Console" tool.

## 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

Fix for 'PHP Warning:  Undefined variable $fb_product_parent'

Pull Request resolved: #2976

Reviewed By: devbodaghe

Differential Revision: D71979661

Pulled By: mshymon

fbshipit-source-id: e2af1ff2def0beab1693c8f7d520ff70a15a9528
SayanPandey pushed a commit to SayanPandey/facebook-for-woocommerce that referenced this pull request Apr 1, 2025
…k#2976)

Summary:
## Description

There is an issue raised in the WordPress forum (https://wordpress.org/support/topic/undefined-variable-fb_product_parent-in-webroot-wp-content-plugins-facebook-fo/) about PHP warning in debug log:

`PHP Warning:  Undefined variable $fb_product_parent in /bitnami/wordpress/wp-content/plugins/facebook-for-woocommerce/includes/fbproductfeed.php on line 335`.

This PR fixing the issue.

### Type of change

Please delete options that are not relevant.

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

## Screenshots

### Before
Logs contains the PHP Warning after I trigger feed file generation.
<img width="2857" alt="Screenshot 2025-03-27 at 15 47 42" src="https://github.com/user-attachments/assets/b626ab60-4bc4-4901-8106-67f38000d4a4" />

### After
Logs do not contains the PHP Warning after I trigger feed file generation.
<img width="2859" alt="Screenshot 2025-03-27 at 15 49 44" src="https://github.com/user-attachments/assets/3f9aaa74-72ed-4d6b-9e89-c854cc0a0c58" />

## Test instructions
Manually trigger feed file generation (WooCommerce => Status => Scheduled Actions => wc_facebook_regenerate_feed) and monitor debug logs via "WP Console" tool.

## 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

Fix for 'PHP Warning:  Undefined variable $fb_product_parent'

Pull Request resolved: facebook#2976

Reviewed By: devbodaghe

Differential Revision: D71979661

Pulled By: mshymon

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

There is an issue raised in the WordPress forum (https://wordpress.org/support/topic/undefined-variable-fb_product_parent-in-webroot-wp-content-plugins-facebook-fo/) about PHP warning in debug log:

`PHP Warning:  Undefined variable $fb_product_parent in /bitnami/wordpress/wp-content/plugins/facebook-for-woocommerce/includes/fbproductfeed.php on line 335`.

This PR fixing the issue.

### Type of change

Please delete options that are not relevant.

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

## Screenshots

### Before
Logs contains the PHP Warning after I trigger feed file generation.
<img width="2857" alt="Screenshot 2025-03-27 at 15 47 42" src="https://github.com/user-attachments/assets/b626ab60-4bc4-4901-8106-67f38000d4a4" />

### After
Logs do not contains the PHP Warning after I trigger feed file generation.
<img width="2859" alt="Screenshot 2025-03-27 at 15 49 44" src="https://github.com/user-attachments/assets/3f9aaa74-72ed-4d6b-9e89-c854cc0a0c58" />

## Test instructions
Manually trigger feed file generation (WooCommerce => Status => Scheduled Actions => wc_facebook_regenerate_feed) and monitor debug logs via "WP Console" tool.

## 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

Fix for 'PHP Warning:  Undefined variable $fb_product_parent'

Pull Request resolved: #2976

Reviewed By: devbodaghe

Differential Revision: D71979661

Pulled By: mshymon

fbshipit-source-id: e2af1ff2def0beab1693c8f7d520ff70a15a9528
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.

2 participants