EASOL / easol

EASOL - A New Way to Open Learning with Ed-Tech
http://easol.org
GNU Affero General Public License v3.0
1 stars 4 forks source link

Dashboard - Error occurs when selected dashboard report is deleted #268

Closed jasonhoekstra closed 8 years ago

jasonhoekstra commented 8 years ago

An error occurs in the dashboard when:

1.) An existing Flex Report is selected for a user role 2.) That Flex Report is deleted 3.) The dashboard is displayed again with the deleted Flex Report (error occurs)

edgarf commented 8 years ago

@regiscamimura, let's review this issue after we finish with main functionality implementation.

regiscamimura commented 8 years ago

@edgarf @jasonhoekstra We now have changed the rules for report access, all users can see a chart in the dashboard and into its details page. Should we just remove the "Access" section from the add/edit flex report form?

Regarding the deletion, I'm surprised that you actually can delete a report when it is assigned to the dashboard. A FK should be blocking that attempt, not sure how you pass through it. Can you please confirm you actually can delete a flex report that is already related to the dashboard?

edgarf commented 8 years ago

@regiscamimura - we have only provided ability to see details of the chart report. The Access rules haven't changed since then - those can still be applied. Does it make sense?

regiscamimura commented 8 years ago

@edgarf I got the code and database improved. There's a new SQL script that handles the proper foreign keys creation as some triggers to avoid invalid data in the database. Had to use triggers because MSSQL won't allow ON DELETE CASCADE on multiple FKs to the same table FYI.

The SQL script is at ./sql/mssql/incremental/268-dashboard-configuration-report-constraint-cascade-rules.sql

edgarf commented 8 years ago

@regiscamimura, when I try running the SQL query you added I get this error:

Msg 111, Level 15, State 1.
'CREATE TRIGGER' must be the first statement in a query batch. (Line 61)
regiscamimura commented 8 years ago

@edgarf Just adjusted the script so the trigger is the first command. That should solve the error.