Author Topic: E_Notice in dlc.php der download-gallery 2.86  (Read 464 times)

Offline bbs2

  • Posts: 59
E_Notice in dlc.php der download-gallery 2.86
« on: February 22, 2019, 08:58:38 AM »
Hallo,

vereinzelt tritt lt. php-error-log folgener Fehler auf

Thu, 21 Feb 2019 21:52:48 +0000 [E_NOTICE] /modules/download_gallery/dlc.php:[60]  from /modules/download_gallery/dlc.php:[60] bin\Exceptions\ErrorHandler::handler "Undefined variable: iFileId"

Hier der code:

Code: [Select]
if (!$iProve || !$iFileId) {
        $sErrMsg = 'invalid arguments';
        goto REQUEST_ERR;
    }

Ich habe alle download-Positionen getestet, ohne Fehler. Lediglich die php-error-log zeigt diese e_notice.

Hat jemand eine Idee.

Viele Grüße

Heinz
« Last Edit: February 22, 2019, 09:38:32 AM by dbs »

Offline dbs

  • Betatester
  • **
  • Posts: 7920
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: E_Notice in dlc.php der download-gallery 2.86
« Reply #1 on: February 22, 2019, 09:37:52 AM »
Hallo Heinz, bitte benutze für Code den # - Button.
Es wäre für die Helfer immer gut zu wissen welche WB-, PHP- und Modul-Version du einsetzt.

Offline jacobi22

  • Posts: 5836
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: E_Notice in dlc.php der download-gallery 2.86
« Reply #2 on: February 22, 2019, 11:11:02 AM »
Diese Notice seh ich des Öfteren bei Kunden oder Usern. Im Normalfall schaut solch Link so aus

https://mydomain/modules/download_gallery/dlc.php?file=70&id=1547383785

Im Normalfall kommt der Code garnicht bis zu dieser Stelle, wenn Parameter fehlen würden. Er würde vorher aussteigen und zur Startseite leiten

bis Vers 2.86 an dieser Stelle
Code: [Select]
    $iProve  = intval(isset($_GET['id']) ? $_GET['id'] : 0);

    if(!isset($_GET['file']) || !is_numeric($_GET['file'])) {
        header('Location: ../index.php');
    } else {
        $iFileId = $_GET['file'];
    }
    if (!$iProve || !$iFileId) {
        $sErrMsg = 'invalid arguments';
        goto REQUEST_ERR;
    }

