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

NC22 server error #36

Closed
psjbeisler opened this issue Jul 7, 2021 · 4 comments · Fixed by #37
Closed

NC22 server error #36

psjbeisler opened this issue Jul 7, 2021 · 4 comments · Fixed by #37

Comments

@psjbeisler
Copy link

Updated from NC21 to NC22 and could not log in due to 500 errors

"version":"22.0.0.11","exception":{"Exception":"Error","Message":"Class 'OCP\\User' not found","Code":0,"Trace":[{"file":"/var/www/html/custom_apps/epubreader/lib/Hooks.php","line":41,"function":"get","class":"OCA\\Epubreader\\Config","type":"::","args":["epub_enable","true"]}

had to

occ app:disable epubreader

nextcloud/server#26407

@human-blip
Copy link

Two instances of \OCP\User in lib/config.php

do they need to be replaced? - as per https://nextcloud-server.netlify.app/classes/ocp-user#method_getUser

@pbek
Copy link

pbek commented Jul 25, 2021

Any news on this? 😸

@voyageur
Copy link
Contributor

voyageur commented Aug 2, 2021

I can send a PR in a few days (my main system is off for a few days), but changing these 2 instances in lib/config.php is indeed enough for me:

diff -Naur epubreader.git/lib/config.php epubreader/lib/config.php
--- epubreader.git/lib/config.php	2021-08-02 11:36:25.073961784 +0200
+++ epubreader/lib/config.php	2021-07-06 14:43:30.407356502 +0200
@@ -25,7 +25,7 @@
 	 * @return string retrieved value or default
 	 */
 	public static function get($key, $default) {
-		return \OC::$server->getConfig()->getUserValue(\OCP\User::getUser(), 'epubreader', $key, $default);
+		return \OC::$server->getConfig()->getUserValue(\OC_User::getUser(), 'epubreader', $key, $default);
 	}
 
 	/**
@@ -36,7 +36,7 @@
 	 * @return bool success
 	 */
 	public static function set($key, $value) {
-		return \OC::$server->getConfig()->setUserValue(\OCP\User::getUser(), 'epubreader', $key, $value);
+		return \OC::$server->getConfig()->setUserValue(\OC_User::getUser(), 'epubreader', $key, $value);
 	}
 
 	/**

@Goddard
Copy link

Goddard commented Aug 3, 2021

yeah couldn't install because of the error.

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

Successfully merging a pull request may close this issue.

5 participants