partkeepr / PartKeepr

Open Source Inventory Management
http://www.partkeepr.org
GNU General Public License v3.0
1.38k stars 401 forks source link

Sorting wrt. the internal ID is not possible #992

Open christianlupus opened 6 years ago

christianlupus commented 6 years ago

System Information

An error occurred

Details
==================================
[Syntax Error] line 0, col 180: Error: Expected end of string, got 'id'

Request
==================================
GET https://www2.wolf-stuttgart.net/partkeepr/api/parts?_dc=1533214728822

Response Status Code
==================================
500

Response
==================================
{"@context":"\/partkeepr\/api\/contexts\/Error","@type":"Error","hydra:title":"An error occurred","hydra:description":"[Syntax Error] line 0, col 180: Error: Expected end of string, got \u0027id\u0027"}

Server Configuration
==================================
doctrine_orm_version: 2.5.4
doctrine_dbal_version: 2.5.2
doctrine_common_version: 2.6.0-DEV
php_version: 7.2.8
auto_start_session: true
maxUploadSize: 16777216
isOctoPartAvailable: true
availableImageFormats: JPG,GIF,PNG
max_users: unlimited
authentication_provider: PartKeepr.Auth.HTTPBasicAuthenticationProvider
tip_of_the_day_uri: https://partkeepr.org/tips/%s
password_change: true
patreonStatus: [object Object]
defaultGridPresets: [] 

Screenshot of my system information screen:

screenshot-www2 wolf-stuttgart net-2018-08-02-15-08-35

How to reproduce

mindsolve commented 6 years ago

This is unfortunately a known issue. Please refer to bug https://github.com/partkeepr/PartKeepr/issues/827.

integralmedia commented 5 years ago

Line 364: /src/PartKeepr/DoctrineReflectionBundle/Filter/AdvancedSearchFilter.php

Change: $subfilters[] = $this->extractJSONFilters($subfilter); To:

$subfilter->property = str_replace("@","",$subfilter->property);
$subfilters[] = $this->extractJSONFilters($subfilter);

the @ symbol seems to be causing the issue so I just stripped it from the property. Working now.

christianlupus commented 5 years ago

@integralmedia Thank you, I will try it out soon to see its effect. Do you have a pull request open, yet?

christianlupus commented 4 years ago

See also #924