error in "every weekday" recurrence in lightning-item-iframe.js (onDays is not defined)

RESOLVED FIXED in 5.3

Status

defect
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: Taraman, Assigned: Taraman)

Tracking

({regression})

Dependency tree / graph

Details

Attachments

(1 attachment, 1 obsolete attachment)

When setting a daily recurrence to "every weekday", they get shown on weekends as well.

Error Message:
JavaScript error: chrome://lightning/content/lightning-item-iframe.js, line 2709: ReferenceError: onDays is not defined
[1]

When editing the item afterwards, Recurrence Rule shows "daily" again in accordance with the display in the view.

[1]:
https://dxr.mozilla.org/comm-central/rev/593964199b659fdb8b5b7d8ce765c1976a783c99/calendar/lightning/content/lightning-item-iframe.js#2709
Posted patch Fix V1 (obsolete) — Splinter Review
This should fix the problem.
Attachment #8800657 - Flags: review?(philipp)
Looks like a regression from https://hg.mozilla.org/comm-central/rev/880d5e4d567c
Blocks: 1280898
Keywords: regression
OS: Unspecified → All
Hardware: Unspecified → All
Version: unspecified → Lightning 5.3
Comment on attachment 8800657 [details] [diff] [review]
Fix V1

Review of attachment 8800657 [details] [diff] [review]:
-----------------------------------------------------------------

::: calendar/lightning/content/lightning-item-iframe.js
@@ +2705,4 @@
>                  recRule.type = "WEEKLY";
>                  break;
>              case "every.weekday":
> +                let onDays = [2, 3, 4, 5, 6];

I don't think this will pass eslint, because the let variable is in a switch case. I'd suggest to just pass 5 instead of onDays.length, or use {} for the case.
Attachment #8800657 - Flags: review?(philipp) → review-
Assignee: nobody → Mozilla
Status: NEW → ASSIGNED
Posted patch Fix V2Splinter Review
passing in 5 sounds reasonable and since no variable is declared, it is clear in reading as well.

Patch updated
Attachment #8800657 - Attachment is obsolete: true
Attachment #8803607 - Flags: review?(philipp)
Comment on attachment 8803607 [details] [diff] [review]
Fix V2

Review of attachment 8803607 [details] [diff] [review]:
-----------------------------------------------------------------

lgtm, thanks for the patch! r=philipp
Attachment #8803607 - Flags: review?(philipp)
Attachment #8803607 - Flags: review+
Attachment #8803607 - Flags: approval-calendar-aurora+
pushed to

comm-central -> https://hg.mozilla.org/comm-central/rev/279d84a45b1db499195f2c6cc72407693bf8d07c
comm-aurora-> https://hg.mozilla.org/releases/comm-aurora/rev/2817bc16dce87746c98c552142c5c92304e398da
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 5.3
Blocks: 980515
You need to log in before you can comment on or make changes to this bug.