Skip to content

Commit

Permalink
fix: Remove fallback empty string for value
Browse files Browse the repository at this point in the history
- Might cause issue if the value is 0 (a number)

(cherry picked from commit 305628b)
  • Loading branch information
surajshetty3416 authored and mergify[bot] committed Feb 24, 2023
1 parent 95d85d9 commit 6713745
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frappe/public/js/frappe/views/reports/print_grid.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ <h2>{{ __(title) }}</h2>
</td>
{% for col in columns %}
{% if col.name && col._id !== "_check" %}
{% var value = col.fieldname ? row[col.fieldname] : row[col.id] || "" %}
{% var longest_word = value.split(' ').reduce((longest, word) => word.length > longest.length ? word : longest, ''); %}
{% var value = col.fieldname ? row[col.fieldname] : row[col.id] %}
{% var longest_word = cstr(value).split(' ').reduce((longest, word) => word.length > longest.length ? word : longest, ''); %}
<td {% if row.bold == 1 %} style="font-weight: bold" {% endif %} {% if longest_word.length > 45 %} class="overflow-wrap-anywhere" {% endif %}>
<span {% if col._index == 0 %} style="padding-left: {%= cint(row.indent) * 2 %}em" {% endif %}>
{% format_data = row.is_total_row && ["Currency", "Float"].includes(col.fieldtype) ? data[0] : row %}
Expand Down

0 comments on commit 6713745

Please sign in to comment.