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

[BUG] Sorting links by random give error of SQLSTATE #651

Closed
vdbhb59 opened this issue May 30, 2023 · 1 comment · Fixed by #652
Closed

[BUG] Sorting links by random give error of SQLSTATE #651

vdbhb59 opened this issue May 30, 2023 · 1 comment · Fixed by #652
Labels
Bug Something isn't working

Comments

@vdbhb59
Copy link

vdbhb59 commented May 30, 2023

Bug Description

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'random' in 'order clause' (SQL: select * from links where user_id = 1 and links.deleted_at is null order by random asc, RAND() limit 24 offset 0) {"userId":1,"exception":"[object] (Illuminate\Database\QueryException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'random' in 'order clause' (SQL: select * from links where user_id = 1 and links.deleted_at is null order by random asc, RAND() limit 24 offset 0) at /PATH_TO/vendor/laravel/framework/src/Illuminate/Database/Connection.php:760)

When I try and sort the links by random, I get the above error, and the page give an internal 500 error (see snap). URL bar address: https://instanceurlhere/links?orderBy=random

How to reproduce

Go to All Links
Select Order By > Random
The above error of SQL gets thrown up
The Page throws a 500 internal error and the Logs give the database error.

Expected behavior

The links should be randomly shown, based on a set of coded parameters and logic.

Logs

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'random' in 'order clause' (SQL: select * from `links` where `user_id` = 1 and `links`.`deleted_at` is null order by `random` asc, RAND() limit 24 offset 0) {"userId":1,"exception":"[object] (Illuminate\\Database\\QueryException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'random' in 'order clause' (SQL: select * from `links` where `user_id` = 1 and `links`.`deleted_at` is null order by `random` asc, RAND() limit 24 offset 0) at /PATH_TO/vendor/laravel/framework/src/Illuminate/Database/Connection.php:760)

Screenshots

image

LinkAce version

V1.12.0

Setup Method

PHP

Operating System

Linux (Ubuntu, CentOS,...)

Client details

Windows 11 - Librewolf - 113.0.1-1
MX Linux - LibreWolf - 133.0.1-1

@vdbhb59 vdbhb59 added the Bug Something isn't working label May 30, 2023
@Kovah
Copy link
Owner

Kovah commented May 30, 2023

Hi, thanks for taking the time to report this issue. It's already know and a solution will be released in the following weeks (see #638).

Closing this as a duplicate for now.

@Kovah Kovah closed this as completed May 30, 2023
@Kovah Kovah linked a pull request Jun 4, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants