Commit 1591bb78 authored by Taras Kruts's avatar Taras Kruts
Browse files

Issue #3392159: Data Policy Agreement results in a fatal error if no data policy created

parent 5b0a146e
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -344,7 +344,9 @@ class DataPolicy extends ControllerBase implements ContainerInjectionInterface {
   *   of data policy.
   */
  public function agreementAccess() {
    if ($this->dataPolicyConsentManager->needConsent()) {
    $entity_ids = $this->dataPolicyConsentManager->getEntityIdsFromConsentText();
    $revisions = $this->dataPolicyConsentManager->getRevisionsByEntityIds($entity_ids);
    if ($revisions && $this->dataPolicyConsentManager->needConsent()) {
      return AccessResult::allowed();
    }