- Issue created by @Niralk
- 🇮🇳India sidharth_soman Bangalore
The Mtownsend\ReadTime\ReadTime vendor package fixes the read time at 1 min for some reason. I introduced some custom logic to display the minutes correctly. Let me know if it works fine. I'll probably have to make some modifications to it. Here's the patch.
- 🇺🇸United States mtalt Maryland
@sidharth_soman This does appear to be a bug in Mtownsend\ReadTime\ReadTime in the calculateMinutes method. Ideally, the issue would be fixed in that repository.
I do worry about this being an unexpected change for users of this module. There are likely many people that only use minutes in their field formatter and this fix would cause no read time to be displayed for short content. Perhaps the simple fix for this would be to check if the tokenized string only contains @minutes and if the minutes value is 0, then we change it to 1 so that "1 min read" is still shown? Or we could introduce a setting on the field formatter for a minimum read time of 1 minute.
https://www.drupal.org/project/estimated_read_time/issues/3377947 ✨ Introduce switch to manually set read time Needs work could serve as a work-a-round by being able to manually set read times.
- 🇺🇸United States mtalt Maryland
Opened https://github.com/mtownsend5512/read-time/issues/20 to start the conversation of making a change to the package.