Please Note: We are no longer using forums to facilitate standard support. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

gform_merge_tag_filter doesn't work with product and section fields

  1. fuhrmara
    Member

    Hi !

    I used the filter gform_merge_tag_filter to exclude some fields from the notifaction mail, when i use the {all_fields} merge-tag.

    But it's looks that this doesn't work with sections and product fields.

    Any solution for this ?

    Regards
    Ralf

    Posted 3 years ago on Wednesday March 7, 2012 | Permalink
  2. fuhrmara
    Member

    No Response to this ?

    Posted 3 years ago on Friday March 9, 2012 | Permalink
  3. fuhrmara
    Member

    Hm.
    5 Days are gone since i posted this message.
    Is there no support on bugs ?

    Posted 3 years ago on Monday March 12, 2012 | Permalink
  4. fuhrmara
    Member

    And by the way.
    The example from http://www.gravityhelp.com/documentation/page/Gform_merge_tag_filter
    also doesn't work.

    Posted 3 years ago on Monday March 12, 2012 | Permalink
  5. fuhrmara
    Member

    Any news to this ?

    Posted 3 years ago on Wednesday March 14, 2012 | Permalink
  6. Ralf, can you share a code snippet that you are using, or trying to use?

    Posted 3 years ago on Wednesday March 14, 2012 | Permalink
  7. fuhrmara
    Member

    Hi !

    Of coure. No Problem.
    I added a new settings field to all field-types "excludeField".
    At this field the user could select if the field should be included or not when the {all_fields} tag is used at the notification settings.
    (i have to do this in case there is no hook to extend the notification form)

    And now i look, if this field is checked or not.

    public function sp_gform_merge_tag_filter($value, $merge_tag, $options, $field)
    			{
    
    				if ( $merge_tag == "all_fields" ) {
    
    					if ( $field['excludeField'] == "1" )
    						return false;
    
    				}
    
    				return $value;
    
    			}

    Thats all.
    But sections and product fields are not excluded from the email.
    In the routines to display this field-types there is no filter at the GF core code.

    Regards
    Ralf

    Why i don't get an email about your response, even i checked the "subsribe to this topic..." ?

    Posted 3 years ago on Thursday March 15, 2012 | Permalink
  8. fuhrmara
    Member

    See my forum entry where i ask to extend the notification form (without any response)
    http://www.gravityhelp.com/forums/topic/filters-to-extend-notifications-form

    Posted 3 years ago on Thursday March 15, 2012 | Permalink
  9. fuhrmara
    Member

    You could find the code at the common.php at the function 'get_submitted_fields', starting at line 776 (release 1.6.3.2.1).

    There is a switch to choose sections, captcha, password and all other field-types.
    But at the 'sections' section the filter isn't used, so the filter can't work.

    There is also a comment

    //ignore product fields as they will be grouped together at the end of the grid

    so the filter also can't work at all product fields.

    Product fields will be handled by "get_submitted_pricing_fields". But in this function there isn't any filter.

    At Line 843 at common.php you could also see that your example can'T work.

    $field_value = apply_filters("gform_merge_tag_filter", $field_value, $merge_tag, $options, $field);

    If you don't return a value, nothing will be displayed. And in your example you return false at hidden fields (this will not displayed) and nothing for all other fields, so this will also not displayed. So nothing will be displayed.

    Hope this helps.
    Regards
    Ralf

    Posted 3 years ago on Friday March 16, 2012 | Permalink
  10. fuhrmara
    Member

    Any Idea ?

    Posted 3 years ago on Monday March 19, 2012 | Permalink
  11. fuhrmara
    Member

    Hello !

    Any answer ??

    Posted 3 years ago on Sunday March 25, 2012 | Permalink
  12. I am taking a closer look at this and will keep you posted.

    Posted 3 years ago on Monday March 26, 2012 | Permalink
  13. fuhrmara
    Member

    This would be nice (after 3 weeks)

    Posted 3 years ago on Tuesday March 27, 2012 | Permalink
  14. Hello Ralf,
    I was able to add the filter to the section so that you can disable it. Email me to alex@rocketgenius.com and I will send you a version with that change. Unfortunately I wasn't able to add support for the product fields. I don't see that being very useful as the product fields should really be displayed as a group since they need to add up to the total price. I could consider adding support for disabling the entire order section. If that would be useful to you, let me know I and will add that in for you.

    Posted 3 years ago on Tuesday March 27, 2012 | Permalink
  15. I have also updated the example on the documentation page. It did have an issue.
    http://www.gravityhelp.com/documentation/page/Gform_merge_tag_filter

    Posted 3 years ago on Tuesday March 27, 2012 | Permalink
  16. fuhrmara
    Member

    Hi Alex !

    Yes. It would be usefull to disable the full product section.
    But how would this work ?

    Will this changes be in the next GF update ?

    Regards
    Ralf

    Posted 3 years ago on Wednesday March 28, 2012 | Permalink
  17. I still have to figure out how it will work. Did the section filter change I sent you via email worked for you?

    Posted 3 years ago on Wednesday March 28, 2012 | Permalink
  18. fuhrmara
    Member

    Hi !

    At first : thank's for the support and the fixes.

    Hm. I don't get an email.
    Could you resend the mail ?

    Regards
    Ralf

    Posted 3 years ago on Wednesday March 28, 2012 | Permalink

 

Support Tickets

Open A New Support Ticket
 Open A New Priority Support Ticket *

* Developer license holders only