Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@laceysanderson
Copy link
Member

Bug Fix

Issue #1843

Tripal Version: 4

NOT COMPLETE!

Putting up as draft so that the tests run automatically to ensure I don't break anything ;-p

Description

There are a number of fields with unlimited cardinality (e.g. properties and linking fields). Currently if you have multiple records added to chado that these fields would normally show, publish will only show the first one. Furthermore, I'm not sure it's even doing that correctly. For example, if you have multiple contacts linked to a project, when you publish the projects only the first contact link will be published.

Testing?

1-4. Create two contacts, and two projects. Do not put a contact on the project or vice versa.
5. Generate links with this SQL: insert into chado.project_contact (project_id, contact_id) values (1,2), (1,3), (2,2), (2,3);
INSERT 0 4
6. Publish contact and project and run the job
8. Rebuild cache drush cache:rebuild

Currently you will observe that only one contact is present on each project, and only one project present on each contact. There should actually be two contacts on each project and two projects on each contact.

@laceysanderson laceysanderson added Tripal 4 Group 1 - Tripal Content Types | Terms | Fields Any issue relating to Tripal Content including types, terms, and fields. Group 2 - Data Storage | Tripal DBX | Chado Any issue relating to biological data storage, Tripal DBX and Chado integration, Materialized Views labels Apr 29, 2024
@laceysanderson laceysanderson added this to the 4.0-alpha3 milestone Apr 29, 2024
@laceysanderson
Copy link
Member Author

Ok, so this most recent commit actually finds the other linked records! However, it returns them as flat matches rather then realizing it needs to increment the delta. 🙈

[notice] Step  1 of 6: Find matching records... 

Debuggin Matches after findValues():
Match 0|contact_project|0: Array
(
    [record_id] => 2
    [entity_id] => 
    [linker_id] => 
    [link] => 2
    [project_id] => 
)
Match 1|contact_project|0: Array
(
    [record_id] => 3
    [entity_id] => 
    [linker_id] => 
    [link] => 3
    [project_id] => 
)
Match 2|contact_project|0: Array
(
    [record_id] => 2
    [entity_id] => 
    [linker_id] => 
    [link] => 2
    [project_id] => 
)
Match 3|contact_project|0: Array
(
    [record_id] => 3
    [entity_id] => 
    [linker_id] => 
    [link] => 3
    [project_id] => 
)
Match 4|contact_project|0: Array
(
    [record_id] => 1
    [entity_id] => 
    [linker_id] => 
    [link] => 1
    [project_id] => 
)

I'm not sure if I want to try to merge the matches before setting the values or if I want to find a different way to find the matches for ancillary tables... Anyway, I'm leaving it here for now as I need a break 🙈 🙉 🙊

@dsenalik dsenalik changed the title Publish is not publishing more then one linking record Publish is not publishing more than one linking record May 27, 2024
@spficklin
Copy link
Member

I'm going to close this PR out as I started over so that I could start from the beginning and wrap my brain around what was going wrong. I will have a new PR posted shortly.

@spficklin spficklin closed this May 31, 2024
@laceysanderson laceysanderson deleted the tv4g1-issue1843-fix-for-cardinality-gt-1 branch June 11, 2024 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Group 1 - Tripal Content Types | Terms | Fields Any issue relating to Tripal Content including types, terms, and fields. Group 2 - Data Storage | Tripal DBX | Chado Any issue relating to biological data storage, Tripal DBX and Chado integration, Materialized Views

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Publish is not publishing more than one item when cardinality is unlimited

4 participants