Mal davon abgesehen, das hier der Pfad zur Rückleitungs-Adresse mit Ziel = Startseite falsch ist, kann der Code hier nur zur zitierten Zeile kommen, wenn dieses header('Location:...); nicht erfolgt, z.b. weil es von mod_secure unterbunden wird. Auf "deutsch": es hat jemand versucht, die Datei dlc.php ohne den Parameter file aufzurufen. Das ist, nebenbei gesagt, ein durchaus üblicher Versuch, alle Downloads mit einem Schwung herunter zu laden. Ursache kann aber auch ein defekter Link irgendwo sein, z.b. in einer Suchmaschine, in einem Forum oer Chat, wo man ihn mal gepostet hat usw. In den Projekten, wo ich Zugang habe, kann ich zumindest bestätigen, das solch Aufruf nicht durch einen internen Link geschehen ist, es muß also wer von außen probiert haben. Die access-log sollte hier Aufschluß geben können.

Ab den 3er Versionen ist dieser Code geändert. Die aktuellste Version bekommst du hier
Probleme sind da, um sie zu lösen, nicht, um nach Ausreden zu suchen.

Offline bbs2

  • Posts: 59
Re: E_Notice in dlc.php der download-gallery 2.86
« Reply #3 on: February 22, 2019, 11:31:41 AM »
Danke,

ich installiere die 3er-Version und melde mich nach einigen Tagen der
Beobachtung der error-log.

Heinz

Offline bbs2

  • Posts: 59
Re: E_Notice in dlc.php der download-gallery 2.86
« Reply #4 on: February 22, 2019, 11:44:25 AM »
Danke für den Hinweis zur Versionsangabe.
Sorry, ich hatte dies versäumt.

Ich benutze WB 12.2 und PHP 7.2

Gruß

Heinz

Offline bbs2

  • Posts: 59
Re: E_Notice in dlc.php der download-gallery 2.86
« Reply #5 on: February 25, 2019, 09:00:40 AM »
Danke für den Hinweis auf die neue Version 3.x

Der Fehler in der dlc.php, line 60, tritt nun nicht mehr auf.

Gruß

Heinz

Offline henri

  • Posts: 134
Re: E_Notice in dlc.php der download-gallery 2.86
« Reply #6 on: February 25, 2019, 08:18:45 PM »
Hi Jacobi22,

Download Gallery 3.0.0dev11
I get an error message if I want to save a new download or if I want to modify and save an existing download.

I get the following error message in admin:

There was an uncatched exception
Call to undefined function functions_exists ()
in line (193) or (/modules/download_gallery/save_file.php):

Despite this error message, the new or modified download is still saved.

PHP-Version: 7.2.14
WebsiteBaker Version: 2.12.1 -r188

Offline DarkViper

  • Forum administrator
  • *****
  • Posts: 3014
  • Gender: Female
Re: E_Notice in dlc.php der download-gallery 2.86
« Reply #7 on: February 25, 2019, 11:10:54 PM »
[…]
Call to undefined function functions_exists ()
in line (193) or (/modules/download_gallery/save_file.php):
[…]
That's a typo. The function must be written to function_exists(), not functions_exists()
Der blaue Planet - er ist nicht unser Eigentum - wir haben ihn nur von unseren Nachkommen geliehen

"You have to take the men as they are… but you can not leave them like that !" :-P
Das tägliche Stoßgebet: Oh Herr, wirf Hirn vom Himmel !

Offline Luisehahne

  • WebsiteBaker Org e.V.
  • **
  • Posts: 4349
  • Gender: Male
    • Webdesign und Entwicklung WebsiteBaker
Re: E_Notice in dlc.php der download-gallery 2.86
« Reply #8 on: February 26, 2019, 04:14:14 AM »
Erledigt!!
Typofix und neue Version Download Gallery Version 3.0.0dev12

Komisch, dass der Fehler beim Testen nie bemerkt wurde.

Dietmar
Immer nur von der Zukunft reden, die Gegenwart vergessen und auf die Vergangenheit schimpfen
Neues Unwort: Schnappatmung

Offline henri

  • Posts: 134
Re: E_Notice in dlc.php der download-gallery 2.86
« Reply #9 on: February 26, 2019, 04:21:15 PM »
Hello Dietmar,

During update of module Download Gallery Version 3.0.0dev11 to version 3.0.0dev12 I get the following error message.

[170] It is not possible to upgrade or install from a WebsiteBaker Versions before 2.12.1

See screenshot.

Then in WB in Download Gallery Version 3.0.0dev11 I modified the save_file.php file as described by DarkViper and now the module works fine.

Offline jacobi22

  • Posts: 5836
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: E_Notice in dlc.php der download-gallery 2.86
« Reply #10 on: February 26, 2019, 04:57:39 PM »
wrong platform version in info.php

use 2.12.1 instead of 2.12.2
Probleme sind da, um sie zu lösen, nicht, um nach Ausreden zu suchen.

Offline henri

  • Posts: 134
Re: E_Notice in dlc.php der download-gallery 2.86
« Reply #11 on: February 26, 2019, 05:16:35 PM »
Hi Jacobi22,

Version number I had already changed to 2.12.1 in info.php.
Get the same error message.

Now a new problem and error message in Download Gallery.

I had a folder with a file in Download Gallery.
From the description of the file I could not set a background color.

Then I deleted the file and the folder.
Then created a new folder with a different name that went without problems.
Then I wanted to put a file in there but got an error message while saving this file.

See screenshot

Offline henri

  • Posts: 134
Re: E_Notice in dlc.php der download-gallery 2.86
« Reply #12 on: February 26, 2019, 05:36:01 PM »
Hallo Jacobi22,

Download Gallery 3.0.0dev11 verwijderd in WB.
Nieuwe installatie Download Gallery 3.0.0dev12 gedaan zonder aanpassing info.php.
Installatie geslaagd.

Offline henri

  • Posts: 134
Re: E_Notice in dlc.php der download-gallery 2.86
« Reply #13 on: February 26, 2019, 07:27:09 PM »
Test with new installation Download Gallery 3.0.0dev12

When I create a folder and add 1 file, I get no error message.
If I add another file in this folder, I get the following error message during saving.

There was an uncatched exception
Call to a member function query () on null
in line (58) or (/modules/download_gallery/helpers/ReOrder.php):

Setting colors is fine now.

PHP-Version: 7.2.14
WebsiteBaker-Version: 2.12.1 -r188

Offline jacobi22

  • Posts: 5836
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: E_Notice in dlc.php der download-gallery 2.86
« Reply #14 on: February 26, 2019, 07:31:21 PM »
is it possible for you, to take a look into the database , table mod_downloadgallery _files to the position of both items
Probleme sind da, um sie zu lösen, nicht, um nach Ausreden zu suchen.

Offline jacobi22

  • Posts: 5836
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: E_Notice in dlc.php der download-gallery 2.86
« Reply #15 on: February 26, 2019, 07:49:20 PM »
please take this Corefix from here -> https://wb211.wdsnet.de/modules/download_gallery/dlc.php?id=04D3BC7

ReOrder needs (i think) the new version of class.order.php
Probleme sind da, um sie zu lösen, nicht, um nach Ausreden zu suchen.

Offline henri

  • Posts: 134
Re: E_Notice in dlc.php der download-gallery 2.86
« Reply #16 on: February 26, 2019, 08:54:12 PM »
Hi Jacobi22,

I made a screenshot of table mod_downloadgallery _files in the database and of Download Gallery the files in the created folder. Maybe you can do something with this.

Unfortunately, I do not understand what I should do with the Corefix.

Offline jacobi22

  • Posts: 5836
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: E_Notice in dlc.php der download-gallery 2.86
« Reply #17 on: February 27, 2019, 12:16:57 AM »
database looks good
Quote
I do not understand what I should do with the Corefix.

the corefix is like a small update. it included only the new or changed files and not the whole wb-package
Download this fix, unzip it in a empty locale folder on your pc and upload it to the server. be sure, that you overwrite the old files on the server

alternative: dont use the corefix and wait for the new WB-Version, but clear the error-log everytime, when you've added a new file to the download-gallery

another alternative: deactive this line with a double slash in the front in modules/download_gallery/save_file.php - Line 202

 
Code: [Select]
       $order->reOrder((int)$group);
change to

 
Code: [Select]
//      $order->reOrder((int)$group);
Probleme sind da, um sie zu lösen, nicht, um nach Ausreden zu suchen.

Offline henri

  • Posts: 134
Re: E_Notice in dlc.php der download-gallery 2.86
« Reply #18 on: February 27, 2019, 03:43:34 PM »
Hi Jacobi22,

I now understand what the intention is.
I uploaded the files to WB
File in framework / traits / Captcha_SessionTrai t.php is a new file that I have added. There was also the file Phplib_FtanTrait.ph p in this folder on the server that I left.

After having uploaded everything once again checked if everything was overwritten. And everything was right.

When in admin of WB Error log file cleared.

New file added in the created folder of Download Gallery and saved.

Unfortunately I got the following error message again:

There was an uncatched exception
Call to a member function query () on null
in line (58) or (/modules/download_gallery/helpers/ReOrder.php):

Offline henri

  • Posts: 134
Re: E_Notice in dlc.php der download-gallery 2.86
« Reply #19 on: February 27, 2019, 04:08:09 PM »
Hi Jacobi22,

Download_Gallery_3_ 0_0dev12.zip module
Also tested in:
PHP-Version: 7.2.14
WebsiteBaker Version: 2.11.0 -r79

Installation went well.
Files uploaded as in WB 2.12.1

Again I get the same error message:

There was an uncatched exception
Call to a member function query () on null
in line (58) or (/modules/download_gallery/helpers/ReOrder.php):

Offline jacobi22

  • Posts: 5836
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: E_Notice in dlc.php der download-gallery 2.86
« Reply #20 on: February 27, 2019, 07:06:47 PM »
it make's no sense for me, to write a long description, if nobody read it...   :|

Download_Gallery_3_ 0_0dev11 or Download_Gallery_3_ 0_0dev12 use the function Reorder() in save_files.php Ln 202 to write a new Group-Order in the download_gallery files table.
but this new function needs the new version of framework/class.order.php

take a look into this file to the first definition

older version in class.order.php  ~Ln 31 - 35
Code: [Select]
    private $_Table      = '';
    private $_FieldOrder = '';
    private $_FieldId    = '';
    private $_FieldGroup = '';
    private $_DB         = null;

version from the latest core fix ~Ln 30 - 34
Code: [Select]
    protected $_Table      = '';
    protected $_FieldOrder = '';
    protected $_FieldId    = '';
    protected $_FieldGroup = '';
    protected $_DB         = null;

the different: as "private" defined Values like $_DB, $_FileId etc are only usable inside of the class, where it's defined. that means in this special case: only inside of the class order, but not in a extended function like Reorder() from the Outside like DownLoadGallery.

It is not needed, to use older WB-Version's or older PHP-Version's - it has nothing to do with this problem.
Two possible way's
1.: deactivate this line 202 in save_file.php with these code
Code: [Select]
$order->reOrder((int)$group);
2.: use the class.order.php from the corefix and take a look into this file to check, that you have already the latest version
Probleme sind da, um sie zu lösen, nicht, um nach Ausreden zu suchen.

Offline henri

  • Posts: 134
Re: E_Notice in dlc.php der download-gallery 2.86
« Reply #21 on: February 27, 2019, 08:07:15 PM »
Hi Jacobi22,

I have in save_file.php
$ order-> reOrder ((int) $ group); deactivated.
Now no more error message.

I also find it very unfortunate that there is so little enthusiasm for this great system of Website Baker. I usually see the same people who want to commit themselves to further develop this system.
Unfortunately, I do not have the knowledge to improve and solve things. But I like to test things for Website Baker.