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

caUtils throwing error when calling caGetOptions with Zend_Console_getopt type #1690

Open
Monica-Wood opened this issue Jan 30, 2025 · 0 comments

Comments

@Monica-Wood
Copy link
Contributor

When trying to call a caUtils command such as create-ngrams, the following error is being thrown:

# support/bin/caUtils create-ngrams
CollectiveAccess 2.0 (199/GIT) Utilities
(c) 2013-2025 Whirl-i-Gig

PHP Fatal error:  Uncaught TypeError: caGetOption(): Argument #2 ($pa_options) must be of type ?array, Zend_Console_Getopt given, called in /var/www/providence/app/lib/Utils/CLIUtils/Search.php on line 99 and defined in /var/www/providence/app/helpers/utilityHelpers.php:2404
Stack trace:
#0 /var/www/providence/app/lib/Utils/CLIUtils/Search.php(99): caGetOption()
#1 /var/www/providence/support/bin/caUtils(171): CLIUtils::create_ngrams()
#2 {main}
  thrown in /var/www/providence/app/helpers/utilityHelpers.php on line 2404

This is related to commit 585bc43#diff-08c1965d29f2be2136cf3fbad0436356baf56858d167563968945fd4b8046028

It can no longer read in the Zend_Console_Getopt type, as the parameter is explicitly an array (or null).

If I remove the ?array type, then it works, but I am assuming the type was added for a reason.

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