Closed Bug 1187741 Opened 9 years ago Closed 9 years ago

VTODO only calendar disables "add as task" button

Categories

(Calendar :: Tasks, defect)

Lightning 4.0.1.2
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
4.0.2.1

People

(Reporter: knut.grahlmann, Assigned: merike)

References

Details

Attachments

(1 file, 1 obsolete file)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0
Build ID: 20150630154324

Steps to reproduce:

- Only have the Tasks view on a Zarafa Calendar integrated (https://<server>:8443/caldav/<username>/Tasks
- type: caldav
- Don't have any other calender integrated


Actual results:

- Button "Add as task" grayed out
- However, manually adding a task works fine (task synchronized with server)


Expected results:

Only the "add as event" button should be grayed out.

Errors seems to be in calendar-extract.js:
        if (newEvent.getAttribute("disabled") == "true") {
//            buttonsDisabled = true;
//            contextDisabled = true;
        }

Not fully understanding the details, this seems as if the possibility that (only a new task can be created but no new event) has not been foreseen. Commenting out these two lines enables both buttons (NB: workaround, as "add as event" button should still be grayed out) again and results in a working "add as task" dialog.
Are both, add new event and add new task buttons disabled or just the task button? What do you mean by adding manually?

Can you please enable calendar.debug.log and calendar.debug.log.verbose in the config editor and check the error console (ctrl+shift+j) after a restart of TB? The server should advertise its capabilities. Can you post the respective messages here? Also, please check for other suspicious messages.
Thanks for looking into this!

Yes, both buttons are disabled. To prevent a potential misunderstanding: I do not refer to "new event" or "new task", but "add as event" and "add as task"

Sorry, what I mean is: when I go to "Events and Tasks" in the menu bar, "new event" is (rightly) grayed out, but "new task" is not and works perfectly.
==> That's why I came to the conclusion that the server rightly advertises its capabilities but the mentioned code in the first post causes the 'trouble'.

Debug messages below. Nothing suspicious to be found...

CalDAV: Calendar <name> generally supports calendar-schedule
CalDAV: DAV header: 1, access-control, calendar-access, calendar-schedule, calendarserver-principal-property-search
CalDAV: send: OPTIONS https://<URL>
CalDAV: Authentication scheme for fook is Basic
CalDAV: Found principal url from DAV:current-user-principal /caldav/<user>/
Adding supported items: VTODO for calendar: <name>
Merike, this is also releated to the extractor - can you talke a look at it?
Flags: needinfo?(merikes.lists)
I think the first comment is correct here, tasks only calendars are not considered in code when disabling extraction and therefore both options get disabled even if one should remain available. I'll take a look at it later today or tomorrow.

Meanwhile it would be helpful to know what is the easiest way to set up a tasks only or events only calendar? This way I can test both scenarios properly later on.
Assignee: nobody → merikes.lists
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Flags: needinfo?(merikes.lists)
> Meanwhile it would be helpful to know what is the easiest way to set up a
> tasks only or events only calendar? This way I can test both scenarios
> properly later on.

You will probably need a caldav calender serverside configured for task only. Eventually Google also supports this, but I'm not sure.
Maybe not the nicest way, but tweaking calDavCalendar.js might be an option (if no serverside solution is available). Also happy to test code for VTODO-only situation.

calDavCalendar.js, removing the VEVENT capability from mSupportedItemTypes:

            let supportedComponents = caldavXPath(multistatus,
                "/D:multistatus/D:response/D:propstat/D:prop/C:supported-calendar-component-set/C:comp/@*[local-name()='name']");
            if (supportedComponents && supportedComponents.length) {
                thisCalendar.mSupportedItemTypes = [ compName
                    for each (compName in supportedComponents)
                    if (thisCalendar.mGenerallySupportedItemTypes.indexOf(compName) >= 0)
                ];
                cal.LOG("Adding supported items: " + thisCalendar.mSupportedItemTypes.join(",") + " for calendar: " + thisCalendar.name);
            }
Attached patch bug1187741 (obsolete) β€” β€” Splinter Review
Not fully tested yet, but this should work better for tasks only calendars.
Attachment #8642061 - Flags: review?(philipp)
(In reply to tk1 from comment #6)
> Maybe not the nicest way, but tweaking calDavCalendar.js might be an option
> (if no serverside solution is available). Also happy to test code for
> VTODO-only situation.
> 
> calDavCalendar.js, removing the VEVENT capability from mSupportedItemTypes:

That's an useful trick! I tried out with Google calendar and with the patch applied it properly enables only events now. Previously task buttons and context menu entry were enabled for conversion too although it didn't work if this was the only calendar available. After changing the calendar to support only tasks the opposite case seemed to work well too.

So hopefully it will work for you too.
Comment on attachment 8642061 [details] [diff] [review]
bug1187741

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

Looks good, r=philipp.
Attachment #8642061 - Flags: review?(philipp) → review+
Merike, is this fully tested so we can consider this for 4.0.2, too (eventually without having this on cc first)?
Flags: needinfo?(merikes.lists)
Attached patch bug1187741 v2 β€” β€” Splinter Review
This fixes missing semicolons and an issue with re-enabling context menu after both options have been disabled.

It could be considered for next release but can also wait for next one if this seems too risky without wider testing.
Attachment #8642061 - Attachment is obsolete: true
Flags: needinfo?(merikes.lists)
Attachment #8644556 - Flags: review+
Happy to confirm that the patch works for me (calendar in task only setup):
- "add as event" button is disabled
- "add as task" button is enabled, starts the dialogue and task is added

Thanks a lot Merike!
In any case let's start with comm-central :)
Keywords: checkin-needed
url:        https://hg.mozilla.org/comm-central/rev/fbc2a9c68d93a89fb49f9611cb9db4f328853f27
changeset:  fbc2a9c68d93a89fb49f9611cb9db4f328853f27
user:       Merike Sell <merike.sell@eesti.ee>
date:       Thu Aug 06 13:27:00 2015 +0200
description:
Bug 1187741 - VTODO only calendar disables "add as task" button. r=philipp
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → 4.4
Comment on attachment 8644556 [details] [diff] [review]
bug1187741 v2

This moved to aurora meanwhile and I haven't heard of any issues. Although according to AMO almost nobody uses nightlies and aurora builds?

Could this be considered for 4.0.3 as well? If not for release then when is next beta release planned?
Attachment #8644556 - Flags: approval-calendar-release?(philipp)
Attachment #8644556 - Flags: approval-calendar-beta?(philipp)
The statics on AMO only tell what system have checked for Lightning updates at AMO. Lightning comm-central and comm-aurora builds don't use AMO for updates therefore you don't see them in the AMO statistics. Same is true for many Linux distributions that install Lightning from its own repositories instead of AMO.
Comment on attachment 8644556 [details] [diff] [review]
bug1187741 v2

4.0.3 is fine for me. Beta is coming up this or next week.
Attachment #8644556 - Flags: approval-calendar-release?(philipp)
Attachment #8644556 - Flags: approval-calendar-release+
Attachment #8644556 - Flags: approval-calendar-beta?(philipp)
Attachment #8644556 - Flags: approval-calendar-beta+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: