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

Error with quota during "Fetching data" phase #69

Open
gmammolo opened this issue Jul 20, 2023 · 0 comments
Open

Error with quota during "Fetching data" phase #69

gmammolo opened this issue Jul 20, 2023 · 0 comments

Comments

@gmammolo
Copy link

  • nextcloud version: 25.0.6
  • nextcloud-userexport: 1.2.1

Error:

PHP Fatal error:  Uncaught TypeError: Unsupported operand types: int + string in /var/www/nextcloud-userexport/functions.php:695
Stack trace:
  #0 /var/www/nextcloud-userexport/index.php(104): calculate_quota()
  #1 {main}\n  thrown in /var/www/nextcloud-userexport/functions.php on line 695

Analysis and possible solution:

In some cases the value of $user_data['ocs']['data']['quota'] (functions.php:695) return 'none' and is interpreted as a string.
I'm not really sure why this happens, but when I've checked all $user_data['ocs']['data']['quota'] values, I see a few elements have less values (like only Array ( [quota] => none, [used] => 0 )).

To avoid fatal error, simply add intval parse:

functions.php:695

$quota_assigned = intval($user_data['ocs']['data']['quota']['quota']);
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