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

Clone must use addSkel, not an editSkel #16

Open
tsteinruecken opened this issue Oct 12, 2018 · 4 comments
Open

Clone must use addSkel, not an editSkel #16

tsteinruecken opened this issue Oct 12, 2018 · 4 comments
Assignees
Labels
discussion These topics must be discussed before completion feature New feature or request proposal v3.0
Milestone

Comments

@tsteinruecken
Copy link
Contributor

When cloning an entry, the form must use the structure from an addSkel, not an editSkel. Currently, we simply use the editForm and reset its Key to None (so data will be pushed to /module/add instead). But addSkel and editSkel might have different structures (like readOnly fields that can only be set once during add). These would currently be still readOnly and clone not possible on such modules.

@tsteinruecken tsteinruecken added the bug Something isn't working label Oct 12, 2018
@phorward phorward self-assigned this Nov 27, 2018
@phorward
Copy link
Member

There had been several modifications on the widgets/edit.py file which already should solve this issue since v2.3. Please verify it with your case and report whether it is working or working.

@phorward phorward added the wontfix This will not be worked on label Nov 27, 2018
@tsteinruecken
Copy link
Contributor Author

I can confirm that this bug is still present in

ViUR Visual Interface v2.3.0
Rev fd3715d
Built Di 27. Nov 15:14:16 CET 2018

@phorward phorward removed the wontfix This will not be worked on label Nov 27, 2018
@phorward
Copy link
Member

OK thanks, then I'll gonna test it with develop.

@phorward phorward added the v2.4 label Nov 27, 2018
@sveneberth sveneberth added this to ToDo in ViUR 2.4.0 Feb 27, 2019
@sveneberth sveneberth added v2.5 and removed v2.4 labels May 17, 2019
@sveneberth sveneberth added this to To do in ViUR 2.5.0 via automation May 17, 2019
@sveneberth sveneberth removed this from ToDo in ViUR 2.4.0 May 17, 2019
@sveneberth sveneberth added this to the v2.5.0 milestone May 17, 2019
@phorward
Copy link
Member

Hello!

After a short examination of this problem, I will not fix this issue for ViUR 2.x because of the following reasons which have their origin in ViURs current design: To create a clone of an existing dataset using the add-function, I first have to call edit with the existing key to obtain the data of the source entity. I cannot call the add-function with an exiting key! Then, I would need to send this data, again, to the appropriate add function of the module to verify them with the according addSkel.
But to send data to the add function, I first have to render the bones from the editSkel, unserialize the values to the bones, immediately serializeForPost the values again from the bones to construct a POST request for the add, destruct the bones, call the add-function, rebuild the bones again according to the addSkel with the values from the former entity and unserialize them again. You have to admit, that this will bloat the entire solution for this problem and will become extremely slow.

My proposal for a smart solution would be to provide a clone() function for all modules which read an entity from a key but returns the according addSkel. Maybe this could be combined with the hierarchy cloning features from Tree and Hierarchy.

For now I would tag this issue for v3.0, everything else makes no sense.

@phorward phorward added discussion These topics must be discussed before completion feature New feature or request proposal v3.0 and removed bug Something isn't working v2.5 labels Jul 25, 2019
@sveneberth sveneberth modified the milestones: v2.5.0, v3.0.0 Jul 25, 2019
@sveneberth sveneberth removed this from To do in ViUR 2.5.0 Jul 25, 2019
@sveneberth sveneberth added this to To do in ViUR 3.0.0 via automation Jul 25, 2019
@akelch akelch added this to Backlog in Version 21Q3 ( Beta 2 ) - features via automation Dec 23, 2020
@akelch akelch modified the milestones: v3.0.0, Beta 2 Dec 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion These topics must be discussed before completion feature New feature or request proposal v3.0
Projects
No open projects
Development

No branches or pull requests

4 participants