-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
NC20: Music app Ampache API broken because URL parameter 'action' can't be used #23544
Comments
If I knew how to fix this I would 🙁 |
So does anyone have any idea, why is the URL argument |
I'm almost certain that this bug has been introduced as a side effect of the commit edc1c77. Before the commit, the execution went through this branch: server/lib/private/Route/Router.php Lines 291 to 297 in cd7a627
...where the key 'action' is removed from the $parameters returned by the UrlMatcher .
After the commit, this branch is executed instead: server/lib/private/Route/Router.php Lines 297 to 301 in f7fa292
Here, the server/lib/private/AppFramework/Http/Request.php Lines 169 to 175 in cd7a627
What do you think, @rullzer? |
To add to my previous comment, it seems that the bug can be fixed by adding the call
near the line server/lib/private/Route/Router.php Line 299 in f7fa292
But as I lack the knowledge of the big picture of the Nextcloud routing, I'm not certain if this is the best way to fix this, or if this could have some side effects on some case. But so far I have noticed nothing wrong when I made this experimental one line fix on my installation. |
Hi Devs, I would like to upvote this issue too. Thanks. |
Hi Devs, It works with Nextcloud 20.0.5. Thanks! |
i found that the url needs to be https://nextcloudserver.tld/index.php/apps/music/ampache i also used the api password generator |
How to use GitHub
Steps to reproduce
action=somecontent
, e.g.https://domain.org/nextcloud/index.php/apps/someapp/api/somemethod?action=somecontent
action
in the controller class either through function argument injectionpublic function someMethod($action)
or by calling$this->request->getParam('action')
or$this->request->getParams()['action']
or$this->request['action']
.Expected behaviour
The controller should be able to obtain the value
somecontent
of the URL argumentaction
.Actual behaviour
The value of the argument
action
is empty, no matter which method you use to obtain it. Arguments with any other name work as expected, but the nameaction
is somehow special. Also, if you call an API endpoint without supplying the command line argumentaction
, the array returned by$this->request->getParams()
still contains the keyaction
with an empty content.This oddity prevents using the Ampache API of the Music app on Nextcloud 20, as reported in owncloud/music#791. This issue is new in NC20, there has never been such problem on the NC versions 12 - 19.
(Side note: The Music app version 0.17.0 with support for NC20 has just been released.)
Server configuration
Operating system: Raspbian Linux 4.9.35-v7+ armv7l
Web server: nginx/1.6.2
Database: sqlite3 3.8.7.1
PHP version: 7.4
Nextcloud version: Nextcloud 20.0.0 RC2
Updated from an older Nextcloud/ownCloud or fresh install: fresh
Where did you install Nextcloud from: https://nextcloud.com/install/
Signing status:
Signing status
List of activated apps:
App list
Nextcloud configuration:
Config report
Are you using external storage, if yes which one: no
Are you using encryption: no
Are you using an external user-backend, if yes which one: no
Client configuration
Browser: N/A
Operating system: N/A
The text was updated successfully, but these errors were encountered: