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

Dynamic Rows - deleteValue/deleteProperty not used on deleting records #29574

Open
1 of 5 tasks
gwharton opened this issue Aug 17, 2020 · 25 comments
Open
1 of 5 tasks

Dynamic Rows - deleteValue/deleteProperty not used on deleting records #29574

gwharton opened this issue Aug 17, 2020 · 25 comments
Assignees
Labels
Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P3 May be fixed according to the position in the backlog. Progress: dev in progress Reported on 2.4.0 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it

Comments

@gwharton
Copy link
Contributor

gwharton commented Aug 17, 2020

Magento Docs state the following for dynamic rows config

deleteProperty
The property added to a record data object when the record is deleted. Applied if the deleteValue option is enabled.

deleteValue
Adds the deleteProperty property in the data object for the deleted record.

If I create a dynamic rows instance and set deleteValue to true and deleteProperty to "delete". When I delete a record, and save the record set, I would expect the controller to receive a data set including the deleted row, but with the deleted row marked with "delete" so the controller can easily see a deleted record and handle the removal.

I am not seeing this behaviour.

Preconditions (*)

  1. 2.4-develop

Steps to reproduce (*)

  1. Install test module (attached to issue)
  2. Go to the following page https://<host>/admin/testdynamicrows/test/index/entity_id/1
    image
  3. Click save without modifying data. The data passed to the save handler is displayed
    image
  4. Go back to https://<host>/admin/testdynamicrows/test/index/entity_id/1
  5. Remove row from data set.
  6. Click save.

Expected result (*)

  1. Data passed to save controller includes both records, but the record that was deleted is marked as deleted due to deleteValue being set true.

Actual result (*)

  1. Only 1 record is passed to save controller.
    image

Proof of concept Module attached here.
testdynamicrows.zip


Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
@m2-assistant
Copy link

m2-assistant bot commented Aug 17, 2020

Hi @gwharton. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

Please, add a comment to assign the issue: @magento I am working on this


⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Aug 17, 2020
@ghost ghost added this to Ready for QA in Community Backlog Aug 17, 2020
@gwharton
Copy link
Contributor Author

gwharton commented Aug 17, 2020

If I run the test module on 2.1.18 (updated version of proof of concept module that works on 2.1.18 attached) then it works as expected. In this example, I have removed the second row and saved.

image

app.zip

It appears to have stopped working in 2.2.0, from this commit. d5f0dd2

@sdzhepa sdzhepa added the Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it label Aug 17, 2020
@sidolov sidolov added this to Ready for Grooming in Low Priority Backlog Sep 24, 2020
@sidolov sidolov added this to Ready for Confirmation in Issue Confirmation and Triage Board Oct 20, 2020
@ghost ghost removed this from Ready for QA in Community Backlog Oct 20, 2020
@ghost ghost removed this from Ready for Grooming in Low Priority Backlog Oct 20, 2020
@ghost ghost added Issue: ready for confirmation and removed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed labels Oct 20, 2020
@magento-engcom-team magento-engcom-team added the Reported on 2.4.0 Indicates original Magento version for the Issue report. label Nov 13, 2020
@stale
Copy link

stale bot commented Jan 29, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 14 days if no further activity occurs. Is this issue still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? Thank you for your contributions!

@stale stale bot added the stale issue label Jan 29, 2021
@gwharton
Copy link
Contributor Author

Not stale

@stale stale bot removed the stale issue label Jan 29, 2021
@engcom-Alfa engcom-Alfa self-assigned this Jan 29, 2021
@m2-assistant
Copy link

m2-assistant bot commented Jan 29, 2021

Hi @engcom-Alfa. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Alfa
Copy link
Contributor

engcom-Alfa commented Jan 29, 2021

@gwharton . The issue is still reproducible on fresh 2.4-develop.

Steps to reproduce:

  1. Install test module testdynamicrows.zip
  2. Go to the following page https://<host>/admin/testdynamicrows/test/index/entity_id/1
    Screenshot from 2021-01-29 13-09-06
  3. Click save without modifying data. The data passed to the save handler is displayed
    {"post_data":{"testdynamicrows":{"testdynamicrows":[{"entity_id":"1","data_field":"Data Field 1","initialize":"true","record_id":"0"},{"entity_id":"2","data_field":"Data Field 2","initialize":"true","record_id":"1"}]},"form_key":"mDiYNxe68AaH4t3S"}}
  4. Go back to https://<host>/admin/testdynamicrows/test/index/entity_id/1
  5. Remove row from data set.
  6. Click save.

Actual Result: ❌ Only 1 record is passed to save controller.
{"post_data":{"testdynamicrows":{"testdynamicrows":[{"entity_id":"2","data_field":"Data Field 2","initialize":"true","record_id":"1"}]},"form_key":"mDiYNxe68AaH4t3S"}}

Note:
2021-01-29_13-13

@engcom-Alfa engcom-Alfa added Reported on 2.4.1 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed and removed Reported on 2.4.1 Indicates original Magento version for the Issue report. labels Jan 29, 2021
@m2-community-project m2-community-project bot moved this from Ready for Confirmation to Confirmed in Issue Confirmation and Triage Board Jan 29, 2021
@magento-engcom-team
Copy link
Contributor

✅ Confirmed by @engcom-Alfa
Thank you for verifying the issue. Based on the provided information internal tickets MC-40680 were created

Issue Available: @engcom-Alfa, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@github-jira-sync-bot github-jira-sync-bot added the Priority: P3 May be fixed according to the position in the backlog. label Feb 8, 2021
@m2-community-project m2-community-project bot moved this from Done to Dev In Progress in Low Priority Backlog May 11, 2021
@Den4ik Den4ik added the Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed label May 11, 2021
@magento-engcom-team
Copy link
Contributor

@Den4ik Thank you for verifying the issue.

Unfortunately, not enough information was provided to acknowledge ticket. Please consider adding the following:

  • Add "Reproduced on " label(s) to this ticket based on verification result

Once all required information is added, please add label "Issue: Confirmed" again.
Thanks!

@magento-engcom-team magento-engcom-team removed the Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed label May 11, 2021
@Den4ik Den4ik added the Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch label May 11, 2021
@Den4ik
Copy link
Contributor

Den4ik commented May 11, 2021

I think we should increase Priority and Severity to P2 and S2 because issue affect to user experience

cc @sdzhepa @gabrieldagama

@Den4ik Den4ik added the Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed label May 11, 2021
@magento-engcom-team
Copy link
Contributor

✅ Confirmed by @Den4ik
Thank you for verifying the issue. Based on the provided information internal tickets MC-40680 were created

Issue Available: @Den4ik, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@sidolov
Copy link
Contributor

sidolov commented May 11, 2021

@Den4ik could you please clarify how user experience is affected? I believe it's related to developer's experience and how developer will handle changes provided by the user.

@gwharton
Copy link
Contributor Author

In my view the bug in the dynamicRows component was introduced in 2.2.0. I suspect that the resulting bugs introduced into magento as a result of this change (any magento functionality that used the deleteValue attribute in dynamic rows would have stopped working) and was probably fixed on a case by case basis, by introducing logic to detect the deleted results and handle them, instead of fixing the underlying problem of the deleteValue functionality being broken.

Workarounds for the broken functionality were obviously introduced wherever they were needed during 2.2 and 2.3. There is currently no core functionality (that I am aware of) that is currently broken that uses the deleteProperty function of the dynamic rows component.

It is also likely that any third party developers also saw the unintended breaking change in 2.2 and implemented their own workarounds which are still in place.

The underlying deleteValue functionality remains broken though and still does not operate as the documentation suggests it should. You could just update the documentation to remove the "deleteProperty", "deleteValue" entries so code developers aren't trying to use this functionality that is broken (and hasnt worked since 2.2), introducing a note to say developers need to detect deleted rows on their own.

The deleteValue functionality is seriously useful though, as without it, you need to compare the before dataset, with the after dataset to determine any rows that have disappeared, whereas with the existing deleteValue functionality working, you are provided with a list of records that were deleted which is much more memory efficient.

It is broken because of an unintended change in the code, as highlighted above, and not because the code to implement it was removed. It was an unintended consequence of another change, and the code for deleteValue functionality is still there, just presently bypassed.

@Den4ik
Copy link
Contributor

Den4ik commented May 12, 2021

@sidolov I agree with @gwharton.
I didn't check but I believe that this properties worked before and in this case all custom modules that use this properties currently provide unexpected result if they are not updated.
In my opinion we should fix it as soon as possible and provide fix in patch release.

@gwharton
Copy link
Contributor Author

It's been broken since 2.2. I think most third parties will have worked around it by now 😀 been broken for so long, probs easier to remove it from the docs instead of fixing it. It would be useful if it worked though.

@Den4ik
Copy link
Contributor

Den4ik commented May 12, 2021

@gwharton 😄 In this case we can just update documentation for each bug.
I'm still thought that fix bug and adding tests for this case is the best solution.
I hope some one from community or I'll have time for take it into progress in the near future.

@adamlavery
Copy link

Can't quite believe what I've read here but explains why UI component implementation is so poorly done and hit and miss. Someone makes a change, doesn't test it properly and it results in breaking documented functionality that others may rely on. And you're joking about leaving it broken and just removing from the docs? Unprofessional! No wonder Magento is falling apart.

@gwharton
Copy link
Contributor Author

gwharton commented Apr 8, 2022

The point I made about removing it from the docs was.made with tongue in cheek. Hoping it may have shamed Magento Into action. Alas no.

@adamlavery
Copy link

Ok. The correct approach here is to push this back to whoever broke it and request that they reimplement their change, this time testing it properly.

@Poovarasan-06
Copy link

@magento I am working on this

@Poovarasan-06
Copy link

@magento give me 2.1.18 instance

@magento-deployment-service
Copy link

Hi @Poovarasan-06. Thank you for your request. I'm working on Magento instance for you.

@magento-deployment-service
Copy link

Hi @Poovarasan-06, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P3 May be fixed according to the position in the backlog. Progress: dev in progress Reported on 2.4.0 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
Low Priority Backlog
  
Dev In Progress
Development

No branches or pull requests

9 participants