Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-17765

Dashboard does not load in Drupal 8

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 4.7
    • Fix Version/s: None
    • Labels:
    • Documentation Required?:
      Developer Doc
    • Funding Source:
      Needs Funding

      Description

      When the url /civicrm loads, the dashboard does not appear. Upon looking at the js console log, an error is returned:

      GET http://d8.expochicago.local/civicrm/ajax/dashboard?op=get_widgets_by_column&key=e874c995c0d62cbdd61263e1ef42824b 500 (Internal Server Error)

      Upon debugging that error in XDebug, the exception returned is:

      "DB Constraint Violation - possibly dashboard_id should possibly be marked as mandatory for this API. If so, please raise a bug report"

      with the following debug info:

      "INSERT INTO civicrm_dashboard_contact (dashboard_id , column_no , is_active ) VALUES ( 1 , 1 , 1 ) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`expochic_d8`.`civicrm_dashboard_contact`, CONSTRAINT `FK_civicrm_dashboard_contact_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]"

      I believe that this is because Civi is trying to insert a new row in the table: civicrm_dashboard_contact, with the values for dashboard_id, column_no & is_active. However, upon looking at the table, it has the column contact_id, which is Not Null. That column also has no default value. Since there is no value being passed on the insert, it returns a foreign key constraint error, since there is no matching contact with the id of null. I have changed it on my local to have the default value of 1 - to match the default user on civi.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                jlillyreed Jamil Lillyreed
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: