Menu

#1409 Problem using N-N Links and AttributeText

3.1.0
closed
nobody
None
won't fix
User Interface
Medium
2.3.3
defect
2023-06-19
2017-01-29
No

When adding a AttributeText Field to a linking class, adding new links crashes. Every row of the table that is being added is added inside of every Formfield of the AttributeText-Type addidional. Applying leads in an error

1 Attachments

Discussion

  • Vincent @ Combodo

    • status: new --> more-info-needed
     
  • Vincent @ Combodo

    Hi Michael,
    Are you sure that your XML is written correctly ? Because that feature is supported and works since ages.

     
  • Michael Harbarth

    Hi,
    yes, I am sure that everything is fine with my XML-files. I have been debugging it the last night and found the problem in the DoAddObjects function of the linkswidget.js. When using fields that need more than just one line (like AttributeText) a new table is created inside the table. When adding a new line to the table the DoAddObjects function is called and it inserts the new line received via jquery in the table. This happens in this line of the function inside the .post jquery:

            $('#linkedset_'+me.id+' .listResults tbody').prepend(data);
    

    Because fields like AttributeText or AttributeCaseLog are building their own tables this returns an array of tbodies and the new line will be added in all of them what leads to the problem shown in the picture.
    This is easy to fix using "first", because the first tbody returned is the one we want to insert a row in:

            $('#linkedset_'+me.id+' .listResults tbody').first().prepend(data);
    

    This should also work, if only one tbody is returned so it would be a quick fix for this problem and I would love to see it in the next release.

     
  • Vincent @ Combodo

    • status: more-info-needed --> accepted
    • Milestone: Unassigned --> Later
     
  • Vincent @ Combodo

    You're right, this seems not to be working. I will add to the current backlog, but as we have more than 200 pending requests: bugs and enhancements, I have some doubt that this one will be in the next release.
    Workaround might be a create an object class, instead of a N-N relation, especially when you want to manage complexe fields on this relation.

     
  • Timothée Callet

    • status: accepted --> closed
    • Milestone: Later --> 3.1.0
    • Resolution: --> won't fix
     

    Last edit: Timothée Callet 2023-06-19

Log in to post a comment.