File Manager problems in combination with non admin users

Permalink
Well I've made about 50 sites with C5 and this is the first time I encounter this problem.
Basically the File Manager works fine, as long as you are an Administrator.

I've made a site with a Group Set of users called 'Stores'. In that Group Set are Groups like 'Clothing'. Every user in that Group Set has a profile page and if you're logged in there are some fancy buttons to change your profile information. One of those options is to upload an additional image in the File Manager(just like how the Image block works).
Once one of those users tries to press Upload Multiple or Upload File they get forwarded to a blank page with the content printed that is supposed to be shown in the popup(see attachment).

This happens both locally and on the production server.
The strange thing is that Administrators are immune for this bug.
Yes, I've played around with the File Manager Permissions and to test I've given the group set 'Stores' the same right as the Administrator. Also added File Uploader to all options to be safe. Nothing changes, same problem occurs.

Any ideas?

1 Attachment

bleenders
 
hutman replied on at Permalink Reply
hutman
Under System & Settings -> PERMISSIONS & ACCESS -> File Permissions that group will need:

View Files
Search Files in File Manager
Edit File Properties
Edit File Contents
Add File

Enabled in order to have them upload a new file and view it in the File Manager. That screenshot that you attached is more than likely a permissions issue making things display oddly.
bleenders replied on at Permalink Reply
bleenders
Thanks for you input, but im afraid the permissions are not the problem.
I've traced the bug back to ccm.app.js
$("#ccm-" + searchType + "-advanced-search").ajaxForm({
      beforeSubmit : function() {
         ccm_deactivateSearchResults(searchType)
      },
      success : function(resp) {
         ccm_parseAdvancedSearchResponse(resp, searchType)
      }
   });

It doesnt recognize the method ajaxForm for some reason. The strange this is that when you're an administrator it does recognize the method. I can circumvent the problem for now by just removing(commenting out) the search field in the file manager.

But if anyone has any idea why ajaxForm is not recognized when you're not an admin, your input is very welcome.
BTW. Tried all this on versions 5.6.2.1 , 5.6.3 and 5.6.3.1 all trow the the same issue.
bleenders replied on at Permalink Reply
bleenders
Ok so scratch that. That will only give you a worst headache.

The problem is probably an oversight by the C5 development team.
I'm fairly sure they did not test the following case:
Enabling the image/file attribute in the attribute set users and try to upload a file.

They just missed some jquery imports somehow. The ajaxForm method will only be available when you have jquery.form.js imported. That file will only be imported when you have access to the dashboard (see: concrete/elements/page_controls_header.php). Which doesn't make sense since you can enable the attribute like stated above. And those users wont have access to the dashboard, but only to their edit profile page.

Solved by adding the following lines to concrete/core/models/attribute/types/date_time.php in the form() method switchs default case:
$this->addHeaderItem($html->javascript('jquery.form.js'));
            $this->addHeaderItem($html->javascript('jquery.rating.js'));
            $this->addHeaderItem($html->javascript('bootstrap.js'));