|
@@ -108,7 +108,7 @@ discard block |
|
|
block discarded – undo |
|
108
|
108
|
public function toArray(): array |
|
109
|
109
|
{ |
|
110
|
110
|
$cachekey = $this->getCacheKey(); |
|
111
|
|
- if (! $this->hasCacheKey($cachekey) || $this->noCache) { |
|
|
111
|
+ if (!$this->hasCacheKey($cachekey) || $this->noCache) { |
|
112
|
112
|
$this->collateIntel(); |
|
113
|
113
|
if ($this->debug) { |
|
114
|
114
|
if ($this->intel['ErrorHasAnyError']) { |
|
@@ -238,7 +238,7 @@ discard block |
|
|
block discarded – undo |
|
238
|
238
|
} else { |
|
239
|
239
|
$this->intel['ImageRatio'] = 0; |
|
240
|
240
|
} |
|
241
|
|
- $this->intel['ImagePixels'] = $this->intel['ImageHeight'] * $this->intel['ImageWidth']; |
|
|
241
|
+ $this->intel['ImagePixels'] = $this->intel['ImageHeight'] * $this->intel['ImageWidth']; |
|
242
|
242
|
$this->intel['IsResizedImage'] = (bool) strpos($this->intel['PathFileName'], '__'); |
|
243
|
243
|
} |
|
244
|
244
|
} |
|
@@ -247,7 +247,7 @@ discard block |
|
|
block discarded – undo |
|
247
|
247
|
protected function addFolderDetails($dbFileData) |
|
248
|
248
|
{ |
|
249
|
249
|
$folder = []; |
|
250
|
|
- if (! empty($dbFileData['ParentID'])) { |
|
|
250
|
+ if (!empty($dbFileData['ParentID'])) { |
|
251
|
251
|
$sql = 'SELECT ID FROM "File" WHERE "ID" = ' . $dbFileData['ParentID'] . ' LIMIT 1'; |
|
252
|
252
|
$rows = DB::query($sql); |
|
253
|
253
|
foreach ($rows as $folder) { |
|
@@ -261,7 +261,7 @@ discard block |
|
|
block discarded – undo |
|
261
|
261
|
$this->intel['FolderID'] = $folder['ID']; |
|
262
|
262
|
$this->intel['FolderCMSEditLink'] = '/admin/assets/show/' . $this->intel['FolderID'] . '/'; |
|
263
|
263
|
} else { |
|
264
|
|
- $this->intel['ErrorFindingFolder'] = ! empty($dbFileData['ParentID']); |
|
|
264
|
+ $this->intel['ErrorFindingFolder'] = !empty($dbFileData['ParentID']); |
|
265
|
265
|
$this->intel['FolderID'] = 0; |
|
266
|
266
|
$this->intel['FolderCMSEditLink'] = '/admin/assets'; |
|
267
|
267
|
} |
|
@@ -305,14 +305,14 @@ discard block |
|
|
block discarded – undo |
|
305
|
305
|
$this->intel['DBFilename'] = $dbFileData['Name'] ?: basename($this->intel['DBPath']); |
|
306
|
306
|
$existsOnStaging = $obj->existsOnStaging($this->intel['DBID']); |
|
307
|
307
|
$existsOnLive = $obj->existsOnLive($this->intel['DBID']); |
|
308
|
|
- $this->intel['ErrorDBNotPresentStaging'] = ! $existsOnStaging; |
|
309
|
|
- $this->intel['ErrorDBNotPresentLive'] = ! $existsOnLive; |
|
310
|
|
- $this->intel['ErrorInDraftOnly'] = $existsOnStaging && ! $existsOnLive; |
|
311
|
|
- $this->intel['ErrorNotInDraft'] = ! $existsOnStaging && $existsOnLive; |
|
|
308
|
+ $this->intel['ErrorDBNotPresentStaging'] = !$existsOnStaging; |
|
|
309
|
+ $this->intel['ErrorDBNotPresentLive'] = !$existsOnLive; |
|
|
310
|
+ $this->intel['ErrorInDraftOnly'] = $existsOnStaging && !$existsOnLive; |
|
|
311
|
+ $this->intel['ErrorNotInDraft'] = !$existsOnStaging && $existsOnLive; |
|
312
|
312
|
$this->intel['DBCMSEditLink'] = '/admin/assets/EditForm/field/File/item/' . $this->intel['DBID'] . '/edit'; |
|
313
|
313
|
$this->intel['DBTitle'] = $dbFileData['Title']; |
|
314
|
314
|
$this->intel['DBFilenameSS4'] = $dbFileData['FileFilename'] ?? 'none'; |
|
315
|
|
- $this->intel['DBFilenameSS3'] = $dbFileData['Filename'] ?? 'none';; |
|
|
315
|
+ $this->intel['DBFilenameSS3'] = $dbFileData['Filename'] ?? 'none'; ; |
|
316
|
316
|
$this->intel['ErrorInFilename'] = $this->intel['Path'] !== $this->intel['DBPath']; |
|
317
|
317
|
$ss3FileName = $dbFileData['Filename'] ?? ''; |
|
318
|
318
|
if ('assets/' === substr((string) $ss3FileName, 0, strlen('assets/'))) { |