News:

Dear forum visitors, if the support forum is not available, please try again a few minutes later. Thanks!

Main Menu
Support-Forum

Joomla 4 Error when adding a download from the site - [Not really a bug!]

Started by jononorvic, 20.12.2023 18:26:55

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Florian

Hi Arno,

I had jD 3.9.8.4 active when I disabled EVERY jD Extension and finally upgraded to J 4.4 (not sure about sub no.). Then I installed jD 4.0.36 and later upgraded to jD 4.0.39 .

Field modified has following definition in MariDB
type = datetime
NULL = NO
default = 0000-00-00 00:00:00

Maybe that helps you to identify which database version I have. Anyhow it seems that I am not the only one who had this issue. It worked fine from backend and when I analyzed table I found out that it would create a field modified with today's data as modified date. That is when I understood that there must be an issue with empty modifed when storing from frontend.
Happy Coding with Joomla and jDownloads
  •  

Florian

Hi Arno,

I also checked whether I have your code lines at line 1432 (as I have 2 lines more with my patch). And yes I can confirm. But something happens in form handling anyway. Remember that PHP refuses to store a strange date "-0001:11:30" . Your code would not find that if form returns a non-zero and !Null value.
Happy Coding with Joomla and jDownloads
  •  

Arno

QuoteField modified has following definition in MariDB
type = datetime
NULL = NO
default = 0000-00-00 00:00:00

It should be with jDownloads 4:
modified` datetime NOT NULL,

There are no more definitions of this type in install.mysql.utf8.sql:
default = 0000-00-00 00:00:00

And even after an upgrade from 3.9.x, all tables should have been corrected accordingly.
However, something may have gone wrong here. Please take a look at the installation logs of jDownloads. Control Panel or /administrator/logs/com_jdownloads_install_logs.php
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •  

Florian

Hi Arno,

I checked the Log in Backend and the file administrator/logs/com_jdownloads_install_logs.php is attached here. I told that I have just recently upgraded to J4 and follwoing to also jD4 . All jD4 extensions were disabled during installation of J4.

#
#<?php die('Forbidden.'); ?>
#Date: 2024-01-12 09:44:48 UTC
#Software: Joomla! 4.4.1 Stable [ Pamoja ] 28-November-2023 16:00 GMT

#Fields: date time    priority     message
2024-01-12 09:44:48    INFO     ------------------------------------------------------ System Information
2024-01-12 09:44:48    INFO     OS                 : Linux d
2024-01-12 09:44:48    INFO     PHP                : 8.2.9
2024-01-12 09:44:48    INFO     MySQL              : 10.6.12-MariaDB-0ubuntu0.22.04.1-log
2024-01-12 09:44:48    INFO     Joomla!            : 4.4.1
2024-01-12 09:44:48    INFO     Debug              : 1
2024-01-12 09:44:48    INFO     Debug Language     :
2024-01-12 09:44:48    INFO     Error Reporting    : default
2024-01-12 09:44:48    INFO     SEF                : 1
2024-01-12 09:44:48    INFO     Unicode Aliases    :
2024-01-12 09:44:48    INFO     System Cache       : 0
2024-01-12 09:44:48    INFO     Captcha            : hcaptcha
2024-01-12 09:44:48    INFO     ------------------------------------------------------ Update Started
2024-01-12 09:44:48    INFO     Update started by user Super User (412). Old version is 4.0.36. New version is 4.0.39 Stable.
2024-01-12 09:44:49    INFO     Modules succesfully installed/updated: 12.
2024-01-12 09:44:49    INFO     Plugins succesfully installed/updated: 6.
2024-01-12 09:44:49    INFO     Wrong values successfully corrected in jdownloads_files `publish_down` field.
2024-01-12 09:44:49    INFO     ------------------------------------------------------ Update Finished
Happy Coding with Joomla and jDownloads
  •  

Arno

Hi Volker,
too bad, I actually need the log from the 3.x to 4 upgrade.

I still suspect errors in your jDownloads tables. The only thing that will help is a manual comparison with the file in question or a 'fresh' jDownloads installation.

Perhaps I should add a small check routine when starting the jD backend for the first time, so that the admin can then point out faulty tables. I am already aware that the corrections during the upgrade process do not run smoothly for some users (but probably only very few). However, it was difficult to reproduce the problem. It could possibly be due to overly restrictive DB settings.
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •  

Florian

Hi Arno,

shall I dump table structures of jDownloads and attach here or send to you via email?
Happy Coding with Joomla and jDownloads
  •  

jononorvic

I tried to reply a few days ago, but could not as the verification failed (many times).
I was trying to say that Florian's fix works for me.
If it would be helpful, I am happy to provide a dump of anything.
John
  •  

Arno

Quote from: Florian on 23.01.2024 11:51:22Hi Arno,

shall I dump table structures of jDownloads and attach here or send to you via email?
It would also work as a PM attachment.
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •  

Arno

Quote from: jononorvic on 23.01.2024 14:37:44I tried to reply a few days ago, but could not as the verification failed (many times).
I was trying to say that Florian's fix works for me.
If it would be helpful, I am happy to provide a dump of anything.
John

Thanks John, but if you had the same problem, it seems that your jDownloads tables are not up to date either. I will therefore have to integrate a check in one of the next versions.

Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •  

jononorvic

I have now had a closer look at the recent posts and have made a small change. First, I removed Florian's mod; the error returned. Then I changed the default setting for the column "modified" in table "ne6_jdownloads_files" from "0000-00-00 00:00:00" to "None". I can now add downloads from the front end without error.

The log from the upgrade is:-
#
#<?php die('Forbidden.'); ?>
#Date: 2023-12-18 22:03:35 UTC
#Software: Joomla! 4.2.6 Stable [ Uaminifu ] 13-December-2022 15:00 GMT

#Fields: date time    priority    message
2023-12-18 22:03:35    INFO    ------------------------------------------------------ System Information
2023-12-18 22:03:35    INFO    OS                : Linux c
2023-12-18 22:03:35    INFO    PHP                : 8.1.26
2023-12-18 22:03:35    INFO    MySQL              : 5.7.44
2023-12-18 22:03:35    INFO    Joomla!            : 4.2.6
2023-12-18 22:03:35    INFO    Debug              :
2023-12-18 22:03:35    INFO    Debug Language    :
2023-12-18 22:03:35    INFO    Error Reporting    : default
2023-12-18 22:03:35    INFO    SEF                : 1
2023-12-18 22:03:35    INFO    Unicode Aliases    :
2023-12-18 22:03:35    INFO    System Cache      : 0
2023-12-18 22:03:35    INFO    Captcha            : 0
2023-12-18 22:03:35    INFO    ------------------------------------------------------ Update Started
2023-12-18 22:03:35    INFO    Update started by user John Cooper (994). Old version is 3.9.8.5. New version is 4.0.36 Stable.
2023-12-18 22:03:36    INFO    Modules succesfully installed/updated: 12.
2023-12-18 22:03:36    INFO    Plugins succesfully installed/updated: 6.
2023-12-18 22:03:37    INFO    Wrong values successfully corrected in jdownloads_files `publish_down` field.
2023-12-18 22:03:37    INFO    ------------------------------------------------------ Update Finished

I will also PM a dump of the table.

In "install.mysql.utf8.sql", column "created" is also defined with default "None", but in the "ne6_jdownloads_files" table structure has default "0000-00-00 00:00:00". Should that also be changed? Are you aware of any other columns (and tables) that might have the same problem and cause errors?

Thanks for your help. Let me know if anything else would be useful.

John
  •  

Arno

QuoteIn "install.mysql.utf8.sql", column "created" is also defined with default "None", but in the "ne6_jdownloads_files" table structure has default "0000-00-00 00:00:00". Should that also be changed? Are you aware of any other columns (and tables) that might have the same problem and cause errors?

Thanks for your help. Let me know if anything else would be useful.

Yes. All the tables should have after the Upgrade to jDownloads 4 not longer a datetime field with 'default "0000-00-00 00:00:00"
Use the install.mysql.utf8.sql file as a reference.

Only 'datetime NOT NULL' or 'datetime NULL DEFAULT NULL' is still used.

Normally this is checked with a special function during the upgrade and corrected if necessary. But this does not seem to have worked one hundred per cent for all users.
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •  

jononorvic

Thanks. I will now update the live site. It has slightly different hosting, so I will see if that suffers from the problem.

John
  •  

Florian

Hi Arno,

I have thought about this subject and I conclude

1. Field __jdownloads_files.modified should be set to have no default value . I noticed that HTMLHelper creates this strange date "-0001-11-30 00:53:28" from "0000-00-00 00:00:00" default value.
2. I also recommend to set NULL to YES on this field. When you create a new download file, it is logical that it has no modified date. A modified date and modified by user should in my eyes only be set when you really modify an already existing download.
3. That should also be the case when doing the new upload in admin backend. So modied and modified_by shoudl be empty on NEW files

I will do an update of my tables so that I do not need this fix by setting DEFAULT to NULL and allow NULL manually
Happy Coding with Joomla and jDownloads
  •  

Arno

Of course you can do that for yourself. I have adopted the structure of the Joomla articles and saw no absolute necessity for a different structure. There are currently no plans to make any further changes.
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •