Calendars - linking other events under Multi-date events

Hi folks,


In our calendar area, we have a system set up so that our staff can log in and use an Asset Builder form to create new Single and Recurring Calendar Events as child assets under various parent Multi-date Calendar Events.



Sometimes we find out later that they really meant for the same child event to be linked under more than one Multi-date event. However, when we try to do this via the Administration Interface, the system refuses to do it, claiming that it "Cannot create link, Assets of Type 'calendar_event_single' cannot be 'TYPE_1' linked to a 'calendar_event_multi_date'".



Unfortunately, if we then change the child asset's Linking type to something other than Type 1, it still doesn't let us link it under the other Multi-date event. It still gives the same error message too, oddly. This could be a bit of a bug, something to do with the Asset Builder form perhaps; or it could be a lack of understanding on our part.



This is making life very difficult for us, as often it's impossible to be able to identify all the Multi-date events a particular Single or Recurring event should be linked under up front. Our only solution at present is to trash the original child event and re-create it via the Admin Interface.



Does anybody have any ideas about why this should be so? And how to circumvent it? Many thanks for any help.



(We're using Matrix 3.22.)

Hi Scampus,


Single / Recurring events that are created under the Multi-Date Calendar Event asset are TYPE_3 links, which cannot be created via the "linking" screen.



To get around this issue, I suggest you use the JS API. Here'a a simple code snippet to get you started:


    
    createLink(,<id of single calendar event asset),4,"",-1,0,0,function(data){ console.log(data) });


I used the number 4 rather than 3 since Matrix interprets 3 as a NOTICE link.

[quote]
I used the number 4 rather than 3 since Matrix interprets 3 as a NOTICE link.

[/quote]



Actually, the link types are bitwise, like statuses. 3, therefore, means TYPE 1 and TYPE 2. But that doesn't make sense to the linking system. 4 is TYPE 3 and 8 is NOTICE.



All these numbers are defined in core/include/init.inc if anyone is interested to take a look.

[quote]
Actually, the link types are bitwise, like statuses. 3, therefore, means TYPE 1 and TYPE 2. But that doesn't make sense to the linking system. 4 is TYPE 3 and 8 is NOTICE.



All these numbers are defined in core/include/init.inc if anyone is interested to take a look.

[/quote]



Thanks for the pointer Greg :slight_smile:

[quote]
Hi Scampus,



Single / Recurring events that are created under the Multi-Date Calendar Event asset are TYPE_3 links, which cannot be created via the "linking" screen.



To get around this issue, I suggest you use the JS API. Here'a a simple code snippet to get you started:


    
    createLink(,<id of single calendar event asset),4,"",-1,0,0,function(data){ console.log(data) });


I used the number 4 rather than 3 since Matrix interprets 3 as a NOTICE link.
[/quote]

Thanks for the response, Anton.

At this stage using the JS API is a bit beyond my capabilities (I'd have no idea where to start, basically). Sounds interesting but, alas, for another day.

In the meaneimte I've been thinking a bit more about our problem, and I've realised that in many cases we really don't need to be Linking events under more than one Multi-date event anyway. They need to go under the one Multi-date event in one place, but not in other locations. So a business process change is probably what's needed here, and that's what I've started pursuing with the staff who create our calendar events.

Again, many thanks to you and Greg (and I'm making a point of heading off after this to bone up on my JS API), but for now I'll adopt a different approach.

Cheers,
Steve

Not a problem. Be sure to check out: http://www.zedsaid.com/blog/using-the-js-api-enhanced-mode-in-squiz-matrix