Warning in ./libraries/classes/InsertEdit.php#1765

Und alles was mit phpMyAdmin seine Verwandtschaft findet hat hier seinen Platz.

Warning in ./libraries/classes/InsertEdit.php#1765

Postby jdevrie » 28. August 2022 22:01

I have this error in the title in PHPMYADMIN 5.2.0. This is on some tables when trying to copy a row or change a row through the detail screen.
I have had these tables for years and never had any problem with it.
When I go back to PHPMYADMIN 4.9.10 or 4.9.7 this error does not appear so it seems like an error in PHP 5.2.0.
I saw someone else with the same problem on the Internet with phpmyadmin 5.1.3 so it seems like an error that was introduced with version 5.
The full report looked like this:
================================================================================================================================
Warning in ./libraries/classes/InsertEdit.php#1765
implode(): Invalid arguments passed

Backtrace

InsertEdit.php#1765: implode(
string ',',
string 'N',
)
ReplaceController.php#312: PhpMyAdmin\InsertEdit->getCurrentValueForDifferentTypes(
boolean false,
string '15eaa49c3f4df7a7d1ae5c4746809f48',
array,
string '\'\'',
array,
integer 0,
array,
NULL,
NULL,
boolean true,
boolean false,
integer 0,
string 'groep',
array,
)
Routing.php#192: PhpMyAdmin\Controllers\Table\ReplaceController->__invoke(
,
array,
)
index.php#43: PhpMyAdmin\Routing::callControllerForRoute(
,
string '/table/replace',
,
,
)
================================================================================================================================
Anyone that has a clue?
jdevrie
 
Posts: 2
Joined: 28. August 2022 21:35
XAMPP version: none
Operating System: Windows 11

Re: Warning in ./libraries/classes/InsertEdit.php#1765

Postby jdevrie » 29. August 2022 19:30

I debugged the code PHP code and found out that in line 1765 of the InsertEdit.php the implode function is used that expects an array but what is offered is a single value of a set of values.

} elseif ($type === 'set') {
$currentValue = "''";
if (! empty($_POST['fields']['multi_edit'][$rownumber][$key])) {
$currentValue = implode(',', $_POST['fields']['multi_edit'][$rownumber][$key]);
$currentValue = "'"
. $this->dbi->escapeString($currentValue) . "'";
}

So I removed the implode function from the line since no array was offered.

} elseif ($type === 'set') {
$currentValue = "''";
if (! empty($_POST['fields']['multi_edit'][$rownumber][$key])) {
$currentValue = $_POST['fields']['multi_edit'][$rownumber][$key];
$currentValue = "'"
. $this->dbi->escapeString($currentValue) . "'";
}

Now the code works.
Will have to do some more testing to see if there is any other impact of this change but so far it looks like a solution.
jdevrie
 
Posts: 2
Joined: 28. August 2022 21:35
XAMPP version: none
Operating System: Windows 11


Return to phpMyAdmin

Who is online

Users browsing this forum: No registered users and 32 guests