Closed
Bug 418995
Opened 16 years ago
Closed 16 years ago
CSV import creates empty fields datastores
Categories
(Calendar :: Import and Export, defect)
Calendar
Import and Export
Tracking
(Not tracked)
VERIFIED
FIXED
0.8
People
(Reporter: Hb, Assigned: Hb)
Details
Attachments
(1 file)
2.59 KB,
patch
|
mvl
:
review+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6 Mnenhy/0.7.5.0 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13pre) Gecko/20080220 Calendar/0.8pre Importing events from a CSV file sets always the properties description, category or location even if they will contain no data. Opening one of these events with the "Edit Event" dialog box shortly afterwards will internally delete these empty properties. Now the problem arises: On closing the dialog the user will be asked if he wants to "Save the changed data" even if he did change nothing. Reproducible: Always Steps to Reproduce: 1. Import a CSV file with emtpy fields for the description. Choose a lokal ICS file as data storage. 2. Copy that ICS file. 3. Open one of the events with the "Edit Events" dialog and try to close the dialog. Actual Results: A message box appears. Expected Results: No message box because I changed no data. This behaviour is gone after some time. Probably the fields are corrected in the next refresh cycle.
Resolution: > - if ("descriptionIndex" in args) > - event.setProperty("DESCRIPTION", parseTextField(eventFields[args.descriptionIndex])); > - ... > > + // Avoid setting empty properties > + var txt = ""; > + if ("descriptionIndex" in args) { > + txt = parseTextField(eventFields[args.descriptionIndex]) > + if (txt) { > + event.setProperty("DESCRIPTION", txt); > + } > + } ... Use the variable txt and check if it is not emtpy. Enhancement: > + // Using the "Private" field only for getting privacy status. > + // "Sensitivity" is neglected for now. > + if ("privateIndex" in args) { > + if (locale.valueTrue == eventFields[args.privateIndex]) { > + event.privacy = "PRIVATE"; > + } > + }
Comment 2•16 years ago
|
||
Comment on attachment 304940 [details] [diff] [review] Patch_v1 Setting properties only if valid data was read r=mvl
Attachment #304940 -
Flags: review?(mvl) → review+
Keywords: checkin-needed
Comment 3•16 years ago
|
||
Patch checked in on HEAD and MOZILLA_1_8_BRANCH. --> FIXED
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → 0.8
Updated•16 years ago
|
OS: Windows XP → All
Hardware: PC → All
You need to log in
before you can comment on or make changes to this bug.
Description
•