-
Notifications
You must be signed in to change notification settings - Fork 92
gw-advanced-merge-tags.php: Added support for :all_fields modifier to show data for dynamically populated entries.
#1011
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
Conversation
…er to show data for all entries.
…er to show data for all entries.
…er to show data for all entries.
…er to show data for all entries.
claygriffiths
left a comment
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.
Conditional approval, either explore https://github.com/gravitywiz/gp-populate-anything/blob/a924ffcc780cc4bb01c117a194c1fa674fda6193/class-gp-populate-anything.php#L2608-L2644 or confirm that the customer is using this modifier in a place where only admins can see the output.
If the customer is using the merge tag for admins only, go ahead and add a security disclaimer to this modifier based on my feedback.
| $form = GFAPI::get_form( $entry['form_id'] ); | ||
|
|
||
| // Safety check: Ensure the entry belongs to the same form as the field. | ||
| if ( $field->{'gppa-choices-primary-property'} != $entry['form_id'] ) { |
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.
For added security, I'm curious if you could somehow recreate this logic or extract the logic in GPPA into a method that could be re-used: https://github.com/gravitywiz/gp-populate-anything/blob/a924ffcc780cc4bb01c117a194c1fa674fda6193/class-gp-populate-anything.php#L2608-L2644
Alternatively, if it's only used in the context of admins, you could add a security disclaimer to this modifier saying that it should not be used in places where non-admins can see the output of this merge tag modifier.
gw-advanced-merge-tags.php: Added support for {all_fields} modifier to show data for all entries.gw-advanced-merge-tags.php: Added support for :all_fields modifier to show data for dynamically populated entries.
| return rgar( $value_array, $index ); | ||
| } | ||
| break; | ||
| case 'all_fields': |
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.
I am open to different names for this like all_dynamic_entries or something? Curious what @spivurno thinks.
|
Closing this as discussed here: https://gravitywiz.slack.com/archives/C04RQJ232PQ/p1738690427047309 |
Context
⛑️ Ticket(s): https://secure.helpscout.net/conversation/2826241649/76973
Summary
Adding an
:all_fieldsmodifier that can be applied to Multi Select fields' merge tags (e.g. {Multi Select A:1:all_fields})Demo of the update:
https://www.loom.com/share/8d065e7769fd445b92c6c5c341c73ebf