"Failed to set content property on stream closure"' error

cancel
Showing results for 
Search instead for 
Did you mean: 
upforsin
Senior Member

"Failed to set content property on stream closure"' error

Jump to solution

Hello,

I have installed Alfresco Community - 6.1.2 (r4fe1d0d0-b205).

When I go to Document library, change view to gallery and start quickly moving the slider, i'm getting the following error:

errorSilderQuicklyAlfresco.png

I tried to Google it and i found some results on Alfreco JIRA but they are quite old and seem to be resolved.

Do you have any idea how can i fix it?

 

1 Solution

Accepted Solutions
upforsin
Senior Member

Re: "Failed to set content property on stream closure"' error

Jump to solution

The Solution for any interested parties:

1. Copy and create own documentlist-view-gallery.js and replace the `scope.widgets.galleryColumnsSlider.setColumnsPreference` with the following

         scope.widgets.galleryColumnsSlider.setColumnsPreference = function _setColumnsPreference(numColumns)
         {
            if (numColumns == null) {
               numColumns = scope.widgets.galleryColumnsSlider.getColumnValue();
            }
            galleryViewRenderer.galleryColumns = numColumns;
            var currTime = new Date();
            if (currTime - galleryViewRenderer.lastChangeTime > CHANGE_TIME_WINDOW_MS) {
            	galleryViewRenderer.lastChangeTime = currTime;
            	scope.services.preferences.set(PREF_GALLERY_COLUMNS, numColumns);
            }
         };

Additionally, in the Alfresco.DocumentListGalleryViewRenderer constructor add `this.lastChangeTime = new Date();` and create new constance variable  `CHANGE_TIME_WINDOW_MS = 500;`

2. To apply the changes above, override gallery view-renderer configuration and change dependency to the newly created js file

View solution in original post

3 Replies
narkuss
Established Member II

Re: "Failed to set content property on stream closure"' error

Jump to solution

omg, I can't stop laughing. I just tried it out and it does gives an error! How did you find this error? Smiley LOL

Every time you change the slider value, Alfresco calls /preferences endpoint for the logged in user, with a new value for galleryColumns. It tries to modify the cmSmiley Tongueerson node, and when you move the slider too fast, it gives concurrency error when writing to database.

Answering your original question... I have no idea how you could solve this error... Maybe overriding the slider change event listener, customize it and filter the calls to preferences endpoint to avoid concurrency errors.

upforsin
Senior Member

Re: "Failed to set content property on stream closure"' error

Jump to solution

I also found it ridiculous but for my client it's important.

Well, thanks for help. I wll try to figure out something.

upforsin
Senior Member

Re: "Failed to set content property on stream closure"' error

Jump to solution

The Solution for any interested parties:

1. Copy and create own documentlist-view-gallery.js and replace the `scope.widgets.galleryColumnsSlider.setColumnsPreference` with the following

         scope.widgets.galleryColumnsSlider.setColumnsPreference = function _setColumnsPreference(numColumns)
         {
            if (numColumns == null) {
               numColumns = scope.widgets.galleryColumnsSlider.getColumnValue();
            }
            galleryViewRenderer.galleryColumns = numColumns;
            var currTime = new Date();
            if (currTime - galleryViewRenderer.lastChangeTime > CHANGE_TIME_WINDOW_MS) {
            	galleryViewRenderer.lastChangeTime = currTime;
            	scope.services.preferences.set(PREF_GALLERY_COLUMNS, numColumns);
            }
         };

Additionally, in the Alfresco.DocumentListGalleryViewRenderer constructor add `this.lastChangeTime = new Date();` and create new constance variable  `CHANGE_TIME_WINDOW_MS = 500;`

2. To apply the changes above, override gallery view-renderer configuration and change dependency to the newly created js file