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

Wrong media manager set in the sessions #13

Open
Oetzie opened this issue Jun 8, 2021 · 2 comments
Open

Wrong media manager set in the sessions #13

Oetzie opened this issue Jun 8, 2021 · 2 comments

Comments

@Oetzie
Copy link

Oetzie commented Jun 8, 2021

The function setCurrentSource sets the wrong mediasource ID to the session. For example, the uploads mediasource is 3 (uploads) and the files mediasource is 2 (files) you will get errors.

When you save a file, file based snippet or chunk the setCurrentSource will set the $_SESSION['mediamanager']['source'] to 2 (because the $_REQUEST['source'] is set). After this you will get an error in the mediasource because it will load mediasource 2 (files) instead of mediasource 3 (uploads).

@Oetzie Oetzie changed the title Wrong media manager set in the sessions. Wrong media manager set in the sessions Jun 9, 2021
@sonicpunk
Copy link

sonicpunk commented Dec 13, 2022

Not sure if this helps. I may have seen this issue when using the home controller. We added this code to line 14 and it helps.

 if (($this->mediaManager->sources->getCurrentSource() !== $this->mediaManager->sources->getUserSource()) && $this->mediaManager->sources->getUserSource() !== 0) {

            $_SESSION['mediamanager']['source'] = $this->mediaManager->sources->getUserSource();
            $_REQUEST['source'] = $this->mediaManager->sources->getUserSource();

            $this->mediaManager->sources = new MediaManagerSourcesHelper($this->mediaManager);
            $this->mediaSource = $this->mediaManager->sources->getSource($this->mediaManager->sources->getCurrentSource());
        }

@sonicpunk
Copy link

@gpsietzema You have a look at this?

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

2 participants