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

Run withouth user from CMS not working correctly #361

Open
teundirectlease opened this issue Oct 20, 2021 · 0 comments
Open

Run withouth user from CMS not working correctly #361

teundirectlease opened this issue Oct 20, 2021 · 0 comments

Comments

@teundirectlease
Copy link

teundirectlease commented Oct 20, 2021

If i run a queued static publish job from within the CMS(withouth a user selected) all the urls that get published have ?stage=Live in the url. If i run it from the CLI it works as expected.

Looking at the QueedJobService.php file, I overwrite to use userId 0:

 // no user provided - fallback to job user default
//        if ($userId === null && $job instanceof UserContextInterface) {
            $userId = $job->getRunAsMemberID();
//        }

        // still no user - fallback to current user
//        if ($userId === null) {
//            if (Security::getCurrentUser() && Security::getCurrentUser()->exists()) {
//                // current user available
//                $runAsID = Security::getCurrentUser()->ID;
//            } else {
//                // current user unavailable
//                $runAsID = 0;
//            }
//        } else {
            $runAsID = $userId;
//        }

        $jobDescriptor->RunAsID = $runAsID;

I use default config. I use Fluent and SS 4.8.0.
I think currently it is not possible to start a job from the CMS and run it without a user.

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