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

Undefined variable: result in import area #12349

Closed
ibennetch opened this issue Jun 29, 2016 · 8 comments
Closed

Undefined variable: result in import area #12349

ibennetch opened this issue Jun 29, 2016 · 8 comments
Assignees
Labels
Bug A problem or regression with an existing feature newbie
Milestone

Comments

@ibennetch
Copy link
Member

upload 1.txt file (content of file "111") in "File to import:"
choose "MediaWiki Table" or "ESRI Shape file" as format, click "Go"

result:

Notice in .\import.php#809
Undefined variable: result

Notice in .\import.php#827
Undefined variable: result

Notice in .\import.php#830
Undefined variable: msg

@ibennetch
Copy link
Member Author

(Initially reported by Emanuel Bronshtein)

@mirzataimur
Copy link

Hi there,

i just viewed the import.php file and noticed both of variables are UNDEFINED like the error says.

i tried the following solution and it worked
Define both variables lets say
$result = true;
$msg = "Successful";

and run it then it should work fine.
I am just new to open source contribution thing so really not sure about it if its the proper solution.

@Fenn-CS
Copy link
Contributor

Fenn-CS commented Mar 16, 2017

Hello @ibennetch after examining the issue I found that $result and $message are not defined in the area where default values are set see.
https://github.com/phpmyadmin/phpmyadmin/blob/master/import.php#L317
How ever its easy to simply set the $result variable to obvious default false and message to empty string. But what is not obvious is what is supposed to possibly change this variable to true in the code like with $go_sql which has a default value of false.
https://github.com/phpmyadmin/phpmyadmin/blob/master/import.php#L409
Once this is clear it will be easy to simply determine the what should be in the message string from the $result variable
https://github.com/phpmyadmin/phpmyadmin/blob/master/import.php#L750-L770

@Fenn-CS
Copy link
Contributor

Fenn-CS commented Mar 17, 2017

@ibennetch @nijel I am still waiting for updates to my question for me to continue with this issue

@nijel nijel added the Bug A problem or regression with an existing feature label Mar 20, 2017
@nijel
Copy link
Contributor

nijel commented Mar 20, 2017

AFAIK the $msg is not really needed if you set $result...

@Fenn-CS
Copy link
Contributor

Fenn-CS commented Mar 20, 2017

@nijel setting the $result variable will cancel the error. But I also need to know what it depends on to avoid logical errors. Because the default value will be false but it definitely has to change if something happens thats what I want to know.

@nijel
Copy link
Contributor

nijel commented Mar 20, 2017

Makes sense, but you should not use Success as default value, in case it would be ever displayed it would be quite confusing....

@nijel
Copy link
Contributor

nijel commented Mar 21, 2017

Fixed by #13109

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 22, 2020
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 newbie
Projects
None yet
Development

No branches or pull requests

4 participants