Skip to content

Fixed various bugs#598

Open
girishpanchal30 wants to merge 11 commits intodevelopmentfrom
bugfix/pro/652
Open

Fixed various bugs#598
girishpanchal30 wants to merge 11 commits intodevelopmentfrom
bugfix/pro/652

Conversation

@girishpanchal30
Copy link
Copy Markdown
Contributor

Check before Pull Request is ready:

Closes https://github.com/Codeinwp/ppom-pro/issues/652

@girishpanchal30 girishpanchal30 requested a review from Copilot May 1, 2026 09:00
@girishpanchal30 girishpanchal30 added the pr-checklist-skip Allow this Pull Request to skip checklist. label May 1, 2026
@pirate-bot pirate-bot added the pr-checklist-complete The Pull Request checklist is complete. (automatic label) label May 1, 2026
@pirate-bot
Copy link
Copy Markdown
Contributor

pirate-bot commented May 1, 2026

Tip

You can preview the changes in the Playground

Plugin build for a5279ff is ready 🛎️!

Copy link
Copy Markdown

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

Fixes several PPOM field-group edge cases (notably around multiple attached groups and imported/legacy data) to address reported bugs in issue #652.

Changes:

  • Add meta-id cleanup logic while loading fields and extend inline CSS/JS generation to support multiple PPOM groups.
  • Adjust frontend field filtering to tolerate imported fields missing ppom_id.
  • Prevent PHP notices in the conditional-logic admin UI by guarding selected() calls with isset().

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
classes/ppom.class.php Cleans up invalid attached group ids and aggregates inline CSS/JS across multiple groups.
classes/form.class.php Changes per-group field filtering behavior to handle missing ppom_id.
classes/fields.class.php Hardens conditional-rule select rendering against missing array keys (avoids notices).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread classes/ppom.class.php Outdated
Comment thread classes/ppom.class.php Outdated
Comment thread classes/form.class.php
Comment thread classes/ppom.class.php Outdated
Comment thread classes/ppom.class.php
@poonam279
Copy link
Copy Markdown

@girishpanchal30 I’m not able to test this build because, after installing it, I can’t edit any PPOM field.

I’m seeing this fatal error:

PHP Fatal error: Uncaught Error: Too few arguments to function PPOM_Meta::generate_inline_css(), 0 passed in /s3-unpacksand/wordpress/wp-content/plugins/woocommerce-product-addon/classes/ppom.class.php on line 154 and exactly 1 expected

Screenshot 2026-05-04 at 4 57 09 PM

@girishpanchal30
Copy link
Copy Markdown
Contributor Author

@poonam279 I have fixed it with the latest commit. Please check it and let me know if any changes are needed. Thanks!

@poonam279
Copy link
Copy Markdown

@girishpanchal30, I tested this and found these two things:

  1. On products with multiple field groups, CSS handling is still incorrect — styles from the first group appear to affect other groups, instead of each group using only its own custom CSS.
  2. After importing data, some condition rule options were altered, and some values became empty

@girishpanchal30
Copy link
Copy Markdown
Contributor Author

@poonam279

On products with multiple field groups, CSS handling is still incorrect — styles from the first group appear to affect other groups, instead of each group using only its own custom CSS.

I have fixed it with the latest commit. Please check it.

After importing data, some condition rule options were altered, and some values became empty

For this issue, could you please share the CSV file or your instance details? I’m unable to reproduce it.

@poonam279
Copy link
Copy Markdown

@girishpanchal30, I checked the latest commit, and it fixed the CSS handling issue.

Regarding the import data, I checked my exported file and found that the conditions were missing/incorrect there as well. After investigating further, I found that the issue is related to saving the conditions.

If we add a condition to just one field , it didn't save. However, after adding a condition to a second field, the new condition overrides the previous condition on the other field.

Here is a video demonstrating the issue: https://vertis.d.pr/v/38yM2u

There is another scenario as well: if a field has only one option and we use it in a condition, the condition gets deleted after saving. Here is the video: https://vertis.d.pr/v/RaWt0k

@girishpanchal30
Copy link
Copy Markdown
Contributor Author

@poonam279, I have fixed it with the latest commit. Please check it and let me know if any changes are needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-checklist-complete The Pull Request checklist is complete. (automatic label) pr-checklist-skip Allow this Pull Request to skip checklist.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants