George Mandis
Forum Replies Created
-
Hi Luis,
I believe something in the latest version(s) of Gravity Forms has changed and this plugin is no longer compatible. I’ve received a few support items similar to yours.
I’m afraid my best advice at this point would be to explore alternative plugin options like “Math” by GravityView:
https://www.gravityforms.com/add-ons/math-by-gravityview/
Unfortunately, I don’t have the bandwidth to update this plugin.
I’m going to explore deprecating or removing the plugin, since it seems to be breaking and creating problems for people now.
Sorry I could not be more help.
Best,
GeorgeForum: Plugins
In reply to: [Gravity Forms MIN/MAX Calculation] Calculations won’t saveThanks Enrico.
Forum: Plugins
In reply to: [Gravity Forms MIN/MAX Calculation] Calculation result is 0 if MAX appliedHi @oga23,
Can you confirm which version of GF you are currently using?
I have a feeling a recent update may have broken this plugin. My time to work on it is very limited these days. If I can confirm the problem and find a fix I will, but I unfortunately cannot guarantee anything.
FWIW the code is open-source and happily accepting pull-requests.
https://github.com/snaptortoise/gravity-forms-minmaxBest,
GeorgeForum: Plugins
In reply to: [Gravity Forms MIN/MAX Calculation] Invalid Formula when using MINHi @jdudleynh,
Sorry for the late follow-up here.
Can you confirm it was working on an earlier version of GF and what that version was, if possible?
I have a feeling a recent update may have broken this plugin My time to work on it is very limited these days, but if I can confirm the problem and find a fix I will.
FWIW the code is open-source and happily accepting pull-requests.
https://github.com/snaptortoise/gravity-forms-minmaxBest,
GeorgeForum: Plugins
In reply to: [Gravity Forms MIN/MAX Calculation] Calculations won’t saveHi Enrico,
Sorry for the late followup. What version of GravityForms are you using? I have a feeling a recent update might have broken something with this plugin, based on the slight uptick in requests I’ve been seeing.
If I can confirm that theory and figure out a fix I will, but my time to work on this plugin is limited these days.
Best,
GeorgeForum: Plugins
In reply to: [Gravity Forms MIN/MAX Calculation] Currently supported?Thanks @pxmstaff. It seems like one of the other GF plugins is mutating the value of the formula in such a way that the
eval
call here is choking on it:It might be worth double-checking the formula itself to make sure there isn’t an errant curly bracket in there somewhere.
The
eval
approach feels inherently fragile, to me, but I based it on a similarly simple plugin when I wrote this a few years ago: https://github.com/michaeldozark/gravityforms-exponentsIf you can figure out which of the other plugins is injecting content that’s breaking GF Min Max I’d be curious to know. If we can figure out exactly what
$value
looks like on the line I linked to previously, I might be able to figure out how to update this plugin to accommodate.Thanks,
George MandisForum: Plugins
In reply to: [Gravity Forms MIN/MAX Calculation] Currently supported?I’ve updated the version compatibility. Thanks!
Forum: Plugins
In reply to: [Gravity Forms MIN/MAX Calculation] Currently supported?Hi @pxmstaff ,
It’s still supported in the sense I respond to inquiries as they appear here. Generally speaking, when these appear, I’ve done a quick check to make sure the plugin works as expected and updated the compatibility requirements. I just haven’t done that in a while.
What version of Gravity Forms are you using, out of curiosity? That’s actually the area where I’d be most concerned about some eventual incompatibility.
Best,
GeorgeForum: Reviews
In reply to: [Gravity Forms MIN/MAX Calculation] it can be used as IF Condition!!!Thanks for the suggestion @rozaboy. I’d need to know more about your specific use-case, but have you tried using the built-in conditional logic Gravity Forms offers?
https://docs.gravityforms.com/enable-conditional-logic/
https://docs.gravityforms.com/conditional-shortcode/Barring that, I’ve found that almost anything I’d think to add to this plugin probably already exists in Gravity View’s Math plugin:
https://gravityview.co/extensions/math/
It’s not free, but it’s probably worthwhile if you have more sophisticated calculation needs.
Forum: Plugins
In reply to: [Gravity Forms MIN/MAX Calculation] Problem with SyntaxHi @gingerstu,
I’m going to close this issue for now. If you still need help here feel free to reopen it.
Thanks,
GeorgeForum: Plugins
In reply to: [Gravity Forms MIN/MAX Calculation] fields with null valueHi @mencho22,
I don’t think this forum is going to be the best place to help you. It’s a little hard to troubleshoot just based on the formula. it’s also not technically a problem specific to this plugin.
Have you tried searing the WordPress Stack Exchange?
https://wordpress.stackexchange.com/questions/tagged/plugin-gravity-forms
I think it might be more effective to try there.
Sorry and best of luck!
Forum: Plugins
In reply to: [Gravity Forms MIN/MAX Calculation] fields with null valueHappy to help @gingerstu! ??
Going to close this for now.
Forum: Plugins
In reply to: [Gravity Forms MIN/MAX Calculation] fields with null valueHi @gingerstu,
I think this could be a little more manageable if you push all the values into an array (including
null
values) and use thefilter
method to remove all thenull
values before getting the minimum value.I can’t test it because I can’t see the exact code you’re working with, but I think you could reduce your code to something like this:
// if all of the inputs that begins with .input_19_ are ages you can get them // in a single selector like this. Otherwise, probably your approach. Alternately, // you could give them fields a custom, unique class name when building the form. const inputs = Array.from(document.querySelectorAll('input[class^="input_19_"]')); // This will create an array that only contains the input elements values and // filters out any false-y values (including null) const filteredValues = inputs.map((el) => el.value).filter(_=>_); // Now we can safely push all these values to your array knowing nulls // have been stripped. check_age.push(...filteredValues); // The rest of the code should work as before const minca = Math.min(...check_age); document.getElementById('input_19_99').value = minca;
Maybe it can’t be exactly that way, but does this help clean up anything?
Best,
GeorgeForum: Plugins
In reply to: [Gravity Forms MIN/MAX Calculation] fields with null valueHi @gingerstu,
I don’t think there’s anything I can do to fix your issue, unfortunately. The
null
values are already converted to zeroes in the formula by the time my plugin tries to parse the MIN/MAX functions :-/Could you do something in the form itself so that this formula isn’t enabled until valid values have been provided for the children’s ages? Basically assure that something greater than zero has been entered for the ages?
Best,
George MandisThanks @wordna. I was able to recreate this and found the source of the bug.
I just updated the plugin to 0.4.1. When the update is published you should be able to update your plugin and hopefully the bug is not longer present for you as well.
Let me know if you have further difficulties with it.
Thanks,
George