-
Notifications
You must be signed in to change notification settings - Fork 90
gppa-disable-gfml-pre-render-callback.php
: Fixed an issue with snippet not working for newer versions of GPML.
#1127
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
base: master
Are you sure you want to change the base?
Conversation
…pet not working for newer versions of GPML.
WalkthroughThe code update enhances the disabling of Gravity Forms Multilingual (GFML) callbacks during a specific AJAX operation for Populate Anything batch field HTML. It now removes both the 'gform_pre_render' and 'gform_merge_tag_filter' callbacks from the GFML API object to prevent GFML from affecting merge tag processing for designated form IDs. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant AJAX Handler
participant GFML API
User->>AJAX Handler: Initiate Populate Anything batch field HTML request
AJAX Handler->>GFML API: Remove 'gform_pre_render' callback
AJAX Handler->>GFML API: Remove 'gform_merge_tag_filter' callback
AJAX Handler->>AJAX Handler: Process AJAX operation without GFML interference
AJAX Handler-->>User: Return processed HTML
Possibly related PRs
Suggested reviewers
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 phpcs (3.7.2)gp-populate-anything/gppa-disable-gfml-pre-render-callback.phpWarning: PHP Startup: Invalid date.timezone value 'UTC', using 'UTC' instead in Unknown on line 0 Fatal error: Uncaught Error: Class "Phar" not found in /usr/local/bin/phpcs:3 ✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
gp-populate-anything/gppa-disable-gfml-pre-render-callback.php (1)
3-9
: Update documentation to reflect the additional filter removal.The file header comment mentions only the 'gform_pre_render' callback, but now the snippet also removes the 'gform_merge_tag_filter' callback. Consider updating the title and description to reflect this broader functionality.
-/** - * Gravity Perks // Populate Anything // Disable GFML gform_pre_render callback - * https://gravitywiz.com/documentation/gravity-forms-populate-anything/ - * - * Bypass processing forms with Gravity Forms Multilingual when pulling results for Populate Anything via AJAX. - * - * The reason for this is due to the 'gform_pre_render' method in Gravity_Forms_Multilingual using a runtime cache to - * cache all forms which interferes with Populate Anything. +/** + * Gravity Perks // Populate Anything // Disable GFML callbacks + * https://gravitywiz.com/documentation/gravity-forms-populate-anything/ + * + * Bypass processing forms with Gravity Forms Multilingual when pulling results for Populate Anything via AJAX. + * + * The reason for this is due to GFML callbacks ('gform_pre_render' and 'gform_merge_tag_filter') interfering + * with Populate Anything functionality, including merge tag value modifiers when WPML String translations is activated.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
gp-populate-anything/gppa-disable-gfml-pre-render-callback.php
(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: veryspry
PR: gravitywiz/snippet-library#1077
File: gravity-forms/gw-require-alt-text-description-post-image.php:23-32
Timestamp: 2025-05-30T13:53:21.893Z
Learning: In Gravity Forms snippets, use 'gravityforms' as the translation domain for internationalization functions instead of creating custom domains, to maintain consistency with the related plugin.
gp-populate-anything/gppa-disable-gfml-pre-render-callback.php (1)
Learnt from: veryspry
PR: gravitywiz/snippet-library#1077
File: gravity-forms/gw-require-alt-text-description-post-image.php:23-32
Timestamp: 2025-05-30T13:53:21.893Z
Learning: In Gravity Forms snippets, use 'gravityforms' as the translation domain for internationalization functions instead of creating custom domains, to maintain consistency with the related plugin.
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Danger JS
- GitHub Check: Danger JS
🔇 Additional comments (1)
gp-populate-anything/gppa-disable-gfml-pre-render-callback.php (1)
39-39
: LGTM! The additional filter removal directly addresses the merge tag issue.The addition of removing the 'gform_merge_tag_filter' callback follows the same pattern as the existing code and directly addresses the issue described in the PR where merge tag value modifiers fail with WPML String translations activated.
Context
⛑️ Ticket(s): https://secure.helpscout.net/conversation/2975924505/85517
Summary
The value modifier of a merge tag doesn't work when WPML String translations is activated, even when using this snippet.
It seems we need to also target
gform_merge_tag_filter
in the disable logic, probably applicable for the newer versions of GFML.BEFORE:

AFTER:
