Menu

#2012 Cannot prefill data in a n-n relationship

Unassigned
assistance
Prefill (1)
Extension
High
2.7.0
defect
2021-12-31
2021-12-27
No

Hello,
I am trying to initialize an attribute of the link table between an n-n relationship and according to the documentation this would be possible using the PrefillCreationForm method.
I have two tables created and related by a linked attribute but while adding objects on the Indirect LinkedSet attribute, the PrefillCreationForm method is never called.
Looking at dbobject.class.php I have seen that there is the case creation_from_editinplace which I think is the one I need but it is never called too.This is a bug or is not possible to prefill data from a linkedAttribute?

Discussion

  • Pierre Goiffon

    Pierre Goiffon - 2021-12-29

    Hello,
    Can you describe the use case you wanted to solve ?
    And send your customization's XML ?

     
  • Pierre Goiffon

    Pierre Goiffon - 2021-12-29
    • status: new --> more-info-needed
    • assigned_to: Pierre Goiffon
     
  • Pierre Goiffon

    Pierre Goiffon - 2021-12-29

    Hello,
    Can you describe the use case you wanted to solve ?
    And send your customization's XML ?

     
  • Samuel Diaz Vigil

    Hello,
    This is the description of the use case I want to solve

     
  • Samuel Diaz Vigil

    And this is the XML

     
  • Vincent @ Combodo

    Hello Samuel,
    The PrefillCreationForm method is not called in the case of an n:n relation (and the wiki does not say it would)
    The only option to have it prefilled is for the attribute of the link table, to have a default value.
    Another possibility, is to stop using n:n relationship to replace them with a standard class (no more a link) and the associated AttributeLinkedSetIndirect to be replaced by AttributeLinkedSet, in which case adding a link, would mean create an object, using the CreationForm and then the PrefillCreationForm method would be called... but the remote object would not be known as not yet selected.
    Best regards
    Vincent

     
  • Pierre Goiffon

    Pierre Goiffon - 2021-12-31
    • status: more-info-needed --> assistance
     
  • Pierre Goiffon

    Pierre Goiffon - 2021-12-31

    Closing this ticket after Vincent's answer

     

Log in to post a comment.

MongoDB Logo MongoDB