Php warning - Ajax field in form

Post Reply
Didou12
Posts: 487
Joined: 14 Jan 2023, 14:53
Name: Louis
Location: Montreal, Canada

Php warning - Ajax field in form

Post by Didou12 »

Hi,

I work with an ajax field in the form, and I had this error (maybe it's my fault with my php code, don't know, I just had this error 3 times at the same moment) :

Code: Select all

2023-06-10 04:17	USER   Warning	
Trying to access array offset on value of type null
modules/dashboard/actions/ajax_request.php(109) : eval()'d code:101
/index.php?module=dashboard/ajax_request&field_id=722&item_id=0 [AJAX]
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)
JustAGuy
Posts: 22
Joined: 17 Jan 2023, 01:48
Name: Patrick
Location: Spain Bilbao

Re: Php warning - Ajax field in form

Post by JustAGuy »

Good afternoon mate!! :)

Something similar happened to me, but it was solved by changing the php version on my hosting server. It's weird because I had to go back to version 7.4 even though Rukovoditel version 3.4 is "compatible" with PHP version 8.2. Some of the tables did not finish synchronizing or did not respond to ajax calls :shock:

Try it to see if it fixes it. I hope it has been of some use to you. All the best!! ;)
Didou12
Posts: 487
Joined: 14 Jan 2023, 14:53
Name: Louis
Location: Montreal, Canada

Re: Php warning - Ajax field in form

Post by Didou12 »

Hi :)

Thank you, on my side it's just one time it appeared, so I think Sergey will take a look on it to try to correct the problem.

I don't really to return on a PHP older for securities reasons ^^
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)
Didou12
Posts: 487
Joined: 14 Jan 2023, 14:53
Name: Louis
Location: Montreal, Canada

Re: Php warning - Ajax field in form

Post by Didou12 »

Hi,

I have another error and I can't figure out why, it's when I edit :

Code: Select all

2023-06-22 16:39	USER		Warning	
Array to string conversion
modules/dashboard/actions/ajax_request.php:86
/index.php?module=dashboard/ajax_request&field_id=123&item_id=8 [AJAX]
2023-06-22 16:39	USER    Warning	
Array to string conversion
modules/dashboard/actions/ajax_request.php:86
/index.php?module=dashboard/ajax_request&field_id=456&item_id=8 [AJAX]
Here is what I have in one of these ajax fields (nested entity, I get an info from the parent) :

Code: Select all

$u_query = db_query("select field_111 from app_entity_22 where id={$_POST['parent_item_id']}",false);
if($u = db_fetch_array($u_query))
{
  echo $u['field_111'];
  $form_field_value = $u['field_111'];
}
else
{
  echo '*erreur*';
}
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)
Didou12
Posts: 487
Joined: 14 Jan 2023, 14:53
Name: Louis
Location: Montreal, Canada

Re: Php warning - Ajax field in form

Post by Didou12 »

Even without any code, the ajax field returns an error when editing.
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)
Didou12
Posts: 487
Joined: 14 Jan 2023, 14:53
Name: Louis
Location: Montreal, Canada

Re: Php warning - Ajax field in form

Post by Didou12 »

A little up,

Thanks
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)
User avatar
support
Site Admin
Posts: 6222
Joined: 19 Oct 2014, 18:22
Name: Sergey Kharchishin
Location: Russia, Evpatoriya

Re: Php warning - Ajax field in form

Post by support »

Can't reproduce.
Post Reply