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

index constraint violation when navigation cache created

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 3.4.0, 3.4.1, 4.0.0, 4.0.1
    • Fix Version/s: 3.4.2
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      we were getting errors on the main dashboard page stating a constraint violation re: to the navigation cache:
      Database Error Code: Duplicate entry 'navigation-navigationList ' for key 'UI_group_path', 1062

      backtrace indicated the getNavigationList call was triggered from Report/Form/Instance.php

      since we do a getItems right before setItems in that function, it didn't make sense that we would have the constraint violation. my theory is that if multiple report dashlets exist on a dashboard, and the navigation cache row and dashlet content column (cache) is absent, then the dashlets load simutaneously and potentially call the function at once – creating the conflict

      anyway, my proposed solution is to wrap the getNavigationList call in Instance.php so that it is only triggered if we're using the normal report mode. we don't need to call it when the report is pulled from the dashboard. the only way i could figure out how to do that is with $_GET –

      around line 93:

      if ( CRM_Utils_Array::value('snippet', $_GET) != 4 ) {
      $parentMenu = CRM_Core_BAO_Navigation::getNavigationList( );
      }

      also note in Navigation.php, line 192:
      $cacheKeyString = "navigationList ";

      has an extra space at the end of the string which should be removed.

        Attachments

          Activity

            People

            • Assignee:
              kurund Kurund Jalmi
              Reporter:
              lcdweb Brian Shaughnessy
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: