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

Error when visualizing nullable geometry column #16706

Closed
M393 opened this issue Mar 3, 2021 · 1 comment
Closed

Error when visualizing nullable geometry column #16706

M393 opened this issue Mar 3, 2021 · 1 comment
Assignees
Labels
Bug A problem or regression with an existing feature
Projects
Milestone

Comments

@M393
Copy link
Contributor

M393 commented Mar 3, 2021

Describe the bug

Error when visualizing nullable geometry column.

To Reproduce

Steps to reproduce the behavior:

  1. Create table with nullable geometry
CREATE TABLE `a` (`p` polygon DEFAULT NULL);
INSERT INTO `a` (`p`) VALUES (NULL);
SELECT * FROM `a`;
  1. Click on Visualize GIS data
  2. See error
Error in GIS visualize with nullable Polygon column
<b>Fatal error</b>:  Uncaught TypeError: mb_strpos() expects parameter 1 to be string, null given in libraries\classes\Gis\GisVisualization.php:626
Stack trace:
#0 libraries\classes\Gis\GisVisualization.php(626): mb_strpos(NULL, '(')
#1 libraries\classes\Gis\GisVisualization.php(365): PhpMyAdmin\Gis\GisVisualization->scaleDataSet(Array)
#2 libraries\classes\Gis\GisVisualization.php(382): PhpMyAdmin\Gis\GisVisualization->svg()
#3 libraries\classes\Gis\GisVisualization.php(568): PhpMyAdmin\Gis\GisVisualization->asSVG()
#4 libraries\classes\Controllers\Table\GisVisualizationController.php(184): PhpMyAdmin\Gis\GisVisualization->toImage('svg')
#5 libraries\classes\Routing.php(186): PhpMyAdmin\Controllers\Table\GisVisualizationController->index(Array)
#6 index.php(18): PhpMyAdmin\Routing::callControllerForRoute('/table/gis-visu...', Object(FastRoute\Dispatcher\GroupCountBased), Object(Symfony\Component\DependencyInjection\ContainerBuilder))
#7 {main}
  thrown in <b>libraries\classes\Gis\GisVisualization.php</b> on line <b>626</b>

Expected behavior

Ignore null values for visualization.

Server configuration

  • Operating system: Windows 7
  • Web server: Apache 2.4
  • Database version: MySQL 5.7.29
  • PHP version: 7.2
  • phpMyAdmin version: 5.1
@williamdes williamdes added the Bug A problem or regression with an existing feature label Mar 4, 2021
@williamdes williamdes self-assigned this Mar 4, 2021
@williamdes williamdes added this to Needs triage in issues via automation Mar 4, 2021
@williamdes williamdes moved this from Needs triage to Reproduced in issues Mar 4, 2021
@williamdes williamdes added this to the 5.1.1 milestone Mar 4, 2021
williamdes added a commit that referenced this issue Mar 4, 2021
Signed-off-by: William Desportes <williamdes@wdes.fr>
@williamdes
Copy link
Member

Thank you @M393 for this report !
I could reproduce and fix this issue, I also added tests to cover it.
It will be fixed in the next 5.1 version.

issues automation moved this from Reproduced to Closed Mar 4, 2021
@williamdes williamdes reopened this Mar 4, 2021
issues automation moved this from Closed to Needs triage Mar 4, 2021
williamdes added a commit that referenced this issue Mar 4, 2021
Signed-off-by: William Desportes <williamdes@wdes.fr>
issues automation moved this from Needs triage to Closed Mar 4, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 5, 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
Projects
issues
  
Closed
Development

No branches or pull requests

2 participants