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

未关闭
#388 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
php
领域
cli

调研方向

首先,使用报告中的 PHP 和 Nextcloud 版本重现 occ sharing:list。检查 lib/Service/SharesList.php 的第 116 行和第 193 行,然后跟踪从 lib/Command/ListShares.php 第 114 行发起的调用,以确定为什么 iter\\filter() 不可用。命令在没有未定义函数错误或报告中的参数警告的情况下完成,即表示完成。

由索引模型根据 Issue 内容生成。

描述

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?

主要语言
PHP
星标
20
派生
8
平均合并
7 分钟
30 天内合并 PR
1

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

nextcloud/sharelisting 的其他 Issue

查看 nextcloud/sharelisting 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。