php error after upgrade Joomla 4 and php 8.1

wiva 26 Feb, 2023
After upgrade to Joomla 4 and php 8.1 one of my forms gives an error
in the form i use a PHP event to validate an arrray of dropdown fields to be unique.
before the update this form was oke. Now i get this error : [0 Undifined constant "ip"]
this is the php code.
Who can help me?
// an array of drop-down names:
$dropdowns=array(
$this->data[ip][0][renner],
$this->data[ip][1][renner],
$this->data[ip][2][renner],
$this->data[ip][3][renner],  
$this->data[ip][4][renner],  
$this->data[ip][5][renner],
$this->data[ip][6][renner],
$this->data[ip][7][renner],
$this->data[ip][8][renner],
$this->data[ip][9][renner],
$this->data[ip][10][renner],
$this->data[ip][11][renner],
$this->data[ip][12][renner],
$this->data[ip][13][renner],
$this->data[ip][14][renner],
);

$dropdowns = array_unique($dropdowns);
if ( count($dropdowns) < 15 ) {
  return fail;
 } else {
 return success;  
 }
Max_admin 27 Feb, 2023
Answer
Yes, both "ip" and "renner" should be placed between quotes because they are strings
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
wiva 27 Feb, 2023
1 Likes
That works,
Thank you Max
You need to login to be able to post a reply.

VPS & Email Hosting 20% discount
hostinger