From 5cb12bc9de9388a83b9b262e9515526712179ce2 Mon Sep 17 00:00:00 2001 From: Damien Pobel Date: Tue, 5 Jul 2016 17:10:07 +0200 Subject: [PATCH] EZP-26011: Fixed the issue where the UDW `loadContent` flag is not taken into account --- ...content-universaldiscoveryserviceplugin.js | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/bundle/Resources/public/js/views/plugins/cof-createcontent-universaldiscoveryserviceplugin.js b/bundle/Resources/public/js/views/plugins/cof-createcontent-universaldiscoveryserviceplugin.js index 56d8cbf..11db5d8 100644 --- a/bundle/Resources/public/js/views/plugins/cof-createcontent-universaldiscoveryserviceplugin.js +++ b/bundle/Resources/public/js/views/plugins/cof-createcontent-universaldiscoveryserviceplugin.js @@ -224,21 +224,27 @@ YUI.add('cof-createcontent-universaldiscoveryserviceplugin', function (Y) { /** * Loads the content location of the published content * - * @method _setSelectedLocation + * @method _loadContentLocation * @protected * @param event {Object} event facade */ _loadContentLocation: function (event) { - var host = this.get('host'); + var udwService = this.get('host'), + selection = { + contentType: udwService.get('contentType'), + }; - event.content.loadLocations({api: host.get('capi')}, function (error, response) { - host.get('app').set('loading', false); + if ( udwService.get('parameters').loadContent ) { + selection.content = event.content; + } - host.get('eventTarget').fire('contentLoaded', { - contentInfo: event.content, - location: response[0], - contentType: host.get('contentType') - }); + event.content.loadLocations({api: udwService.get('capi')}, function (error, locations) { + selection.location = locations[0]; + selection.contentInfo = locations[0].get('contentInfo'); + + udwService.get('app').set('loading', false); + + udwService.get('eventTarget').fire('contentLoaded', selection); }); },