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

Twins cannot be removed from the study report #81

Closed
therter opened this issue Jul 8, 2019 · 7 comments
Closed

Twins cannot be removed from the study report #81

therter opened this issue Jul 8, 2019 · 7 comments
Assignees
Labels
BB: Scenario Transferability Scenario Transferability Building Block bug Something isn't working

Comments

@therter
Copy link
Contributor

therter commented Jul 8, 2019

Twins, which are included in the study report cannot be removed from the report

anim

Error message from the console:

Bildschirmfoto vom 2019-07-08 19-50-03

@therter therter added the bug Something isn't working label Jul 8, 2019
@therter therter added this to the D1.4 CLARITY CSIS v2 milestone Jul 8, 2019
@patrickkaleta
Copy link
Contributor

I found the problem! As can be seen in the screenshot, for this GL-step there was a missing element in its relationsships. JSON:API checks those relationsships before performing any POST,GET or DELETE requests and threw an error, since it found no match for a UUID = "missing". Problem is that Drupal doesn't remove any references of a content element when it's deleted, which leads to the "missing" value in the relationships field.
missing-report-image-entity

This was discussed earlier but I couldn't find the corresponding issue. The solution was that we store the relationsship between GL-Step and Report image only in the Report image. The field report_images in the GL-Step should not be used anymore and can at some point be removed.

I already made the appropriate changes in the "Include in report" functionality of the CSIS_helpers module, but I think @p-a-s-c-a-l has to do so as well for the Scenario analysis component (the final REST call updating the GL-step entity has become obsolete).

@DenoBeno
Copy link

Is this a Drupal bug? If yes, please report it in drupal.org.

Also, please post a "best practice" for working with JSON:API - we may need this information in the future.

@p-a-s-c-a-l p-a-s-c-a-l reopened this Sep 26, 2019
@p-a-s-c-a-l
Copy link
Member

Cannot remove entries: exposure-twins

Additionally, I don't understand why cids GUP (solution offer / showcase) appears in this list.

@patrickkaleta
Copy link
Contributor

My first guess is that those two tables (Included & Available) are not generated properly. Looking at GL-step 1460 (HC step of study 33) shows in the Included data field just one element. So, right now the system is trying to remove things that are not even part of that step. This is the updated version of the Twins tab, so I'm asking @DenoBeno to have a look at those views.

Additionally, I don't understand why cids GUP (solution offer / showcase) appears in this list.

I assume you were in the HC step of the study? The cids GUP showcase has the Hazard characterization term assigned to it in the workflow step field, so at least that doesn't seem to be a bug.

@DenoBeno
Copy link

DenoBeno commented Sep 27, 2019

Interesting, I thought that was fixed. Will take a look at https://csis.myclimateservice.eu/study/33/step/1519/view/twins and fix it.

@DenoBeno
Copy link

DenoBeno commented Sep 30, 2019

OK, the reason was a misconfiguration of the template. Whenever a twin view is used, one MUST define the input variables as shown below.

image

If the arguments aren't defined, bad things will happen.

Update: for the new hazards twin, just the node id parameter is needed and possibly not even that.

@DenoBeno
Copy link

DenoBeno commented Oct 1, 2019

I have fixed all the "twins" views for all the templates and also for existing studies. Can we close this now?

@DenoBeno DenoBeno closed this as completed Oct 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BB: Scenario Transferability Scenario Transferability Building Block bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants