<Solved> Fehler Random Photo in der Übersicht nach update auf 4.1.7

Hast du einen Fehler in der aktuellen Version gefunden ? Diesen kannst du uns hier mitteilen und uns bei der Fehlersuche helfen.
Antworten
Blackgate
Beiträge: 9
Registriert: 17. Nov 2019, 18:55

<Solved> Fehler Random Photo in der Übersicht nach update auf 4.1.7

Beitrag von Blackgate »

Hallo Zusammen,

in der Standard Übersicht/Dashboard wird kein Random Photo aus dem Photoalbum angezeigt, anstelle wird das nopix Bild angezeigt.
Ich habe auch schon ein neues Album angelegt und das alte gelöscht, hilft leider auch nicht. Lade ich die photo_show.php vom backup, wird das Bild in der Übersicht wieder angezeigt, aber danach die Bilder im Album nicht mehr.

Anbei der diff von den Files

6c6
< * @copyright 2004-2022 The Admidio Team
---
> * @copyright 2004-2021 The Admidio Team
15,22c15,20
< * photo_uuid : UUID of the album from which the image should be shown
< * photo_nr : Number of the image to be displayed
< * max_width : maximum width to which the image can be scaled,
< * if not set, the default size is taken
< * max_height : maximum height to which the image can be scaled,
< * if not set, the default size is taken
< * thumb : If is set to true a thumbnail in the size of the default
< * size is returned
---
> * pho_id : Id des Albums, aus dem das Bild kommen soll
> * photo_nr : Nummer des Bildes, das angezeigt werden soll
> * max_width : maximale Breite auf die das Bild skaliert werden kann
> * max_height: maximale Hoehe auf die das Bild skaliert werden kann
> * thumb : ist thumb === true wird ein Thumbnail in der Größe der
> * Voreinstellung zurückgegeben
29,31c27,29
< $getPhotoUuid = admFuncVariableIsValid($_GET, 'photo_uuid', 'string');
< $getPhotoNr = admFuncVariableIsValid($_GET, 'photo_nr', 'int');
< $getMaxWidth = admFuncVariableIsValid($_GET, 'max_width', 'int', array('defaultValue' => 0));
---
> $getPhotoId = admFuncVariableIsValid($_GET, 'pho_id', 'int', array('requireValue' => true));
> $getPhotoNr = admFuncVariableIsValid($_GET, 'photo_nr', 'int');
> $getMaxWidth = admFuncVariableIsValid($_GET, 'max_width', 'int', array('defaultValue' => 0));
33c31
< $getThumbnail = admFuncVariableIsValid($_GET, 'thumb', 'bool');
---
> $getThumbnail = admFuncVariableIsValid($_GET, 'thumb', 'bool');
35d32
> {
39,41c37,41
< // => EXIT
< } elseif ((int) $gSettingsManager->get('enable_photo_module') === 2) {
< // only logged in users can access the module
---
> // => EXIT
> }
> elseif ((int) $gSettingsManager->get('enable_photo_module') === 2)
> {
> // nur eingeloggte Benutzer duerfen auf das Modul zugreifen
44a45,47
> // lokale Variablen initialisieren
> $image = null;
>
46c49,50
< if (isset($_SESSION['photo_album']) && (int) $_SESSION['photo_album']->getValue('pho_uuid') === $getPhotoUuid) {
---
> if (isset($_SESSION['photo_album']) && (int) $_SESSION['photo_album']->getValue('pho_id') === $getPhotoId)
> {
48,50c52,55
< } else {
< $photoAlbum = new TablePhotos($gDb);
< $photoAlbum->readDataByUuid($getPhotoUuid);
---
> }
> else
> {
> $photoAlbum = new TablePhotos($gDb, $getPhotoId);
55c60,61
< if (!$photoAlbum->isVisible()) {
---
> if(!$photoAlbum->isVisible())
> {
60,61c66,67
< // compose image path
< $albumFolder = ADMIDIO_PATH . FOLDER_DATA . '/photos/' . $photoAlbum->getValue('pho_begin', 'Y-m-d') . '_' . $photoAlbum->getValue('pho_id');
---
> // Bildpfad zusammensetzten
> $albumFolder = ADMIDIO_PATH . FOLDER_DATA . '/photos/' . $photoAlbum->getValue('pho_begin', 'Y-m-d') . '_' . $getPhotoId;
65c71
< // output the determined image path in debug mode
---
> // im Debug-Modus den ermittelten Bildpfad ausgeben
68,69c74,77
< if ($getThumbnail) {
< if ($getPhotoNr > 0) {
---
> if ($getThumbnail)
> {
> if ($getPhotoNr > 0)
> {
72,73c80,82
< // If thumbnail exists detect longer page
< if (is_file($picThumbPath)) {
---
> // Wenn Thumbnail existiert laengere Seite ermitteln
> if (is_file($picThumbPath))
> {
75c84,85
< if (is_array($imageProperties)) {
---
> if (is_array($imageProperties))
> {
80,82c90,95
< // Check whether the image is stored as a thumbnail in the appropriate size, if not, create it.
< if (!is_file($picThumbPath) || $thumbLength !== $gSettingsManager->getInt('photo_thumbs_scale')) {
< try {
---
> // Nachsehen ob Bild als Thumbnail in entsprechender Groesse hinterlegt ist
> // Wenn nicht anlegen
> if (!is_file($picThumbPath) || $thumbLength !== $gSettingsManager->getInt('photo_thumbs_scale'))
> {
> try
> {
85c98,100
< } catch (\RuntimeException $exception) {
---
> }
> catch (\RuntimeException $exception)
> {
90c105
< // now create thumbnail
---
> // nun das Thumbnail anlegen
94c109,111
< } else {
---
> }
> else
> {
98,99c115,118
< } else {
< // if no image was passed, then display NoPix
---
> }
> else
> {
> // kein Bild uebergeben, dann NoPix anzeigen
103,104c122,126
< } else {
< if (!is_file($picPath)) {
---
> }
> else
> {
> if (!is_file($picPath))
> {
110c132,133
< if ($getMaxWidth > 0 || $getMaxHeight > 0) {
---
> if($getMaxWidth > 0 || $getMaxHeight > 0)
> {
112c135,137
< } else {
---
> }
> else
> {
118c143,144
< if ($image !== null) {
---
> if ($image !== null)
> {
120,121c146,149
< if (($getMaxWidth > 200) && $gSettingsManager->getString('photo_image_text') !== '') {
< if ($gSettingsManager->getInt('photo_image_text_size') > 0) {
---
> if (($getMaxWidth > 200) && $gSettingsManager->getString('photo_image_text') !== '')
> {
> if ($gSettingsManager->getInt('photo_image_text_size') > 0)
> {
123c151,153
< } else {
---
> }
> else
> {
133c163,164
< if (strlen($photoAlbum->getValue('pho_photographers')) > 0) {
---
> if(strlen($photoAlbum->getValue('pho_photographers')) > 0)
> {
135c166,168
< } else {
---
> }
> else
> {
142c175
< // Return of the new image
---
> // Rueckgabe des neuen Bildes



<
37c34,35
< if ((int) $gSettingsManager->get('enable_photo_module') === 0) {
---
> if ((int) $gSettingsManager->get('enable_photo_module') === 0)


Hat jemand das gleiche Problem oder sieht gerade den Fehler?

Thx
Zuletzt geändert von Blackgate am 8. Mär 2022, 18:57, insgesamt 1-mal geändert.
Benutzeravatar
fasse
Administrator
Beiträge: 6044
Registriert: 12. Nov 2005, 16:06

Re: Fehler Random Photo in der Übersicht nach update auf 4.1.7

Beitrag von fasse »

Hallo Blackgate,

hast du diese beiden Dateien auch aktualisiert:
adm_plugins/random_photo/random_photo.php
adm_program/modules/photos/photo_show.php

Diese beiden Dateien wurden in der 4.1.7 angepasst und müssen beide "neu" sein.

Gruß
Fasse
Blackgate
Beiträge: 9
Registriert: 17. Nov 2019, 18:55

Re: Fehler Random Photo in der Übersicht nach update auf 4.1.7

Beitrag von Blackgate »

Hallo Fasse,

das Plugin war noch veraltet, nach dem Update funktioniert es perfekt.

Vielen lieben Dank für die schnelle Hilfe! :)

Gruss Blackgate
Antworten