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

Function getOptionsFromConfig() is not working #101

Closed
drionix opened this issue Jun 10, 2019 · 1 comment
Closed

Function getOptionsFromConfig() is not working #101

drionix opened this issue Jun 10, 2019 · 1 comment

Comments

@drionix
Copy link

drionix commented Jun 10, 2019

After pulling my hair out for hours of debugging, i found out that getOptionsFromConfig() is not working as intended.

    protected function getOptionsFromConfig(Config $config)
    {
        $options = [];
		
        if ($visibility = $config->get('visibility')) {
            $options['predefinedAcl'] = $this->getPredefinedAclForVisibility($visibility);
        } else {
            // if a file is created without an acl, it isn't accessible via the console
            // we therefore default to private
            $options['predefinedAcl'] = $this->getPredefinedAclForVisibility(AdapterInterface::VISIBILITY_PRIVATE);
        }

        if ($metadata = $config->get('metadata')) {
            $options['metadata'] = $metadata;
        }

        return $options;
    }

Specifically in this part of the function

if ($visibility = $config->get('visibility')) {
        $options['predefinedAcl'] = $this->getPredefinedAclForVisibility($visibility);
}

This happens because $config->get('whatever') apparently always return NULL whether the settings key has been set or not, and therefore always equal to false in the if else condition.

Anybody know how to fix this??

@drionix
Copy link
Author

drionix commented Jun 10, 2019

Just found out that the problem lies in barryvdh/elfinder-flysystem-driver package and not this package's bug.

@drionix drionix closed this as completed Jun 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant