Closed Bug 265971 Opened 20 years ago Closed 14 years ago

\n in SUMMARY of VEVENT not interpreted

Categories

(Calendar :: Internal Components, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: hadmut, Assigned: shv-box)

References

Details

(Whiteboard: [needed beta][no l10n impact])

Attachments

(6 files, 2 obsolete files)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041007 Debian/1.7.3-5
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041007 Debian/1.7.3-5

When displaying an internet ics calender file, newlines are not displayed 
correctly. If a text line (e.g. DESCRIPTION or SUMMARY) contains a 
\n Mozilla displays a box with "00 0A" instead of starting a new line.

regards
Hadmut


Reproducible: Always
Steps to Reproduce:
1. Use the given URL as a calender
2. Watch Nov 8 2004
3.

Actual Results:  
a box with "00 0a"

Expected Results:  
A new line
In whic field are you teying to place the \n?  Subject or the description...  I
have it working fine in the description and other text fields, but within the
subject it gives me this results.  The question is:  A subject allowed to have
multiple lines?

If you import this ics into Outlook or other program does it put multiplt lines?

PHPiCalendar work fine with a \n in the subject, but it doe snot let you see the
data after the \n.

Outlook gives you multiple lines, but you can not add additional lines within
outlook.
Sorry, I use the work subject vs. summary.  I ment summary.

Within the RFC 2048 spec, it only inticates the field as TEXT.  I did not find
any adidional text limiting the summary field to one line.
Hi,

sorry for the delay, I was out of home.

Just see the example given at the  URL. Both the 
summaries and descriptions contain \n. 

Other Calendar tools (e.g. evolution) display it correctly. 

See also bug 251771 for screenshots.

regards
Hadmut
QA Contact: gurganbl → sunbird
Current situation in Sunbird nightly builds:
In the event dialog we only show one line and see the text before the first '\n'. In the unifinder the complete SUMMARY string is showed, but with black squares instead of the '\n' (under WinXP). The views and the tooltips show the complete SUMMARY string but ignore and omit the '\n'.
Assignee: mostafah → base
Status: UNCONFIRMED → NEW
Component: Sunbird and Calendar-Extension Front End → Base
Ever confirmed: true
OS: Linux → All
QA Contact: sunbird → base
Hardware: PC → All
Summary: \n misinterpreted → \n in SUMMARY of VEVENT not interpreted
Version: unspecified → Trunk
Presumably, this causes dataloss when editing a bug.
Keywords: dataloss
The bugspam monkeys have struck again. They are currently chewing on default assignees for Calendar. Be afraid for your sanity!
Assignee: base → nobody
Target Milestone: --- → Sunbird 0.3
Marked as blocking0.3 in part because the fix seems like it should be easy.  If that turns out to not be true, we may need to reconsider.
Flags: blocking0.3+
After more discussion, we've realized that is arguably not even dataloss, since \n
is actually interpreted in the event dialog these days, so it will be round-tripped, so we're not going to let this block 0.3.

One could imagine a scenario where someone selects stuff with the mouse and thinks that everything is selected, when in fact, everything is not visible, but this seems a total edge case.

We've come up with UI for the event dialog part of this bug, which is to make it the text box be one line tall, but allow a scrollbar to created on overflow.  We'd want to make it hard or impossible for the user to manually add lines to the summary, the overflow would be just to deal with existing data that had this.  Probably a keypress handler would do the trick.

We would be inclined to accept a patch of this nature for 0.3.
Flags: blocking0.3+ → blocking0.3-
Whiteboard: [cal-ui-review+][needs patch]
Target Milestone: Sunbird 0.3 → Sunbird 0.5
Not going to make the 0.5 train. Moving forward.
Target Milestone: Sunbird 0.5 → Sunbird 0.7
Flags: wanted-calendar0.8?
Target Milestone: 0.7 → ---
Version: Trunk → unspecified
Keywords: dataloss
The proposed solution of making it impossible to add more than one line seems more of a workaround to me, and besides, other tools (i.e. GCalendar) we already have a provider for don't set this restriction, so we could easily end up with events with newlines in them.

As stated in bug 401872, I'd be happy to tackle the issue.
Anyone available to assign me this bug?
Assignee: nobody → mcicogni
Status: NEW → ASSIGNED
Setting wanted0.8- as the main Calendar developers will not devote any time to
this in the 0.8 timeframe. Patches are, of course, always welcome.
Flags: wanted-calendar0.8? → wanted-calendar0.8-
With this patch newlines are preserved when viewing an iMIP invitation.
Attachment #303139 - Flags: review?(ctalbert)
Comment on attachment 303139 [details] [diff] [review]
[checked in] Preserve newlines in iMIP display

Tested it, looks good. r=ctalbert  

Thanks for the patch!!!
Attachment #303139 - Flags: review?(ctalbert) → review+
Fix checked in on trunk and MOZILLA_1_8_BRANCH --> FIXED
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Whiteboard: [cal-ui-review+][needs patch] → [cal-ui-review+]
I'm not convinced the bug is fixed. The issues from comment#4 were not connected to iTIP/iMIP.
Target Milestone: --- → 0.8
Flags: wanted-calendar0.8-
Whiteboard: [cal-ui-review+]
(In reply to comment #16)
> I'm not convinced the bug is fixed. The issues from comment#4 were not
> connected to iTIP/iMIP.

-> Re-opening
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attachment #303139 - Attachment description: Preserve newlines in iMIP display → [checked in] Preserve newlines in iMIP display
Assignee: mcicogni → nobody
Status: REOPENED → NEW
Flags: wanted-calendar0.9?
Keywords: qawanted
Target Milestone: 0.8 → ---
Flags: wanted-calendar0.9? → wanted-calendar0.9+
This WFM on Mac using the new/prototype event dialog, thus I think the iTIP fix was the only missing piece. Martin, could you please verify on Windows?
Martin, any update?
In the event dialog '\n' is substituted with ',', the unifinder shows some box char, and the calendar views do different things: Day/Week view shows a space, Multiweek/Month shows the same box char as the unifinder.
Attached file ics file —
Seems I am missing the point, but subscribing to an ics file containing \n, those are correctly broken into different lines. Could somebody explain what's still missing?
> Seems I am missing the point, but subscribing to an ics file containing \n,
> those are correctly broken into different lines. Could somebody explain what's
> still missing?

Daniel, I think you mixed up SUMMARY and DESCRIPTION of an event. This bug report concerns the SUMMARY of an iCalendar VEVENT, not the DESCRIPTION, i.e. what contains '\n' in your attached ics file.
Ah! Yes, of course. Thanks, Martin.
Even though this is rather exotic (since you cannot edit multi-line titles), what about only showing the first line? Christian, what do you think?
Would be ok for me. Maybe we can show ellipses at the end and on mouse over a tooltip which contains the whole summary.
Flags: wanted-calendar0.9+ → wanted-calendar1.0+
Solution may be divided in 2 steps:
1. Ensure consitent viewing.
\n converts to ' ' in Day and Month views. And it simply eliminates in all other places (see previous attachment).

2. Ensure consitsent editing.
Lightning replaces \n to ',' on Windows and Linux/
Sunbird on Windows allows multiline editing. But on Windows retain only first line (see attachment)
Attached patch Fix SUMMARY with '\n' viewing — — Splinter Review
Simply replace \n with ' '

The only XUL element used to display SUMMARY that honor '\n' is <description>. All others just cut it regardless of css.

IMHO it would be better to replace \n with ' ' than all other ways. 
Comma will be unappropriate if line ends with dot. 
Preserve only first line can be misleading.
Attachment #407742 - Flags: review?(mschroeder)
Attachment #407740 - Attachment is obsolete: true
Assignee: nobody → shv-box
Status: NEW → ASSIGNED
Comment on attachment 407742 [details] [diff] [review]
Fix SUMMARY with '\n' viewing

Shifting review to Philipp ;-)
Attachment #407742 - Flags: review?(mschroeder) → review?(philipp)
Comment on attachment 407742 [details] [diff] [review]
Fix SUMMARY with '\n' viewing

The patch looks fine, but what about other whitespaces? i.e if it contains \r\n ? I'll r+ with this question answered
(In reply to comment #31)
> (From update of attachment 407742 [details] [diff] [review])
> The patch looks fine, but what about other whitespaces? i.e if it contains \r\n
> ? I'll r+ with this question answered

Everything that visually produces a line break should be substituted with a single space imo.
Comment on attachment 407742 [details] [diff] [review]
Fix SUMMARY with '\n' viewing

I've tested all unicode characters noted as whitespace on http://en.wikipedia.org/wiki/Whitespace_character

Only the newline character produces a visual newline. Therefore I think we can take this patch.

Even if \r\n is shortened to \r, the \r is just shown as an empty character.

r=philipp
Attachment #407742 - Flags: review?(philipp) → review+
Pushed to comm-central <http://hg.mozilla.org/comm-central/rev/0a7b207c9030>
-> FIXED
Status: ASSIGNED → RESOLVED
Closed: 16 years ago14 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.0b2
I am reopening this bug because it causes a regression, when the title is not present this is logged in the error console:
Error: calendarEvent.title is null
Source File: chrome://calendar/content/calendar-unifinder.js
Line: 786
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Interesting, I always thought an empty title would cause an empty string, not null. Alexander, could you prepare a patch to fix this issue?
Flags: wanted-calendar1.0+ → blocking-calendar1.0+
Attached patch Regression Fix - v1 (obsolete) — — Splinter Review
This fixes the regression. Simon, could you do a quick review on this one?
Attachment #444693 - Flags: review?(simon.at.orcl)
Whiteboard: [needed beta][no l10n impact]
Attached patch Regression Fix - v2 — — Splinter Review
Forgot to qref, sorry
Attachment #444851 - Flags: review?(simon.at.orcl)
Comment on attachment 444851 [details] [diff] [review]
Regression Fix - v2

Works fine for me
Attachment #444851 - Flags: review?(simon.at.orcl) → review+
Attachment #444693 - Attachment is obsolete: true
Attachment #444693 - Flags: review?(simon.at.orcl)
Pushed to comm-central <http://hg.mozilla.org/comm-central/rev/987baad2b6cd>
-> FIXED
Status: REOPENED → RESOLVED
Closed: 14 years ago14 years ago
Resolution: --- → FIXED
verified with
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.11pre) Gecko/20100514 Calendar/1.0b2pre
Status: RESOLVED → VERIFIED
(In reply to comment #42)

Damian, please remember that the Sunbird builds are still based on the 1.9.1 branch. None of the patches that were checked in after the 1.0 Beta 1 release are contained in this builds.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: