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

Fatal error when trying to edit row with row checked and button under the table #15571

Closed
raimundmeyer opened this issue Nov 13, 2019 · 26 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

@raimundmeyer
Copy link

raimundmeyer commented Nov 13, 2019

Describe the bug

When selecting one or several rows with the checkbox in the row view and clicking the edit button, a fatal PHP error is thrown

To Reproduce

Steps to reproduce the behavior:

  1. Go to browse view of a table that has entries
  2. check the checkbox in the row
  3. click "Edit" below the table view
  4. PHP error:

PHP Fatal error: Uncaught TypeError: Argument 3 passed to PhpMyAdmin\InsertEdit::urlParamsInEditMode() must be of the type string or null, array given, called in /var/www/phpmyadmin/libraries/entry_points/table/change.php on line 142 and defined in /var/www/phpmyadmin/libraries/classes/InsertEdit.php:254
Stack trace:
#0 /var/www/phpmyadmin/libraries/entry_points/table/change.php(142): PhpMyAdmin\InsertEdit->urlParamsInEditMode(Array, Array, Array)
#1 /var/www/phpmyadmin/libraries/entry_points/table/row_action.php(97): include('/var/www/phpmya...')
#2 /var/www/phpmyadmin/libraries/routes.php(511): require_once('/var/www/phpmya...')
#3 /var/www/phpmyadmin/index.php(58): {closure}(Array)
#4 {main}
thrown in /var/www/phpmyadmin/libraries/classes/InsertEdit.php on line 254

Expected behavior

It should open the edit view

Server configuration

Latest git: Git revision: b9380c5 from master branch,
committed on Nov 13, 2019 at 10:05 AM by Hosted Weblate,
authored on Nov 10, 2019 at 11:41 PM by Allan Nordhøy

https://demo.phpmyadmin.net/master/index.php

@williamdes williamdes added this to Needs triage in issues via automation Nov 13, 2019
@Tithugues
Copy link
Contributor

As the 3rd parameter is not used in the function, I think we can just remove it. We won't have the error anymore.

@williamdes williamdes added the Bug A problem or regression with an existing feature label Nov 15, 2019
@williamdes williamdes moved this from Needs triage to Reproduced in issues Nov 15, 2019
@AshwinGinoria
Copy link
Contributor

Hello, I would like to help but this would be my first contribution so can somebody guide me a bit ??

@williamdes
Copy link
Member

Follow the steps:

  • Fork the repository
  • Clone the fork locally into a web folder eg:/var/www
  • Checkout QA_4_9 branch since it is an bug fix and create a new branch from QA_4_9
  • Run composer install
  • Create a config.inc.php if needed using the example file
  • Access your phpmyadmin website and login
  • Start developing the fix
  • Do not forget to use --signoff option to add your signoff line in the commit body, please use your real name (this option is an agreement to our policy)
  • Push your changes and open a pull-request to this repository, branch: QA_4_9

Do you have any questions?

@AshwinGinoria
Copy link
Contributor

The QA_4_9 branch of My fork is showing "This branch is 1 commit behind". Is that a problem ?
If yes how to remove it ??

@williamdes
Copy link
Member

Is that a problem ?

I would say no in most cases

You can do:

git remote add phpmyadmin https://github.com/phpmyadmin/phpmyadmin.git
git fetch --all
git checkout QA_4_9
git reset --hard QA_4_9 phpmyadmin/QA_4_9
git push --force QA_4_9

Warning: I hope you followed the advice to create a branch for the fix because the script will reset and sync the QA_4_9 branch as it is on our repo.

@AshwinGinoria
Copy link
Contributor

I was following the installation instructions given in the documentation.
the repository got cloned successfully but I am getting the following error when running composer update. I tried googling it but couldn't find much there. please Help
Screenshot from 2019-11-17 15-42-25

@williamdes
Copy link
Member

@AshwinGinoria you seem to have a connexion issue, try another time
We can not help much but re-trying is the best option, if you have a bad Internet connexion it can be difficult to pass this step without some patience :)

@AshwinGinoria
Copy link
Contributor

Done!! :D
I was on my college network which uses a proxy server so I switched to my phone's hotspot.

@AshwinGinoria
Copy link
Contributor

