Matrix Version: 5.3.3.0
A colleague developed some JS-API code to link a newly created image as the thumbnail of another asset (the targetted parent asset id is passed in via the URL).
The code - which was developed while we had v.4.?.? of Matrix installed - looks like this:
js_api.createLink({
“parent_id”: getURLParameter(“userid”),
“child_id”: %created_assetid%,
“link_type”: 8,
“link_value”: “thumbnail”,
“sort_order”: -1,
“is_dependant”: 0,
“is_exclusive”: 0
});
The parent_id bit is worked out in a seperate function:
function getURLParameter(name) {
return decodeURIComponent((new RegExp(’[?|&]’ + name + ‘=’ + ‘([^&;]+?)(&|#|;|$)’).exec(location.search)||[,""])[1].replace(/+/g, ‘%20’))||null;
}
This used to work, but the ‘created asset’ is now NOT linked to the appropriate asset (whose id is passed in via the URL).
Can anyone see anything in the code that won’t work due to a change in version, perhaps?
Many thanks
mark