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

'Add Parameter' button not working for Add Routine Screen. #17833

Closed
scottmcgowan24 opened this issue Oct 25, 2022 · 3 comments · Fixed by #18032
Closed

'Add Parameter' button not working for Add Routine Screen. #17833

scottmcgowan24 opened this issue Oct 25, 2022 · 3 comments · Fixed by #18032
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 ui Issues relating to the user interface
Milestone

Comments

@scottmcgowan24
Copy link
Contributor

Describe the bug

On the screen to create a new procedure, when the 'Add Parameter' Button is clicked (even around the edges, which is the problem with other buttons currently) an additional parameter is not created.

To Reproduce

Steps to reproduce the behavior:

  1. Go to a Database on PhpMyAdmin on the left pane and expand the 'procedures' tab
  2. Click on 'new'
  3. Attempt to add a new parameter to the procedure definition via the UI
  4. See that you cannot add new parameters to the UI

Expected behavior

New parameters should be addable to the new procedure being created.

Screenshots

image

Server configuration

  • Operating system: N/A
  • Web server: N/A
  • Database version: N/A
  • PHP version: 7.4.32
  • phpMyAdmin version: 5.2.0

Client configuration

  • Browser: N/A
  • Operating system: N/A
@williamdes williamdes added Bug A problem or regression with an existing feature ui Issues relating to the user interface affects/5.2 This issue or pull-request affects 5.2.x releases (and maybe further versions) labels Oct 25, 2022
@williamdes williamdes added this to the 5.2.1 milestone Oct 25, 2022
@williamdes williamdes added affects/6.0 This issue or pull-request affects 6.0.x releases (and maybe further versions) confirmed/5.2 This issue is confirmed to be reproduced on 5.2 at the time this label was set confirmed/6.0 This issue is confirmed to be reproduced on 6.0 at the time this label was set labels Oct 26, 2022
@williamdes
Copy link
Member

This is where is stopped my debug

diff --git a/js/src/database/routines.js b/js/src/database/routines.js
index 826a826c75..d966c2cb8c 100644
--- a/js/src/database/routines.js
+++ b/js/src/database/routines.js
@@ -929,7 +929,7 @@ AJAX.registerOnload('database/routines.js', function () {
          * @var routine_params_table jQuery object containing the reference
          *                           to the routine parameters table
          */
-        const $routineParamsTable = $(this).closest('div.ui-dialog').find('.routine_params_table');
+        const $routineParamsTable = $(this).closest('form.rte_form').find('.routine_params_table');
         /**
          * @var new_param_row A string containing the HTML code for the
          *                    new row for the routine parameters table

it relies on a template row that can not be found because the form is no longer open as ajax modal but as a page

    /**
     * Execute some code after the ajax dialog for the editor is shown.
     *
     * @param data JSON-encoded data from the ajax request
     */
    postDialogShow: function (data) {
        // Cache the template for a parameter table row
        DatabaseRoutines.paramTemplate = data.paramTemplate;

If you apply my patch then more of the code is ran but without a working template row nothing can be added

williamdes added a commit that referenced this issue Oct 26, 2022
…on form

See: #17833
Fixes: #17812

Signed-off-by: William Desportes <williamdes@wdes.fr>
@williamdes
Copy link
Member

Hi @MauricioFauth
Can I have some of your help on this one please ?

@iifawzi
Copy link
Contributor

iifawzi commented Jan 15, 2023

it relies on a template row that can not be found because the form is no longer open as ajax modal but as a page

I've been looking after this, couldn't find any commit / pr explaining why or when the listeners below on the navigation file, have been removed.

/** Create a Routine, Trigger or Event */
$(document).on('click', 'li.new_procedure a.ajax, li.new_function a.ajax', function (event) {
event.preventDefault();
var dialog = new RTE.Object('routine');
dialog.editorDialog(1, $(this));
});

I can see a lot of deleted listeners from that file, and most probably this's the reason why it's now opening as a page, was it an intended refactor? I couldn't find a commit or a PR where those lines are deleted

@MauricioFauth MauricioFauth added the has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete label Jan 24, 2023
@MauricioFauth MauricioFauth linked a pull request Jan 24, 2023 that will close this issue
MauricioFauth added a commit that referenced this issue Jan 24, 2023
…tton

Fix broken button that adds routine params

- Fixes #17833
- Fixes #17929
- Fixes #17971
@MauricioFauth MauricioFauth self-assigned this Jan 24, 2023
MauricioFauth added a commit that referenced this issue Jan 24, 2023
[ci skip]

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
@williamdes williamdes removed affects/5.2 This issue or pull-request affects 5.2.x releases (and maybe further versions) affects/6.0 This issue or pull-request affects 6.0.x releases (and maybe further versions) confirmed/5.2 This issue is confirmed to be reproduced on 5.2 at the time this label was set confirmed/6.0 This issue is confirmed to be reproduced on 6.0 at the time this label was set labels Jan 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 25, 2024
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 ui Issues relating to the user interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants