Problem/Motivation

Currently, the code for the data_calc action disables only the * and / operation when provided with a date parameter for input1, but the comments seem to point to the fact that the min and max operations should be disabled as well.

Proposed resolution

Either disable the min and max operations or add logic to the action to correctly handle the min and max operations for dates.

My preference would be to add the logic, as there are valid use cases where one would want to compare two dates. We have resorted to writing our own action for those use cases, but having that functionality in rules_core would be even better.

CommentFileSizeAuthor
#1 2527664-2-data-calc.patch474 bytestr

Comments

tr’s picture

Status: Active » Needs review
StatusFileSize
new474 bytes

Yes, this should have been fixed long ago. Here's a patch to remove the options, consistent with what the code comment says should happen. I agree it would be nice to implement that functionality for dates, but as a feature that is something that needs to be done in Drupal 8 at this point. And obviously there's not a lot of demand for this ...

  • TR committed 44f318c on 7.x-2.x
    Issue #2527664 by TR: Data Calc with dates displays too many operations
    
tr’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.