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
Milestone

Comments

@ibennetch
Copy link
Member

@ibennetch ibennetch commented Jun 29, 2016

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 ibennetch added the newbie label Jun 29, 2016
@ibennetch

This comment has been minimized.

Copy link
Member Author

@ibennetch ibennetch commented Jun 29, 2016

(Initially reported by Emanuel Bronshtein)

@mirzataimur

This comment has been minimized.

Copy link

@mirzataimur mirzataimur commented Jul 17, 2016

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

This comment has been minimized.

Copy link
Contributor

@Fenn-CS 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

This comment has been minimized.

Copy link
Contributor

@Fenn-CS 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 label Mar 20, 2017
@nijel

This comment has been minimized.

Copy link
Member

@nijel nijel commented Mar 20, 2017

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

@Fenn-CS

This comment has been minimized.

Copy link
Contributor

@Fenn-CS 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

This comment has been minimized.

Copy link
Member

@nijel 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

This comment has been minimized.

Copy link
Member

@nijel nijel commented Mar 21, 2017

Fixed by #13109

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.