Closed Bug 347381 Opened 14 years ago Closed 14 years ago

Print monthly calendar for selected events fails [Error: aStart has no properties]

Categories

(Calendar :: Printing, defect)

x86
Windows 2000
defect
Not set

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: ssitter, Assigned: jminta)

Details

(Whiteboard: [no l10n impact])

Attachments

(2 files)

Print monthly calendar for selected events fails [Error: aStart has no properties]

Steps to Reproduce:
1. Start Sunbird, select normal event in view
2. Select 'File -> Print...' command
3. Set 'Layout' to 'Monthly Grid'
4. Set 'Range to print' to 'Selected events'
5. Press OK button

Actual Results:
Print preview opens but shows no calendar and no events only white space.
Error message shown in console:
    Error: aStart has no properties
    Source File: file:///D:/sunbird/js/calMonthGridPrinter.js Line: 88

Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9a1) Gecko/20060804 Calendar/0.3a2+
Requesting blocking0.3?
If we announce printing as a main feature for 0.3 we should make it work too.
Flags: blocking0.3?
Flags: blocking0.3? → blocking0.3+
I had forgotten that aStart and aEnd were optional params when I wrote the original print-formatter.
Assignee: nobody → jminta
Status: NEW → ASSIGNED
Attachment #234090 - Flags: second-review?(dmose)
Attachment #234090 - Flags: first-review?(mattwillis)
Comment on attachment 234090 [details] [diff] [review]
calculate aStart/aEnd (checked in)

This is a bit hard to test since multiple selection isn't working, but from what I was able to test, and how I read the code, it looks okay.

r1=lilmatt
Attachment #234090 - Flags: first-review?(mattwillis) → first-review+
Comment on attachment 234090 [details] [diff] [review]
calculate aStart/aEnd (checked in)

Do you really want to calculate aStart when aStart was passed in, but just no aEnd?
Also, don't assign to aStart itself.
(In reply to comment #4)
> (From update of attachment 234090 [details] [diff] [review] [edit])
> Do you really want to calculate aStart when aStart was passed in, but just no
> aEnd?
If aStart was passed in, then it should be before any of the events.  (If not, that would be a rather weird call, especially given the IDL comment "* May assume that all the items are inside the given daterange.")

In that case, there's very little extra computation here.  We're already looping through the events to calculate the other param and the aStart.compare calls should all return -1.

> Also, don't assign to aStart itself.
> 
I can fix that, but I'd like to know if you still feel the first comment should be addressed before I do so.
Comment on attachment 234090 [details] [diff] [review]
calculate aStart/aEnd (checked in)

ok, got it.
r=mvl, with the aStart assignment fixed.
Attachment #234090 - Flags: second-review?(dmose) → second-review+
patch checked in.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9a1) Gecko/20060825 Calendar/0.3a2+

Still fails. I repeated STR but had no event selected. That gave me:
Error: start has no properties
Source File: file:///D:/Programme/sunbird/js/calMonthGridPrinter.js
Line: 107

Then I repeated STR with event selected:

Error: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [calIDateTime.compare]"  nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)"  location: "JS frame :: file:///D:/Programme/sunbird/js/calMonthGridPrinter.js :: monthPrint_format :: line 119"  data: no]
Source File: file:///D:/sunbird/js/calMonthGridPrinter.js
Line: 119
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attached patch disable optionSplinter Review
This patch removes a couple of uses of aStart/aEnd where we should be using start/end.  More importantly, it disabled the 'Selected Events' option if there are no selected events.
Attachment #235450 - Flags: second-review?(dmose)
Attachment #235450 - Flags: first-review?(mattwillis)
Comment on attachment 235450 [details] [diff] [review]
disable option

r1=lilmatt
Attachment #235450 - Flags: first-review?(mattwillis) → first-review+
Whiteboard: [patch in hand][waiting on dmose review]
Whiteboard: [patch in hand][waiting on dmose review] → [patch in hand][waiting on dmose review][no l10n impact]
Attachment #234090 - Attachment description: calculate aStart/aEnd → calculate aStart/aEnd (checked in)
Comment on attachment 235450 [details] [diff] [review]
disable option

r=mvl
Attachment #235450 - Flags: second-review?(dmose) → second-review+
Patch checked in on MOZILLA_1_8_BRANCH and trunk

-> FIXED
Status: REOPENED → RESOLVED
Closed: 14 years ago14 years ago
Resolution: --- → FIXED
Whiteboard: [patch in hand][waiting on dmose review][no l10n impact] → [no l10n impact]
Verified with Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9a1) Gecko/20060907 Calendar/0.3a2+
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.