phpmyadmin installed successfully, Thank You very much for help!! :D
But now it automatically logs my into phpmyadmin Not prompting me for username/password (Is that expected Behavior ??
Also when I press logout it shows :

Screenshot from 2019-11-18 04-08-38

@Tithugues
Copy link
Contributor

@AshwinGinoria , there is a message you sent (and probably deleted) telling that in your configuration, you have: $cfg['Servers'][$i]['auth_type'] = 'config';
So yes, it's the expected behavior that you don't need to log in.
For the log out… I don't know, but I'm pretty sure this is not something important for now.

Can you reach other pages? Do some actions? If yes and yes, then you should now be able to work on this ticket.
Were you able to reproduce the encountered error?

@AshwinGinoria
Copy link
Contributor

No, The error wasn't Reproduced my machine.
I followed the steps as given in the bug description and I think I got the edit view as expected (Not sure what edit view is ) .

Screenshot from 2019-11-18 12-34-47

@Tithugues
Copy link
Contributor

I think there is something the author didn't say: I guess he was using PHP7.3 (or upper).
Which one do you use?

@AshwinGinoria
Copy link
Contributor

AshwinGinoria commented Nov 18, 2019

I am currently using PHP7.2.
I'll try with php7.3 and update the status.

@AshwinGinoria
Copy link
Contributor

Not able to reproduce even with php7.3.11 .

@Tithugues
Copy link
Contributor

@williamdes , as 4.9 doesn't have strict mode, I think this should only be done from 5.0, don't you think?

@williamdes
Copy link
Member

@Tithugues I would prefer to have the fix on 4.9 to avoid having to do a cherry-pick if it is needed some day

You can add comments on the PR if you want me to do a change a file when merging in 5.0

@Tithugues
Copy link
Contributor

@AshwinGinoria , so I guess that you have to:

  • do the changes on the 5.0
  • apply them on 4.9
  • check that it still works on 4.9
  • submit your PR targetting the 4.9

@AshwinGinoria
Copy link
Contributor

I am on branch QA_5_0 and my php version is 7.3.11. On following the steps to reproduce the error I am getting Internal Server Error.

Screenshot from 2019-11-19 08-19-32

@Tithugues
Copy link
Contributor

@AshwinGinoria , I would say you reproduced the error. You should have the PHP logs somewhere. Are the logs reporting the same error than the one described in this issue?

@AshwinGinoria
Copy link
Contributor

@Tithugues the php log is showing the error mentioned above in the issue. I'll now get started on actually understanding the error. Thank You !! :D

@Tithugues
Copy link
Contributor

@AshwinGinoria , any news regarding this error please? Do you expect to fix it or can someone else fix it?
Thank you!

@AshwinGinoria
Copy link
Contributor

@Tithugues Sorry for replying so late !!
My end semester Exams Started Last week so I couldn't give much time to this. But I've spent some time understanding the relevant part of the code and I think I understand most of it. My Exams will be over This week, so can I work on it after that ??

@Tithugues
Copy link
Contributor

@AshwinGinoria , thank you for the answer.
Unless the pMA team expect this bug to be fixed earlier than beginning of december, I'll wait for this time before trying to provide a fix.

@williamdes
Copy link
Member

@ibennetch does it seem okay to you ?

@AshwinGinoria
Copy link
Contributor

Hello, Sorry for being so late.
I've fixed the issue on 5.0, Now how should I proceed with applying it on 4.9 ??

@williamdes williamdes self-assigned this Dec 3, 2019
@williamdes
Copy link
Member

Hello @AshwinGinoria you can fix it on 4.9 branch and open a pull-request ;)

AshwinGinoria added a commit to AshwinGinoria/phpmyadmin that referenced this issue Dec 4, 2019
AshwinGinoria added a commit to AshwinGinoria/phpmyadmin that referenced this issue Dec 4, 2019
Signed-off-by: Ashwin Ginoria <ashwinginoria@gmail.com>

Date:      Wed Dec 4 14:03:50 2019 +0530
@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 Dec 5, 2019
@williamdes williamdes added this to the 4.9.3 milestone Dec 5, 2019
williamdes added a commit to AshwinGinoria/phpmyadmin that referenced this issue Dec 5, 2019
Signed-off-by: William Desportes <williamdes@wdes.fr>
williamdes added a commit that referenced this issue Dec 5, 2019
…w checked and button under the table

Pull-request: #15613
Signed-off-by: William Desportes <williamdes@wdes.fr>
issues automation moved this from Reproduced to Closed Dec 5, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 5, 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 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

4 participants