solgenomics / sgn

The code behind the Sol Genomics Network, Cassavabase and other Breedbase websites
https://solgenomics.net
MIT License
67 stars 35 forks source link

Newly added editable stock props break search output display #3284

Open bauchetg opened 3 years ago

bauchetg commented 3 years ago

Expected Behavior

For Bugs:

After adding new props to editable_stock_props in conf file, when I try to add them to search output display I get a datatable warning and a log error, ex:

$VAR_DUMP1 = [ 'market_type' ]; [error] CXGN::Stock::Search::_refresh_materialized_stockprop(): DBI Exception: DBD::Pg::db do failed: ERROR: must be owner of extension tablefunc at lib/CXGN/Stock/Search.pm line 659 Something to do with refresh_materialized_stockprop(\@stockprop_view) Is this related with some web usr permissions? Do I need to re-run a specific dbpatch after adding editable props?

Newly added editable stock props would show correctly on the associated accession page, no problem here.

Screen Shot 2021-01-20 at 3 58 39 PM

This was previously described in #3105 #3106 and addressed in #3129. I am on tag 290.0

Environment

Steps to Reproduce

lukasmueller commented 3 years ago

The dbpatch needs to be run and the views need to be updated. To refresh the views, go into psql and type:

refresh materialized view materialized_stockprops;
lukasmueller commented 3 years ago

The issue was that the Search attempts to update the stocks materialized view but does not include the 'editable_stock_props' in the process, and the process breaks. I have added another parameter to the CXGN::Stock::Search project called 'editable_stock_props' that can be used to feed additional stock props (usually by calling $c->config->{editable_stock_props} into the object. The object will then combined default hard coded props with the custom props and regenerate the materialized view based on that list. The branch is /topic/fix_stock_props_search

lukasmueller commented 3 years ago

There is a pretty severe issue with the stock props search. The stock prop search uses a materialized view of stockprops that is checked against the cv called stock_properties, factually not allowing any props that are not in stock_properties cv to be in the materialized view. It stores the cvterm_id of each stock prop in the materialized view.

Maybe the cvterm_id should be changed to the prop name? Not sure what happens with the cvterm_id downstream though.

lukasmueller commented 3 years ago

Maybe it is easier to add the custom stockprops to the database?

bauchetg commented 2 years ago

The error remains shall I switch existing stockprops as suggested? Or is there some changes since?

ch728 commented 1 year ago

Just commenting to bump this issue up. It would be really useful to be able to search accessions by editable stock prop.

lukasmueller commented 1 year ago

Noted! This is an important issue. Need to bump up!


From: Chris Hernandez @.> Sent: Thursday, December 15, 2022 7:39 AM To: solgenomics/sgn @.> Cc: Lukas A. Mueller @.>; Assign @.> Subject: Re: [solgenomics/sgn] Newly added editable stock props break search output display (#3284)

Just commenting to bump this issue up. It would be really useful to be able to search accessions by editable stock prop.

— Reply to this email directly, view it on GitHubhttps://github.com/solgenomics/sgn/issues/3284#issuecomment-1353000803, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAAV7F3RIM7DXHPXKB4RS7TWNMGOJANCNFSM4WK2VCHQ. You are receiving this because you were assigned.Message ID: @.***>