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

Related (FK) NULL value field editing bug #14425

Closed
Jay04653 opened this issue Jun 25, 2018 · 5 comments
Closed

Related (FK) NULL value field editing bug #14425

Jay04653 opened this issue Jun 25, 2018 · 5 comments
Assignees
Labels
Bug A problem or regression with an existing feature good first issue has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete help wanted ui Issues relating to the user interface
Milestone

Comments

@Jay04653
Copy link

Jay04653 commented Jun 25, 2018

Steps to reproduce

  1. Open table with FK fields
  2. Double click on cell with null value
  3. In opened popup type/paste FK ID
  4. Press Enter or click outside of popup

Expected behaviour

Value should save, I guess Null checkbox should be unmarked when I started to typing/pasting FK ID see screenshot
screen1

Actual behaviour

In this case editing will be cancelled and value will be NULL again

Server configuration

Operating system: GNU/Linux Ubuntu 16.04 and 18.04

Web server: Apache 2.4

Database: MariaDB 10.1.31 / MySQL 5.7.21

PHP version: 7.1 / 7.2

phpMyAdmin version: 4.8.1 / 4.8.2

Client configuration

Browser: Google Chrome

Operating system: GNU/Linux Ubuntu 18.04

@williamdes williamdes added Bug A problem or regression with an existing feature ui Issues relating to the user interface good first issue help wanted labels Nov 5, 2018
@williamdes
Copy link
Member

@Jay04653
5.0.0-dev 4.8.x
Thank you for the issue, reproduced successfully on demo servers.

Data

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
CREATE TABLE `fks` (
  `id` int(11) NOT NULL,
  `idUser` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

INSERT INTO `fks` (`id`, `idUser`) VALUES
(1, NULL);
CREATE TABLE `users` (
  `id` int(11) NOT NULL,
  `name` varchar(30) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Users';
INSERT INTO `users` (`id`, `name`) VALUES
(1, 'oo');
ALTER TABLE `fks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idUser` (`idUser`);
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD KEY `id` (`id`);
ALTER TABLE `fks`
  ADD CONSTRAINT `fks_ibfk_1` FOREIGN KEY (`idUser`) REFERENCES `users` (`id`);
COMMIT;

Reproduce

Try to edit fks row 1 cell idUser as @Jay04653 explained

@akkywadhwa
Copy link
Contributor

akkywadhwa commented Nov 20, 2018

Hey @williamdes! Can you please discuss that when this "Null" checkbox should be checked in ideal case? I guess either it would depend on, we can insert null or not or on the current value in that particular cell. Right now it's working according to the value. I think I can solve this issue. I have already reproduced this on my local system.

@williamdes
Copy link
Member

williamdes commented Nov 20, 2018

@akkywadhwa What if when it is checked the input is disabled ?
Unchecking it would disable the input and when the input is clicked or NULL unchecked it is re-enabled.

Empty is empty (defaults: unchecked) and when NULL is checked the input is disabled.
Empty the input if NULL is checked ?
Clicking out of the "modal" saves the value. keyboard:Enter saves the value since it is not multiline.
And escape aborts the changes and does not save. Re-open the edit and the aborted modifications are gone.

This is how I expect this to work :)

Does it answer your question ?

cc: @ibennetch

@kartik1000
Copy link
Contributor

@williamdes, Hey I fixed this issue shall I open PR against QA_4_8?

@williamdes
Copy link
Member

@kartik1000 Yes, please, go ahead :)

@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 Feb 27, 2019
williamdes added a commit that referenced this issue Mar 2, 2019
Signed-off-by: William Desportes <williamdes@wdes.fr>
@williamdes williamdes self-assigned this Mar 2, 2019
@williamdes williamdes added this to the 4.8.6 milestone Mar 2, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 21, 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 good first issue has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete help wanted ui Issues relating to the user interface
Projects
None yet
Development

No branches or pull requests

4 participants