Foren

Flash 10 multi-uploader fix worked but broke Layout Template popup

thumbnail
Michael Bowers, geändert vor 14 Jahren.

Flash 10 multi-uploader fix worked but broke Layout Template popup

New Member Beiträge: 19 Beitrittsdatum: 06.10.08 Neueste Beiträge
We are running Liferay 5.1.2 and the multi-file-uploader for the Image Gallery and Document Library did not work for those users whose browser had the Adobe Flash 10 plugin. (LPS-735)

We used Brian Chan's patches (see here) to fix the issue.

However, now the Layout Template popup functionality is broken. The popup header appears along with the loading indicator. If we revert the patched files back to their originals, the Layout Template popup appears and works fine.
thumbnail
Michael Bowers, geändert vor 14 Jahren.

RE: Flash 10 multi-uploader fix worked but broke Layout Template popup

New Member Beiträge: 19 Beitrittsdatum: 06.10.08 Neueste Beiträge
We fixed the problem...

In the patched everything_unpacked.js file we downloaded, we commented-out the showTemplates function (lines 6516-6535) and replaced it with the showTemplates function that was in our original 5.1.2 everything_unpacked.js file (we also made the same corresponding change to the everything_packed.js file).

//	showTemplates: function() {
//		var instance = this;
//
//		var url = themeDisplay.getPathMain() + '/layout_configuration/templates';
//
//		Liferay.Popup(
//			{
//				modal: true,
//				position: ['center', 100],
//				title: Liferay.Language.get('layout'),
//				url: url,
//				urlData: {
//					p_l_id: themeDisplay.getPlid(),
//					doAsUserId: themeDisplay.getDoAsUserIdEncoded(),
//					redirect: Liferay.currentURL
//				},
//				width: 700
//			}
//		);
//	},

    showTemplates: function() {
        var instance = this;

        var url = themeDisplay.getPathMain() + '/layout_configuration/templates';

        jQuery.ajax(
            {
                url: url,
                data: {
                    p_l_id: themeDisplay.getPlid(),
                    doAsUserId: themeDisplay.getDoAsUserIdEncoded(),
                    redirect: Liferay.currentURL
                },
                success: function(response) {
                    Liferay.Popup(
                        {
                            width: 700,
                            modal: true,
                            message: response,
                            position: ['center', 100],
                            title: Liferay.Language.get('layout')
                        }
                    );
                }
            }
        );
    },
thumbnail
Michael Bowers, geändert vor 14 Jahren.

RE: Flash 10 multi-uploader fix worked but broke Layout Template popup

New Member Beiträge: 19 Beitrittsdatum: 06.10.08 Neueste Beiträge
Our concern now: What other changes made to the everything_[un]packed.js files, unrelated to the multi-file-uploader fixes, were made that might break other functionality that we have yet to discover?
thumbnail
Michael Bowers, geändert vor 14 Jahren.

RE: Flash 10 multi-uploader fix worked but broke Layout Template popup

New Member Beiträge: 19 Beitrittsdatum: 06.10.08 Neueste Beiträge
We did in fact discover other functionality that was now broken due to the other changes, unrelated to the multi-file-uploader fixes, that Liferay made to the everything_[un]packed.js files. So we decided to take a different approach instead of using the five patch files as-is.

The instructions below detail how to fix, without breaking other functionality, the Flash 10 multi-file-uploader issue that affects Liferay 5.1.x.

(1) Download this new file:
http://svn.liferay.com/browse/portal/branches/5.1.x/portal-web/docroot/html/js/misc/swfupload/swfupload_f10.swf
and put it in this directory:
webapps\ROOT\html\js\misc\swfupload

(2) Download this modified file:
http://svn.liferay.com/browse/portal/branches/5.1.x/portal-web/docroot/html/js/misc/swfupload/swfupload.js
and put it in this directory:
webapps\ROOT\html\js\misc\swfupload

(3) Download this modified file:
http://svn.liferay.com/browse/portal/branches/5.1.x/portal-web/docroot/html/js/liferay/upload.js
and put it in this directory:
webapps\ROOT\html\js\liferay

(4) Do NOT download the two modified everything_[un]packed.js files.
Instead, use your 5.1.x installation's original everything_[un]packed.js
files (located in this directory: webapps\ROOT\html\js ) and modify them as follows:
(a) Copy the entire contents of the modified file downloaded in (3) into your
everything_unpacked.js file starting at line 9636 (or search for "Liferay.Upload")
and continuing to the EOF.
(b) For the everything_packed.js file do the same search and replace or run your modified
unpacked file through a compressor program.