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

Return key in search box redirects to HTTP 405 #368

Closed
karottenbaum opened this issue Oct 23, 2018 · 4 comments · Fixed by #441

Comments

@karottenbaum
Copy link

@karottenbaum karottenbaum commented Oct 23, 2018

Explain the Problem

Pressing the Return key in the search box redirects to [Nextcloud path]/apps/news/#.
This page returns HTTP 405.

System Information

  • News app version: 13.0.3
  • Nextcloud version: 14.0.3
  • PHP version: 7.0.30
  • Database and version: MariaDB 10.1.23-9
  • Browser and version: Firefox 62.0.3 (64-bit), Chromium 69.0.3497.81
  • Distribution and version: Ubuntu 18.04.1 (client), Raspbian 9 (server)

Contents of nextcloud/data/nextcloud.log

No log entries generated during installation or reproduction

Contents of Browser Error Console

Navigated to https://example.com/apps/news/
jquery-migrate.min.js:2 JQMIGRATE: Migrate is installed, version 1.4.0
jquery.min.js:4 [Intervention] Slow network is detected. See https://www.chromestatus.com/feature/5636954674692096 for more details. Fallback font will be used while loading: https://example.com/core/fonts/OpenSans-Semibold.woff
jquery.min.js:4 [Intervention] Slow network is detected. See https://www.chromestatus.com/feature/5636954674692096 for more details. Fallback font will be used while loading: https://example.com/core/fonts/OpenSans-Light.woff
VM2206:4 Uncaught SyntaxError: Unexpected token :
    at new Function (<anonymous>)
    at Object._generatePluralFunction (l10n.js:125)
    at Object.register (l10n.js:77)
    at de.js:1
_generatePluralFunction @ l10n.js:125
register @ l10n.js:77
(anonymous) @ de.js:1
DevTools failed to parse SourceMap: https://example.com/core/vendor/css-vars-ponyfill/dist/css-vars-ponyfill.min.js.map
DevTools failed to parse SourceMap: https://example.com/apps/notifications/js/notifications.js.map
DevTools failed to parse SourceMap: https://example.com/core/vendor/jquery/dist/jquery.min.map
@laodzu

This comment has been minimized.

Copy link
Contributor

@laodzu laodzu commented Oct 25, 2018

Can you please be more explicit to what search box you refer to? To be honest, I don"t understand the report as I am not aware of any "search box". Maybe post a screenshot if in doubt. Thanks!

@Grotax

This comment has been minimized.

Copy link
Member

@Grotax Grotax commented Oct 25, 2018

nc_search
This one, tested it already and can confirm but didn't find the cause.
I think it's a general nextcloud function that apps need to implement as the search context will switch to the current app.
Searching something while the news app is open will result in a HTTP 405 Error

@karottenbaum

This comment has been minimized.

Copy link
Author

@karottenbaum karottenbaum commented Oct 25, 2018

Exactly, that one. When I use the back button on the error page, the URL bar changes to [Nextcloud path]/apps/news#/items?search=[query] and the results are appropriately filtered.

@Grotax

This comment has been minimized.

Copy link
Member

@Grotax Grotax commented Mar 5, 2019

I did take another look on this.
The cause seems to be a POST that is send by the browser when you hit enter. It simply contains the query. Which leads to a 405. The correct version is handled via a GET.

But my JS-experience is not that great.I guess this could be the default action? And we need to prevent that?

@Grotax Grotax added the help wanted label Mar 5, 2019
@Grotax Grotax pinned this issue Mar 6, 2019
Grotax added a commit that referenced this issue Mar 14, 2019
this fixes #368
@Grotax Grotax referenced this issue Mar 14, 2019
@Grotax Grotax added in progress and removed help wanted labels Mar 14, 2019
@Grotax Grotax unpinned this issue Mar 14, 2019
@Grotax Grotax closed this in #441 Mar 15, 2019
Grotax added a commit that referenced this issue Mar 15, 2019
this fixes #368
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.