Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello,
I'm using time period to save preparation and resting times for a recipes website.
The problem is that when the recipe have no resting times, the field register 0 seconds. I don't find a way to not display the field if it's empty.
Can you point me the solution ?
Thank you
Alex
Comment | File | Size | Author |
---|---|---|---|
#3 | timeperiod-2092835-3.patch | 2.08 KB | David Lesieur |
Comments
Comment #1
riccardino CreditAttribution: riccardino commentedI had the same problem. My solution was to modify the timeperiod_field_formatter_view function in the timeperiod.module file like this:
Comment #2
zmove CreditAttribution: zmove commentedThank you for the answer, I would prefer to not modify the core of a module to make it works as I want.
If I make a patch, does the maintainer will implement it, it is a correct default behavior the module want to support ?
Comment #3
David Lesieur CreditAttribution: David Lesieur commentedHere's a patch to hide the field when the time period is empty.
Comment #4
fakir22 CreditAttribution: fakir22 commentedPatch works like a charm, thanks !