WebsiteBaker Community Forum

WebsiteBaker Support (2.12.x) => Modules => Topic started by: bbs2 on February 22, 2019, 08:58:38 AM

Title: E_Notice in dlc.php der download-gallery 2.86
Post by: bbs2 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
Title: Re: E_Notice in dlc.php der download-gallery 2.86
Post by: dbs 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.
Title: Re: E_Notice in dlc.php der download-gallery 2.86
Post by: Gast 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 (https://wb211.wdsnet.de/modules/download_gallery/dlc.php?id=0C80D11)
Title: Re: E_Notice in dlc.php der download-gallery 2.86
Post by: bbs2 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
Title: Re: E_Notice in dlc.php der download-gallery 2.86
Post by: bbs2 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
Title: Re: E_Notice in dlc.php der download-gallery 2.86
Post by: bbs2 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
Title: Re: E_Notice in dlc.php der download-gallery 2.86
Post by: henri 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
Title: Re: E_Notice in dlc.php der download-gallery 2.86
Post by: DarkViper 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()
Title: Re: E_Notice in dlc.php der download-gallery 2.86
Post by: Luisehahne on February 26, 2019, 04:14:14 AM
Erledigt!!
Typofix und neue Version Download Gallery Version 3.0.0dev12 (https://wb211.wdsnet.de/modules/download_gallery/dlc.php?id=0C80D11)

Komisch, dass der Fehler beim Testen nie bemerkt wurde.

Dietmar
Title: Re: E_Notice in dlc.php der download-gallery 2.86
Post by: henri 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.
Title: Re: E_Notice in dlc.php der download-gallery 2.86
Post by: Gast on February 26, 2019, 04:57:39 PM
wrong platform version in info.php

use 2.12.1 instead of 2.12.2
Title: Re: E_Notice in dlc.php der download-gallery 2.86
Post by: henri 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
Title: Re: E_Notice in dlc.php der download-gallery 2.86
Post by: henri 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.
Title: Re: E_Notice in dlc.php der download-gallery 2.86
Post by: henri 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
Title: Re: E_Notice in dlc.php der download-gallery 2.86
Post by: Gast 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
Title: Re: E_Notice in dlc.php der download-gallery 2.86
Post by: Gast 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
Title: Re: E_Notice in dlc.php der download-gallery 2.86
Post by: henri 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.
Title: Re: E_Notice in dlc.php der download-gallery 2.86
Post by: Gast 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);
Title: Re: E_Notice in dlc.php der download-gallery 2.86
Post by: henri 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):
Title: Re: E_Notice in dlc.php der download-gallery 2.86
Post by: henri 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):
Title: Re: E_Notice in dlc.php der download-gallery 2.86
Post by: Gast 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
Title: Re: E_Notice in dlc.php der download-gallery 2.86
Post by: henri 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.