nextcloud / nextcloud/sharelisting

occ sharing:list throws "Call to undefined function" error

Open
#388 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
19
Forks
6
PR merge metrics
No merged PRs in 30d

Description

Nextcloud 27.0.0
php-fpm: 8.2.7

Running the sharing:list command leads to an error

sudo -iu userX /opt/nextcloud/occ sharing:list
PHP Deprecated:  Optional parameter $userId declared before required parameter $filter is implicitly treated as a required parameter in /opt/nextcloud-27.0.0/nextcloud/apps/sharelisting-1.1.1/lib/Service/SharesList.php on line 193
An unhandled exception has been thrown:
Error: Call to undefined function iter\filter() in /opt/nextcloud-27.0.0/nextcloud/apps/sharelisting-1.1.1/lib/Service/SharesList.php:116
Stack trace:
#0 /opt/nextcloud-27.0.0/nextcloud/apps/sharelisting-1.1.1/lib/Service/SharesList.php(194): OCA\ShareListing\Service\SharesList->get()
#1 /opt/nextcloud-27.0.0/nextcloud/apps/sharelisting-1.1.1/lib/Command/ListShares.php(114): OCA\ShareListing\Service\SharesList->getFormattedShares()
#2 /opt/nextcloud-27.0.0/nextcloud/lib/private/User/Manager.php(632): OCA\ShareListing\Command\ListShares->OCA\ShareListing\Command\{closure}()
#3 /opt/nextcloud-27.0.0/nextcloud/apps/sharelisting-1.1.1/lib/Command/ListShares.php(113): OC\User\Manager->callForSeenUsers()
#4 /opt/nextcloud-27.0.0/nextcloud/3rdparty/symfony/console/Command/Command.php(298): OCA\ShareListing\Command\ListShares->execute()
#5 /opt/nextcloud-27.0.0/nextcloud/core/Command/Base.php(177): Symfony\Component\Console\Command\Command->run()
#6 /opt/nextcloud-27.0.0/nextcloud/3rdparty/symfony/console/Application.php(1040): OC\Core\Command\Base->run()
#7 /opt/nextcloud-27.0.0/nextcloud/3rdparty/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand()
#8 /opt/nextcloud-27.0.0/nextcloud/3rdparty/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun()
#9 /opt/nextcloud-27.0.0/nextcloud/lib/private/Console/Application.php(211): Symfony\Component\Console\Application->run()
#10 /opt/nextcloud-27.0.0/nextcloud/console.php(100): OC\Console\Application->run()
#11 /opt/nextcloud-27.0.0/nextcloud/occ(11): require_once('...')

The first portion of the error can be fixed with editing line 193 according to https://github.com/nextcloud/sharelisting/issues/368

The second part of the error ("An unhandled exception has been thrown") remains after that.

Any advice for a fix?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing occ sharing:list with the reported PHP and Nextcloud versions. Inspect lib/Service/SharesList.php at lines 116 and 193, then trace the call from lib/Command/ListShares.php line 114 to determine why iter\filter() is unavailable. Done means the command completes without the undefined-function error or the reported parameter warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.