Commit 808bdcc3 authored by Nathaniel Burnett's avatar Nathaniel Burnett
Browse files

Issue #3105818 by Nathaniel: Add album link override setting. Add photos_image...

Issue #3105818 by Nathaniel: Add album link override setting. Add photos_image default list_builder.
parent 7aa82340
Loading
Loading
Loading
Loading
+3 −0
Changes for config/schema/photos.schema.yml: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -4,6 +4,9 @@ photos.settings:
  type: config_object
  label: 'Photos settings'
  mapping:
    album_link_override:
      type: string
      label: 'Override default album link with a view.'
    multi_upload_default_field:
      type: string
      label: 'Multi-upload field.'
+1 −0
Changes for photos.install: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -174,6 +174,7 @@ function photos_update_8501(&$sandbox) {
        ],
        "access" => "Drupal\photos\PhotosAccessControlHandler",
        "views_data" => "Drupal\photos\PhotosViewsData",
        "list_builder" => "Drupal\photos\PhotosImageListBuilder",
        "route_provider" => [
          "html" => "Drupal\photos\Entity\PhotosRouteProvider",
        ],
+1 −3
Changes for photos.module: 1 added line, 3 removed lines.
Original line number Diff line number Diff line
@@ -1067,9 +1067,7 @@ function photos_preprocess_photos_image_block(&$variables) {
      }
    }
  }
  $variables['album_url'] = Url::fromRoute('entity.node.canonical', [
    'node' => $photosImage->getAlbumId(),
  ])->toString();
  $variables['album_url'] = $photosImage->getAlbumUrl()->toString();
}

/**
+1 −1
Changes for photos_access/photos_access.module: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -1105,7 +1105,7 @@ function photos_access_pass_validate($t) {
      // Redirect.
      $current_path = \Drupal::service('path.current')->getPath();
      if ($current_path == '/system/files') {
        // If current path is /system/files redirect to album.
        // If current path is /system/files redirect to photo album node.
        $current_path = Url::fromRoute('entity.node.canonical', ['node' => $t['view']->nid])->toString();
      }
      $redirect_url = Url::fromUri('base:privacy/pass/' . $t['view']->nid, [
+1 −1
Changes for src/Controller/PhotosAlbumController.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -174,7 +174,7 @@ class PhotosAlbumController extends ControllerBase {
   *   A render array.
   */
  public function albumView() {
    // @todo deprecate this in favor of default view.
    // @todo move to theme function and deprecate this in favor of default view.
    $config = $this->config('photos.settings');
    // Get node object.
    $album = [];
Loading