Skip to content

Commit 9180a34

Browse files
authored
Merge pull request #354 from FitzwilliamMuseum/issue353-env-missing-image-key
Change env key. This closes #353
2 parents 53f1e0b + 30cc3af commit 9180a34

File tree

88 files changed

+1063
-993
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+1063
-993
lines changed

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,5 @@ SHOPIFY_FITZ_PRINTS_SECRET=
8181
SHOPIFY_FITZ_PRINTS_URL=
8282
SHOPIFY_FITZ_PRINTS_PROTOCOL=
8383
SHOPIFY_FITZ_PRINTS_CATALOGUE='/products/'
84+
85+
MISSING_IMAGE_URL="https://content.fitz.ms/fitz-website/assets/gallery3_roof.jpg?key=exhibition"

app/Http/Controllers/aboutusController.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ public function vacancies(): View
6161
}
6262

6363
/**
64-
* Returns a list of vacancies
64+
* Returns a list of archived vacancies
65+
* @param Request $request
6566
* @return View
6667
*/
6768
public function archiveVacancies(Request $request): View
@@ -153,12 +154,20 @@ public function hockneyTerms(): View
153154
return view('aboutus.hockney', compact('terms'));
154155
}
155156

157+
/**
158+
* @param Request $request
159+
* @return View
160+
*/
156161
public function spoliation(Request $request): View
157162
{
158163
$claims = SpoliationClaims::list($request );
159164
return view('aboutus.spoliation', compact('claims'));
160165
}
161166

