Internal server error on entity ajax condition filter

Post Reply
antevasin
Posts: 126
Joined: 24 Mar 2020, 08:57
Name: Spencer Crocker
Location: Corby, UK
Company Name: Unicloud
Contact:

Internal server error on entity ajax condition filter

Post by antevasin »

https://pdemo.rukovoditel.pro/3.4/index ... mo_id=2338
Replicated in the above personal demo.
I have created a Divisions entity with status field id 214 and added this to the User entity as an entity ajax field- id 215 set to the Divisions entity. When I add the condition
field_214 != 69
to the field the error appears in the console and there are no items in the dropdown where there should be one.
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
bug is with file includes\classes\fieldstypes\fieldtype_entity_ajax.php foreach loop on line 585 which can't handle field 6 access groups being an array.
In my own dev I can see the PHP error as
Uncaught Error: [] operator not supported for strings in ...\includes\classes\fieldstypes\fieldtype_entity_ajax.php:595
Didou12
Posts: 487
Joined: 14 Jan 2023, 14:53
Name: Louis
Location: Montreal, Canada

Re: Internal server error on entity ajax condition filter

Post by Didou12 »

Hi

you need to use e.field_214,
e is for selected entity :)
I changed in the demo, try and tell me if it works.
Using Rukovoditel since 2022 --- v3.4 (with extension) in French on PHP 8.2
I keep the French translation up to date
I'm trying to help you (+10 years experience in html, css, php, sql, JS/jquery, python)
antevasin
Posts: 126
Joined: 24 Mar 2020, 08:57
Name: Spencer Crocker
Location: Corby, UK
Company Name: Unicloud
Contact:

Re: Internal server error on entity ajax condition filter

Post by antevasin »

No that hasns't made a difference there is still a 500 error from the AJAX call filtering the dropdown
ajax field.png
User avatar
support
Site Admin
Posts: 6231
Joined: 19 Oct 2014, 18:22
Name: Sergey Kharchishin
Location: Russia, Evpatoriya

Re: Internal server error on entity ajax condition filter

Post by support »

As I can see it works ok on demo? or still issue?
Didou12
Posts: 487
Joined: 14 Jan 2023, 14:53
Name: Louis
Location: Montreal, Canada

Re: Internal server error on entity ajax condition filter

Post by Didou12 »

Still issue with e.field_214 in (68,69)
same for e.field_214 != 69

Very weird, but it works with the "setting options" (gear icon), why condition doesn't work ? It's not the first time I saw it with list choices in field (not in a global list)
Using Rukovoditel since 2022 --- v3.4 (with extension) in French on PHP 8.2
I keep the French translation up to date
I'm trying to help you (+10 years experience in html, css, php, sql, JS/jquery, python)
antevasin
Posts: 126
Joined: 24 Mar 2020, 08:57
Name: Spencer Crocker
Location: Corby, UK
Company Name: Unicloud
Contact:

Re: Internal server error on entity ajax condition filter

Post by antevasin »

Yes, still an an issue when you put in the condition.
e.field_214 != 69
On my instance I get the following PHP error
VM253:40 Fatal error: Uncaught Error: [] operator not supported for strings in C:\Program Files\Ampps\www\spencer\includes\classes\fieldstypes\fieldtype_entity_ajax.php:595
Stack trace:
#0 C:\Program Files\Ampps\www\spencer\modules\dashboard\actions\select2_json.php(114): fieldtype_entity_ajax::mysql_query_where()
#1 C:\Program Files\Ampps\www\spencer\index.php(20): require('...')
#2 {main}
thrown in C:\Program Files\Ampps\www\spencer\includes\classes\fieldstypes\fieldtype_entity_ajax.php on line 595
Post Reply