- Issue created by @mikeybeck
- 🇨🇦Canada Liam Morland Ontario, CA 🇨🇦
This sounds like it would be easier to understand if it was reversed. Can you prepare a patch to do this?
- Status changed to Needs review
over 1 year ago 1:31pm 3 August 2023 - last update
over 1 year ago 1 pass - 🇨🇦Canada Liam Morland Ontario, CA 🇨🇦
It would be best if there was an update hook so that the behaviour of people's sites doesn't change. This could be done by changing the operator instead of moving the validator to the opposite element.
Oh of course, sorry.
Have you added any update hooks to this module previously, that I could take a look at? I've read through the hook_update_N docs but am still not sure how to go about this.
- 🇨🇦Canada Liam Morland Ontario, CA 🇨🇦
There are no update hooks yet in 2.0.x. The documentation is here:
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Extension!module....
- Status changed to Needs work
over 1 year ago 1:36pm 16 August 2023 - 🇨🇦Canada Liam Morland Ontario, CA 🇨🇦
That is the right idea. Be careful with the operators. For example,
>
needs to be replaced with<=
. - last update
over 1 year ago 1 pass Sorry, I'm not quite following why that is.
If>
is changed to<=
, it will returntrue
if the values are the same, when it would have beenfalse
before. I'm having difficulty understanding why that would be required.- 🇨🇦Canada Liam Morland Ontario, CA 🇨🇦
Sorry, I was thinking of something else. This is just reversing everything, which is correct.
- last update
about 1 year ago 1 pass - last update
about 1 year ago 1 pass - last update
about 1 year ago 1 pass - last update
about 1 year ago 1 pass - last update
about 1 year ago 1 pass - last update
about 1 year ago 1 pass - last update
about 1 year ago 1 pass - last update
about 1 year ago 1 pass - Status changed to Needs review
about 1 year ago 1:24pm 29 September 2023 - 🇮🇳India kasli_harshit
Hi @mikeybeck , i have applied the patch(#9) , applied successfully now the the comparison operators are working as they should ( field 1 operator field) we can move this to RTBC+1. Adding the screenshot for the same .
- last update
12 months ago 1 pass - 🇸🇰Slovakia gresko8
I tested the patch on my site, but the operator was not updated. This was caused by my webform having nested elements and those were skipped by the update in the provided patch.
I'm attaching a patch which uses getElementsDecodedAndFlattened() method instead of getElementsDecoded() to fix this issue.After this change I can confirm that it works as expected for me.