167+
/**
168+
* @param string $priref
169+
* @return View
170+
*/
162171
public function spoliationClaim(string $priref): View
163172
{
164173
$claims = SpoliationClaims::find($priref);

app/Http/Controllers/exhibitionsController.php

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ public static function injectLoanImmunity(): array
4747
*/
4848
public function index(): View
4949
{
50-
$pages = Stubs::getLanding('exhibitions');
51-
$current = Exhibitions::list();
50+
$pages = Stubs::getLanding('exhibitions');
51+
$current = Exhibitions::list();
5252
$displays = Exhibitions::list('current', '-ticketed', 'display');
53-
$future = Exhibitions::listFuture();
54-
$archive = Exhibitions::archive('archived', '-exhibition_end_date', 3);
53+
$future = Exhibitions::listFuture();
54+
$archive = Exhibitions::archive('archived', '-exhibition_end_date', 3);
5555
return view('exhibitions.index', compact(
5656
'current', 'pages', 'archive',
5757
'future', 'displays'
@@ -177,19 +177,21 @@ public function ttnArtist(string $slug): View
177177
*/
178178
public function ttnLabels(): View
179179
{
180-
$one = TtnLabels::listByTheme(1)['data'];
181-
$two = TtnLabels::listByTheme(2)['data'];
182-
$three = TtnLabels::listByTheme(3)['data'];
183-
$four = TtnLabels::listByTheme(4)['data'];
184-
$five = TtnLabels::listByTheme(5)['data'];
185-
$six = TtnLabels::listByTheme(6)['data'];
186-
$seven = TtnLabels::listByTheme(7)['data'];
187-
$eight = TtnLabels::listByTheme(8)['data'];
188-
$nine = TtnLabels::listByTheme(9)['data'];
189-
$ten = TtnLabels::listByTheme(10)['data'];
180+
$sectionOne = TtnLabels::listByTheme(1)['data'];
181+
$sectionTwo = TtnLabels::listByTheme(2)['data'];
182+
$sectionThree = TtnLabels::listByTheme(3)['data'];
183+
$sectionFour = TtnLabels::listByTheme(4)['data'];
184+
$sectionFive = TtnLabels::listByTheme(5)['data'];
185+
$sectionSix = TtnLabels::listByTheme(6)['data'];
186+
$sectionSeven = TtnLabels::listByTheme(7)['data'];
187+
$sectionEight = TtnLabels::listByTheme(8)['data'];
188+
$sectionNine = TtnLabels::listByTheme(9)['data'];
189+
$sectionTen = TtnLabels::listByTheme(10)['data'];
190190
return view('exhibitions.ttn-labels', compact(
191-
'one', 'two', 'three',
192-
'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten'
191+
'sectionOne', 'sectionTwo', 'sectionThree',
192+
'sectionFour', 'sectionFive', 'sectionSix',
193+
'sectionSeven', 'sectionEight', 'sectionNine',
194+
'sectionTen'
193195
));
194196
}
195197

@@ -283,31 +285,31 @@ public function linkedPasts()
283285
foreach ($labels as $label) {
284286
$feature = array(
285287
"type" => "Feature",
286-
"@id" => route('exhibition.ttn.label', $label['slug']),
288+
"@id" => route('exhibition.ttn.label', $label['slug']),
287289
'properties' => array(
288290
'title' => $label['title'] . ' - ' . $label['artist']['display_name'],
289291
'artist' => $label['artist']['display_name'] ?? 'Not known',
290292
'slug' => $label['slug'],
291-
'birth' => trim(preg_replace('/\t+/', '',$label['artist']['place_of_birth'])),
292-
'death' => trim(preg_replace('/\t+/', '',$label['artist']['place_of_death'])),
293+
'birth' => trim(preg_replace('/\t+/', '', $label['artist']['place_of_birth'])),
294+
'death' => trim(preg_replace('/\t+/', '', $label['artist']['place_of_death'])),
293295
'theme' => $label['theme']['theme_name'],
294296
'institution' => $label['institution'],
295297
'media' => $label['media']
296-
),
298+
),
297299
'descriptions' => array(
298300
array(
299301
'value' => $label['artist']['biography']
300302
)
301303
),
302304
'depictions' => array(
303305
array(
304-
'license' => 'cc:by-sa/3.0/',
305-
'thumbnail' => $label ['image']['data']['url'],
306-
'@id' => $label ['image']['data']['url']
306+
'license' => 'cc:by-sa/3.0/',
307+
'thumbnail' => $label ['image']['data']['url'],
308+
'@id' => $label ['image']['data']['url']
307309
)
308310
),
309311
'geometry' => array(
310-
"type" => "Point",
312+
"type" => "Point",
311313
"coordinates" => array(
312314
$label['lng'], $label['lat']
313315
),
@@ -354,20 +356,20 @@ public function linkedPastsBirths()
354356
foreach ($labels as $label) {
355357
$feature = array(
356358
"type" => "Feature",
357-
"@id" => route('exhibition.ttn.artist', $label['slug']),
359+
"@id" => route('exhibition.ttn.artist', $label['slug']),
358360
'properties' => array(
359361
'title' => $label['display_name'] ?? 'Not known',
360362
'slug' => $label['slug'],
361363
),
362364
'depictions' => array(
363-
array(
365+
array(
364366
'license' => 'cc:by-sa/3.0/',
365367
'thumbnail' => $label['image']['data']['url'] ?? '',
366368
'@id' => $label ['image']['data']['url'] ?? ''
367369
),
368370
),
369371
'geometry' => array(
370-
"type" => "Point",
372+
"type" => "Point",
371373
"coordinates" => array(
372374
$label['birth_lon'], $label['birth_lat']
373375
),
@@ -413,7 +415,7 @@ public function linkedPastsDeaths()
413415
foreach ($labels as $label) {
414416
$feature = array(
415417
"type" => "Feature",
416-
"@id" => route('exhibition.ttn.artist', $label['slug']),
418+
"@id" => route('exhibition.ttn.artist', $label['slug']),
417419
'properties' => array(
418420
'title' => $label['display_name'] ?? 'Not known',
419421
'slug' => $label['slug']
@@ -426,7 +428,7 @@ public function linkedPastsDeaths()
426428
),
427429
),
428430
'geometry' => array(
429-
"type" => "Point",
431+
"type" => "Point",
430432
"coordinates" => array(
431433
$label['death_lon'], $label['death_lat']
432434
),
@@ -438,6 +440,7 @@ public function linkedPastsDeaths()
438440
}
439441
return response()->json($geoJson);
440442
}
443+
441444
/**
442445
* @return View
443446
*/

app/Http/Kernel.php

Lines changed: 60 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,57 @@
22

33
namespace App\Http;
44

5+
use App\Http\Middleware\Authenticate;
6+
use App\Http\Middleware\CheckForMaintenanceMode;
7+
use App\Http\Middleware\EncryptCookies;
8+
use App\Http\Middleware\RedirectIfAuthenticated;
9+
use App\Http\Middleware\SecureHeaders;
10+
use App\Http\Middleware\SecureHeadersMiddleware;
11+
use App\Http\Middleware\TrimStrings;
12+
use App\Http\Middleware\VerifyCsrfToken;
13+
use App\Http\Middleware\XFrameHeadersMiddleware;
14+
use App\Http\Middleware\XssClean;
15+
use Fruitcake\Cors\HandleCors;
16+
use Illuminate\Auth\Middleware\AuthenticateWithBasicAuth;
17+
use Illuminate\Auth\Middleware\Authorize;
18+
use Illuminate\Auth\Middleware\EnsureEmailIsVerified;
19+
use Illuminate\Auth\Middleware\RequirePassword;
20+
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
521
use Illuminate\Foundation\Http\Kernel as HttpKernel;
22+
use Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull;
23+
use Illuminate\Foundation\Http\Middleware\ValidatePostSize;
24+
use Illuminate\Http\Middleware\SetCacheHeaders;
25+
use Illuminate\Routing\Middleware\SubstituteBindings;
26+
use Illuminate\Routing\Middleware\ThrottleRequests;
27+
use Illuminate\Routing\Middleware\ValidateSignature;
28+
use Illuminate\Session\Middleware\StartSession;
29+
use Illuminate\View\Middleware\ShareErrorsFromSession;
30+
use Spatie\GoogleTagManager\GoogleTagManagerMiddleware;
31+
use Spatie\MissingPageRedirector\RedirectsMissingPages;
32+
use Spatie\ResponseCache\Middlewares\CacheResponse;
33+
use Spatie\ResponseCache\Middlewares\DoNotCacheResponse;
634

735
class Kernel extends HttpKernel
836
{
937
/**
1038
* The application's global HTTP middleware stack.
1139
*
12-
* These middleware are run during every request to your application.
40+
* Middleware are run during every request to your application.
1341
*
1442
* @var array
1543
*/
1644
protected $middleware = [
17-
\Fruitcake\Cors\HandleCors::class,
18-
\App\Http\Middleware\CheckForMaintenanceMode::class,
19-
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
20-
\App\Http\Middleware\TrimStrings::class,
21-
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
22-
\App\Http\Middleware\SecureHeaders::class,
23-
\Spatie\MissingPageRedirector\RedirectsMissingPages::class,
24-
\App\Http\Middleware\XssClean::class, //Add Middleware XSS
25-
\Spatie\GoogleTagManager\GoogleTagManagerMiddleware::class,
26-
\App\Http\Middleware\XFrameHeadersMiddleware::class,
27-
\App\Http\Middleware\SecureHeadersMiddleware::class,
45+
HandleCors::class,
46+
CheckForMaintenanceMode::class,
47+
ValidatePostSize::class,
48+
TrimStrings::class,
49+
ConvertEmptyStringsToNull::class,
50+
SecureHeaders::class,
51+
RedirectsMissingPages::class,
52+
XssClean::class, //Add Middleware XSS
53+
GoogleTagManagerMiddleware::class,
54+
XFrameHeadersMiddleware::class,
55+
SecureHeadersMiddleware::class,
2856

2957
];
3058

@@ -35,40 +63,40 @@ class Kernel extends HttpKernel
3563
*/
3664
protected $middlewareGroups = [
3765
'web' => [
38-
\App\Http\Middleware\EncryptCookies::class,
39-
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
40-
\Illuminate\Session\Middleware\StartSession::class,
66+
EncryptCookies::class,
67+
AddQueuedCookiesToResponse::class,
68+
StartSession::class,
4169
// \Illuminate\Session\Middleware\AuthenticateSession::class,
42-
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
43-
\App\Http\Middleware\VerifyCsrfToken::class,
44-
\Illuminate\Routing\Middleware\SubstituteBindings::class,
45-
\Spatie\ResponseCache\Middlewares\CacheResponse::class,
70+
ShareErrorsFromSession::class,
71+
VerifyCsrfToken::class,
72+
SubstituteBindings::class,
73+
CacheResponse::class,
4674
],
4775

4876
'api' => [
4977
'throttle:60,1',
50-
\Illuminate\Routing\Middleware\SubstituteBindings::class,
78+
SubstituteBindings::class,
5179
],
5280
];
5381

5482
/**
5583
* The application's route middleware.
5684
*
57-
* These middleware may be assigned to groups or used individually.
85+
* Middleware may be assigned to a group(2) or used individually.
5886
*
5987
* @var array
6088
*/
6189
protected $routeMiddleware = [
62-
'auth' => \App\Http\Middleware\Authenticate::class,
63-
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
64-
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
65-
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
66-
'can' => \Illuminate\Auth\Middleware\Authorize::class,
67-
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
68-
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
69-
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
70-
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
71-
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
72-
'doNotCacheResponse' => \Spatie\ResponseCache\Middlewares\DoNotCacheResponse::class,
90+
'auth' => Authenticate::class,
91+
'auth.basic' => AuthenticateWithBasicAuth::class,
92+
'bindings' => SubstituteBindings::class,
93+
'cache.headers' => SetCacheHeaders::class,
94+
'can' => Authorize::class,
95+
'guest' => RedirectIfAuthenticated::class,
96+
'password.confirm' => RequirePassword::class,
97+
'signed' => ValidateSignature::class,
98+
'throttle' => ThrottleRequests::class,
99+
'verified' => EnsureEmailIsVerified::class,
100+
'doNotCacheResponse' => DoNotCacheResponse::class,
73101
];
74102
}

app/Models/AssociatedPeople.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
class AssociatedPeople extends Model
88
{
99
/**
10+
* @param string $filters
1011
* @return array
1112
*/
1213
public static function list(string $filters = 'podcastGuest'): array

app/Models/Exhibitions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public static function loanImmunity(): array
152152
}
153153

154154
/**
155-
* @param int $slug
155+
* @param int $curator
156156
* @return array
157157
*/
158158
public static function findByExternals(int $curator): array

0 commit comments

Comments
 (0)