Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ODS Import] Uncaught TypeError: PhpMyAdmin\Import::detectType(): Argument #2 ($cell) must be of type ?string, float given #16920

Closed
mokraemer opened this issue May 26, 2021 · 5 comments
Assignees
Labels
Bug A problem or regression with an existing feature has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete
Projects
Milestone

Comments

@mokraemer
Copy link
Contributor

The give stacktrace is:

PHP Fatal error:  Uncaught TypeError: PhpMyAdmin\Import::detectType(): Argument #2 ($cell) must be of type ?string, float given, called in /usr/share/phpmyadmin/libraries/classes/Import.php on line 977 and defined in /usr/share/phpmyadmin/libraries/classes/Import.php:890
Stack trace:
#0 /usr/share/phpmyadmin/libraries/classes/Import.php(977): PhpMyAdmin\Import->detectType()
#1 /usr/share/phpmyadmin/libraries/classes/Plugins/Import/ImportOds.php(207): PhpMyAdmin\Import->analyzeTable()
#2 /usr/share/phpmyadmin/libraries/classes/Controllers/ImportController.php(635): PhpMyAdmin\Plugins\Import\ImportOds->doImport()
#3 /usr/share/phpmyadmin/libraries/classes/Routing.php(186): PhpMyAdmin\Controllers\ImportController->index()
#4 /usr/share/phpmyadmin/index.php(18): PhpMyAdmin\Routing::callControllerForRoute()
#5 {main}
  thrown in /usr/share/phpmyadmin/libraries/classes/Import.php on line 890

the line is:
$curr_type = $this->detectType($types[$i], $table[self::ROWS][$j][$i]);

it looks like the second argument is not as expected.

@williamdes
Copy link
Member

Hi @mokraemer
Could you provide us the failing file or a sample file that also reproduces the failure?

@williamdes williamdes added the Bug A problem or regression with an existing feature label May 27, 2021
@williamdes williamdes added this to Needs triage in issues via automation May 27, 2021
@williamdes williamdes added this to the 5.1.2 milestone May 27, 2021
@mokraemer
Copy link
Contributor Author

import.ods

Here is the requested file

@williamdes williamdes moved this from Needs triage to Reproduced in issues May 28, 2021
@williamdes williamdes changed the title PHP8: type error during ods import [ODS Import] Uncaught TypeError: PhpMyAdmin\Import::detectType(): Argument #2 ($cell) must be of type ?string, float given May 28, 2021
@williamdes williamdes self-assigned this May 28, 2021
@williamdes williamdes added the has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete label May 28, 2021
@williamdes williamdes modified the milestones: 5.1.2, 5.1.1 May 28, 2021
williamdes added a commit that referenced this issue May 28, 2021
…ype(): Argument #2 ($cell) must be of type ?string, float given

Signed-off-by: William Desportes <williamdes@wdes.fr>
williamdes added a commit that referenced this issue May 28, 2021
Signed-off-by: William Desportes <williamdes@wdes.fr>
issues automation moved this from Reproduced to Closed May 28, 2021
@williamdes
Copy link
Member

I could reproduce and fix this error, thank you for reporting it !

Fatal error: Uncaught TypeError: PhpMyAdmin\Import::detectType(): Argument #2 ($cell) must be of type ?string, float given, called in
libraries/classes/Import.php on line 977 and defined in
libraries/classes/Import.php:890 Stack trace: #0
libraries/classes/Import.php(977): PhpMyAdmin\Import->detectType(1, 0.13) #1
libraries/classes/Plugins/Import/ImportOds.php(207): PhpMyAdmin\Import->analyzeTable(Array) #2
libraries/classes/Controllers/ImportController.php(635): PhpMyAdmin\Plugins\Import\ImportOds->doImport(Object(PhpMyAdmin\File), Array) #3
libraries/classes/Routing.php(187): PhpMyAdmin\Controllers\ImportController->index(Array) #4
index.php(18): PhpMyAdmin\Routing::callControllerForRoute('/import', Object(FastRoute\Dispatcher\GroupCountBased), Object(Symfony\Component\DependencyInjection\ContainerBuilder)) #5 {main} thrown in
libraries/classes/Import.php on line 890

@mokraemer
Copy link
Contributor Author

thanks for fixing!

@williamdes
Copy link
Member

thanks for fixing!

You can try the latest 5.1 version in development (phpMyAdmin 5.1+snapshot) it will include the fix :)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A problem or regression with an existing feature has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete
Projects
issues
  
Closed
Development

No branches or pull requests

2 participants