Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fileroot issue with symbolic links #285

Closed
RRangioni opened this issue Feb 14, 2018 · 4 comments
Closed

Fileroot issue with symbolic links #285

RRangioni opened this issue Feb 14, 2018 · 4 comments
Assignees
Milestone

Comments

@RRangioni
Copy link

The following infra is causing an error when opening a folder.

Website creates hashed folderstructure for document-category like /data/personal/54fa912ae52d
In a MondoDB database i save the normal name for this document-category.

The option Exclusive folder works perfect when fileroot is set to /data/personal/

But, i want to create a View All Documents option and created a script which creates a new folderstructure based on the normal name instead of the hasded one.
Example: /data/alldocuments/categorie1 ( is a symbolic link to /data/personal/54fa912ae52d )

I set the fileroot to /data/alldocuments and can see all the categories.
But when i open a folder, i get the warning The directory /categorie1/ does not exist.
I even set 777 for access on all folders and files in order to solve this, but without success.

I really hope that i made a mistake.
I use the lastest version, downloaded it last week.

@psolom
Copy link
Owner

psolom commented Feb 19, 2018

I will check the issue in the coming days.
If you have already solved the issue let me know or/and create a PR.

@psolom
Copy link
Owner

psolom commented Feb 24, 2018

Today I way trying to reproduce your issue.

I have created "/fileroot" folder at the server root and "/fileroot_sm" symlink that refers to "/fileroot" folder. I tested both folder and symlink as RFM fileroots and both worked well.

Few remarks you can pay attention:

  1. If you set a fileroot outside a document root folder of your server, you have to set serverRoot to false in the config.local.php file. FYI, this will also for server document root folder scope, so worth to try anyway. Example:
"options" => [
	"serverRoot" => false,
	"fileRoot" => '/your/path', // absolute path with leading slash
],

OR you can modify few lines in the filemanager.php bootstrap file
This will take the same effect, just alternate way:

$storage = new \RFM\Repository\Local\Storage($config);
$storage ->setRoot('/your/path', true, false); // note the third arg set to false
  1. Your folder should have appropriate owner and/or permissions. If you don't want to set 777 permissions, then double check that your file root folder is owned by the same user as runs PHP.

You say that you checked it already, but note that "directory does not exist" error fires only in case of permissions are stricter than 444. In other case you will see the fileroot folder contents with all files locked.

Keep in mind that I haven't made any modifications in client-side configuration files - default setup. If you made some let me know and attach you config files (trying default configs at your end first). There is always a chance some implicit combination of configuration options will result in an error.

@psolom
Copy link
Owner

psolom commented Feb 24, 2018

Caught it!

I am able to reproduce the issue when symlink not a fileroot but included in the fileroot. Perhaps I misunderstood your case initially, however I found another old ticket that describes a similar issue and provide folders structure example. It turned out to be very helpful: psolom/RichFilemanager-PHP#12.

I will investigate the case and back with a feedback soon.

@psolom psolom added this to the 2.7.1 milestone Feb 25, 2018
@psolom psolom self-assigned this Feb 25, 2018
psolom added a commit that referenced this issue Feb 25, 2018
@psolom
Copy link
Owner

psolom commented Feb 25, 2018

Solved! Released in v2.7.1

You have to configure new options in the config.local.php file.

See details in psolom/RichFilemanager-PHP#12 (comment)

@psolom psolom closed this as completed Feb 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants