Solved: Comment Plugin (Local commenting) not working

Status
Not open for further replies.

fstorch

Member
Environment:
J! 4.3.3
Fabrik4Delta
PHP 8.2
upload_2023-8-2_23-5-24.png


upload_2023-8-2_23-5-52.png


No error in administrator/logs.
Log Almost Everything set.
&fabrikdebug=1 shows nothing
No record added to comment table

To Test: http://jtest.conacare.de/index.php/all-primary/form/1/5
Entering a comment shows just:
upload_2023-8-2_23-3-52.png
 
I have it working on a live site (setup is for logged in users only) and on a test site (with your settings - I think).

Do you have the table #_fabrik_comments?
 
Fails on a migrated production site and a freshly installed testsite http://jtest.conacare.de/index.php/all-primary/form/1/5
Both sites started with Delta.
Both DB‘s have the comments table. Jtest looks like this:
CREATE TABLE `igeng_fabrik_comments` (
`id` int NOT NULL AUTO_INCREMENT,
`user_id` int NOT NULL DEFAULT '0',
`ipaddress` char(14) NOT NULL DEFAULT '',
`reply_to` int NOT NULL DEFAULT '0',
`comment` mediumtext,
`approved` tinyint(1) NOT NULL DEFAULT '0',
`time_date` timestamp NOT NULL,
`url` varchar(255) NOT NULL DEFAULT '',
`name` varchar(150) NOT NULL DEFAULT '',
`email` varchar(100) NOT NULL DEFAULT '',
`formid` int NOT NULL DEFAULT '0',
`row_id` int NOT NULL DEFAULT '0',
`rating` char(2) NOT NULL DEFAULT '',
`annonymous` tinyint(1) NOT NULL DEFAULT '0',
`notify` tinyint(1) NOT NULL DEFAULT '0',
`diggs` int NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
 
I just tried with a "clean" Delta test site (+ the dbjoin.js patch). It's working.
Is there data in the fabrik_comments table? (I assume no)

Did you try with php8.1?
What I see on your site
upload_2023-8-3_10-26-42.png

Not sure if this may break something.

System debug on/off?
Error reporting level?
Any difference if you are logged in?
 
There is old data in the migrated production site, but no data in the new test site.
System Debug was on, tested with off as well.
Error reporting is set to anlmost everything.
No difference, if logged in or not.
I got no SSL certificate for the subdomains, so I access them using HTTP.
So FORCE SSL is off on the test sites.
I did have problems with DOMPDF, when using HTTPS, which got resolved by using HTTP.
 
To rule out ssl, I tried on a Wamp Installation.
The migrated site with F4Delta shows the same symptom.
In a small test-site with 4.0beta3 Comment was working fine.
The test-site had still Joomla 4.2.6.
Updated that to 4.3.3 - Comment was still working
 
Found in debug:
comment.php 620: $row->store();
In Table.php after $this->_db->insertObject at 851
caught exception:
message: Field 'time_date' doesn't have a default value
query: INSERT INTO `xxx_fabrik_comments`\r\n(`user_id`,`ipaddress`,`reply_to`,`comment`,`approved`,`url`,`name`,`email`,`formid`,`row_id`,`notify`) VALUES \r\n('100','::1','0','test','1','http://f4delta/index.php?option=com...formid=2&rowid=868&Itemid=127&lang=de','Franz Storch','franz@familiestorch.de','2','868','0')

As above:
`time_date` timestamp NOT NULL,
has no default and isn't part of the insert list.
So the exception seems correct.
Why doesn't it use the [CURRENT_TIMESTAMP] default which seems to be used in F3?
 
Last edited:
Works after
Code:
ALTER TABLE `dbname-test`.`xxxxx_fabrik_comments`
CHANGE COLUMN `time_date` `time_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ;
but still requires a fix in comment.php to create or update the table accordingly.
 
These sites run with mysql 8.0.33-25.
AAMOF I just tried to restore a backup to another server which is running 10.11.4-MariaDB
That restore fails due to
Unknown collation: 'utf8mb4_0900_ai_ci'
Which is used on the mysql source only for

`jcc_{package}_change_log_types`,
`jcc_{package}_change_log_fields`,
`jcc_fabrik_change_log_types`,
`jcc_fabrik_change_log_fields`,
`jcc_fabrik_change_log`,
`jcc_{package}_change_log`

These tables don't exist in F3
Most of the other tables use utf8mb4_unicode_ci
 
_change_log_ tables are coming from the form log plugin.

Is this a site where you already installed former F4 versions? Where the {package} tables may come from...
 
It seems the install() is run every time you are editing the form settings of a form with comment plugin.

I only have access to MariaDBs (where these settings seem to be forced automatically if NOT NULL is set)

Can you try and see if this is working with your DB? (i.e. add the modifications, edit your form settings, check in your DB, test the comments)

upload_2023-8-4_11-45-32.png
 
OK, tested with mysql site and mariadb site.
Both tables got altered correctly and comments are working.
So that fix should be OK.

By chance I used reply on the new comment and the first reply always failed and either left the form in an incorrect state (status seems new but in display mode) or jumps to the homepage.
This message shows up at the top:
Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/www/xxxxxx/t1/plugins/fabrik_form/comment/comment.php on line 102
The 2nd attempt to reply works fine.

And finally a sidenote: PHP 8.2 on that other site didn't work at all (GPT on every attempt to access the website)
 
Last edited:
upload_2023-8-4_23-23-27.png

Deprecated will be fixed with the next release (but should not hurt).
Table definition is fixed, too.

I can't find the reason for the "reply on own new comment" issue, it's already in F3 and a bit a corner case - so not fixed at the moment.
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top