trobfab / fabrik

Fabrik for Joomla 4.x
http://fabrikar.com
Other
25 stars 4 forks source link

install failed on fresh J4 / PHP 8.0 site #257

Closed EricdeWaal closed 2 years ago

EricdeWaal commented 2 years ago

Hi, I downloaded the files from Github a moment ago and copied them to a fresh J4 / PHP 8.0 site, then ran Discover. I got the following errors: BLOB, TEXT, GEOMETRY or JSON column 'params' can't have a default value BLOB, TEXT, GEOMETRY or JSON column 'comment' can't have a default value BLOB, TEXT, GEOMETRY or JSON column 'orig_value' can't have a default value BLOB, TEXT, GEOMETRY or JSON column 'message' can't have a default value BLOB, TEXT, GEOMETRY or JSON column 'desc' can't have a default value info Discover install failed.: 370 Discover install failed.: 290 Discover install failed.: 301 Discover install failed.: 305 Discover install failed.: 315 The error "column 'params' can't have a default value" indicates that when creating a field in a table, the installer tries to set a default value for a field type that does not support this property.

The plugins are: Fabrik Form - Comment, Fabrik Form - Log, Fabrik Form - Notification, Fabrik Form - Paypal Subscriptions, Fabrik

When enabling them all I got the next error: An error has occurred.

0 PLG_FABRIK_SYSTEM_AUTOLOAD_MISSING 

Please check, thanks! Eric

trob commented 2 years ago

Did you do at least a core installtion before?

See this GitHub Wiki for how to install, status of plugins etc.

EricdeWaal commented 2 years ago

Sorry, I am new to working from Github. And don't know what a core installation is, do you mean the Joomla core? Yes, I installed J4 first, obiously. And where is the wiki you mentioned? I just did what I mentioned above.

skurvish commented 2 years ago

You must go through a proper first install of Fabrik with the Joomla installer before you attempt to copy the github files. The project is not ready for this yet so please wait a few weeks or so.

trob commented 2 years ago

See README.md and grafik You must install Fabrik4 (core means containing com_fabrik and some essential plugins, same as in Fabrik3) via Joomla installer to get the database changes and files copied. After this you can discover addtional plugins, get latest code via GitHub update etc.

EricdeWaal commented 2 years ago

Thanks, I see! As I said, I am a newbee to Github. But still, the above mentioned 4 plugins have install.mysql.uft8.sql files with 'CREATE TABLE IF NOT EXISTS' statements that try to create TEXT fields with an illegal DEFAULT '' value. As the error says: "BLOB, TEXT, GEOMETRY or JSON column 'params' can't have a default value" Maybe it was overlooked as in your case the table already existed?

trob commented 2 years ago

Which database version are you running?

I did a "comments" discover without issues.

trob commented 2 years ago

Ok, it seems different DB types/versions are doing different default handling, e.g. In [MariaDB 10.4], [SHOW CREATE TABLE] does not quote the DEFAULT value of an integer. [MariaDB 10.2] and earlier, and MySQL, do. Since MariaDB can support defaults for [BLOB] and [TEXT] fields, while MySQL does not, [SHOW CREATE TABLE] will also append DEFAULT NULL where no default is explicitly provided to nullable BLOB or TEXT fields in MariaDB. or Explicit Default Handling as of MySQL 8.0.13 The [BLOB], [TEXT], GEOMETRY, and [JSON]( data types can be assigned a default value only if the value is written as an expression, even if the expression value is a literal: Explicit Default Handling Prior to MySQL 8.0.13 The [BLOB], [TEXT], GEOMETRY, and [JSON] data types cannot be assigned a default value.

So we have to find a general setting, define min. DB version or...

EricdeWaal commented 2 years ago

My database version is 5.7.39-1 (MySQL), it's provided by my hoster (Hetzner) and I cannot set a more recent version. That explains it, I guess! For 2022 a move to MariaDB (10.5) was planned, but so far nothing.

joomlahenk commented 2 years ago

@EricdeWaal : Anyway this is a good test. I guess more users will have MySQL 5.7. We may not need to set a default for a text type. I will try to setup a local site with MySQL 5.7 and see what happens. The form plugins you tried to use, are not fully tested by us yet so issues may appear. Maybe you can do the installation as described in the wiki and then try again?

EricdeWaal commented 2 years ago

Yes, MySQL 5.7 is the database in Debian Buster, which is still used by a lot of people including Hetzner on shared hosting. The successor, Debian Bullseye, comes with MariaDB 10.5. I don't have a setup here with grunt etc, so making an install zip is a problem. Can you provide one maybe?

joomlahenk commented 2 years ago

If you're on windows10, I can supply a tool to create an installable zip. You need to download the download.zip from github and unzip it in a local folder, then run the tool. The tool is a batch file running in a command prompt. Do you want to use that?

EricdeWaal commented 2 years ago

Would be great, thanks!

joomlahenk commented 2 years ago

OK, please read the createpackfrom.txt first. createfab4install.zip

EricdeWaal commented 2 years ago

Thanks, and all seems to work, I ran it with F:\fabrik>createpackfrom f:\fabrikbuild -min Alhough the end message of the script is: 'Packaging fabrik4.0-min' I get a 61 MB file with all libs and vendor stuff. In the (unmodified) F:\fabrik\excludes\libraries.txt is: "libs vendor" Should I add all those directories individually?

joomlahenk commented 2 years ago

The minimum install only contains element plugins internalid, jdate and field. All libraries are installed, no need to add any. The excludes libraries.txt and components.txt are not used for the createpackfrom, only the plugin*.txt are used as described in the createpackfrom.txt file.

joomlahenk commented 2 years ago

I updated all SQL install files no longer to set a default for type text columns. I tested this OK on MySQL5.7. Maybe you can test again? Get updated files from github first and create a new installable zip. Do not use -min, because then the plugins causing the previous issue will not be installed.

EricdeWaal commented 2 years ago

Did a quick test (without the pdf libriaries due to their size) and it installed without errors. No time to test further, will do tomorrow. @joomlahenk please check discord, I sent you a DM

EricdeWaal commented 2 years ago

Tested the yesterday afternoon install a bit further, sytem details: Joomla 4.2.2 Database Type mysql 5.7.39-1 PHP Version 8.0.23 After enabling the plugins which are marked in the wiki as OK, I could make a list, add elements, tested the form, etc. All works well. Closing this issue now.