Problem customized javascript after upgrade to 28.0.2: changes in fileactions.js, filelist.js and newfilemenu.js have no effect


we upgraded from NC 27 to NC 28.0.2

Changes in the …/apps/files/js files like fileactions.js, newfilemenu.js etc. have no effects any more.

We made these changes to prevent that users change the folder structure.
That means only admin user can create, rename, delete or move folders
Normal users can only create, delete or rename files in the given structure.

We know that this method is not optimal, because we have to make the changes after every update but it worked without problems for years now until upgrade to NC 28

Example a part of our customized filelist.js to prevent that “normal” users move files or directories:
* Event handler for when clicking on “Move” for the selected files
_onClickCopyMoveSelected: function(event) {
var files;
var self = this;
// change only admin can move
if (!(OC.currentUser === “admin”)) {
alert(“Missing rights to execute this function”);

There are other posts ( Files Plugin Register does not work in stable28 ) that report also problems with adjustments in js code
The reference to the Upgrade NC 28 page doesn´t help me with my problem.
Other users mentioned that the API changed.

One thing could be also interesting:
In the Folder | @nextcloud/files
the file node.ts has a move method, maybe we could customize that file.
Problem is, that we don´t have the node.ts file in our installation.

Maybe some other here had the same problem after upgrade to NC 28 and
could give me an tipp in which files NC 28 defines the function for file actions
like rename, create and delete.

That would help me a lot.

These files are no longer used. The JS & TS files from the repositories are compiled into large compressed JS files which are then shipped with Nextcloud.

If you want to edit these files, you need to check out the original repositories, edit the source files and then compile your own version of Nextcloud.

1 Like

Many thanks for your response!
That helps me.
Then I don’t need to look any further for the .js and .ts files. I will then check for changes in the directory structure at the Linux level using cronjobs and warn the corresponding users :slight_smile:

If you know your way around PHP, you can also write your own addon to enforce file restictions. The Filesystem events notify you about any event related to moving, adding, deleting etc.: Events — Nextcloud latest Developer Manual latest documentation


This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.