E_Notice in dlc.php der download-gallery 2.86

henri

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.

Gast

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
    private $_Table      = '';
    private $_FieldOrder = '';
    private $_FieldId    = '';
    private $_FieldGroup = '';
    private $_DB         = null;


version from the latest core fix ~Ln 30 - 34
    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
$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

henri

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):

henri

Hi Jacobi22,

I now understand what the intention is.
I uploaded the files to WB
File in framework / traits / Captcha_SessionTrait.php is a new file that I have added. There was also the file Phplib_FtanTrait.php 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):

Gast

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

       $order->reOrder((int)$group);

change to

//      $order->reOrder((int)$group);


henri

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.

Gast

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

Gast

is it possible for you, to take a look into the database , table mod_downloadgallery_files to the position of both items

henri

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

henri

Hallo Jacobi22,

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

henri

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

Gast

wrong platform version in info.php

use 2.12.1 instead of 2.12.2

henri

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.

Luisehahne

Erledigt!!
Typofix und neue Version Download Gallery Version 3.0.0dev12

Komisch, dass der Fehler beim Testen nie bemerkt wurde.

Dietmar
Note: Once the code has been generated, it is easy to debug. It's not a bug, it's a feature!

DarkViper

Quote from: henri on February 25, 2019, 08:18:45 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()
[url=http://www.youtube.com/watch?v=tmzDAz6ZvFQ]Der blaue Planet[/url] - er ist nicht unser Eigentum - wir haben ihn nur von unseren Nachkommen geliehen[br]
[i]"You have to take the men as they are... but you can not leave them like that !" :-P [/i]
[i]Das tägliche Stoßgebet: [b]Oh Herr, wirf Hirn vom Himmel ![/b][/i]

henri

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

bbs2

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

bbs2

Danke für den Hinweis zur Versionsangabe.
Sorry, ich hatte dies versäumt.

Ich benutze WB 12.2 und PHP 7.2

Gruß

Heinz

bbs2

Danke,

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

Heinz

Gast

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

    $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

dbs

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.
[url="https://onkel-franky.de"]https://onkel-franky.de[/url]

bbs2

#1
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:

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