cancel
Showing results for 
Search instead for 
Did you mean: 

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

upforsin
Star Collaborator
Star Collaborator

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:

image

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?

howkymike
Alfresco Developer
1 ACCEPTED ANSWER

upforsin
Star Collaborator
Star Collaborator

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

howkymike
Alfresco Developer

View answer in original post

3 REPLIES 3

narkuss
Star Contributor
Star Contributor

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
Star Collaborator
Star Collaborator

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

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

howkymike
Alfresco Developer

upforsin
Star Collaborator
Star Collaborator

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

howkymike
Alfresco Developer