WebsiteBaker Community Forum

WebsiteBaker Support (2.13.x) => Modules => Topic started by: CodeALot on February 07, 2024, 09:59:33 AM

Title: OneForAll save_item.php problem with class.database.php
Post by: CodeALot on February 07, 2024, 09:59:33 AM
WebsiteBaker-Version: 2.13.5 -r220 with patch 223
PHP version 8.2.15
OneForAll version 2.0.2.23


Module functions OK at the front-end. When you try to save a record in the backend, you get:

Code: [Select]
There was an uncatched exception
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE `item_id` = 22' at line 1
in line (828) of (/framework/class.database.php):

There is no statement 'WHERE 'item_id" at line 1. It's not at line 828 in class.database.php either.
Where do I look to fix this? :-)

WB's errorlog tells me this whenever I try to save a record:

Code: [Select]
Wed, 07 Feb 2024 09:01:49 +0000 [E_DEPRECATED] /modules/oneforall/save_item.php:[79] from /modules/oneforall/save_item.php:[79] strip_tags "strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated"
Wed, 07 Feb 2024 09:01:49 +0000 [E_DEPRECATED] /modules/oneforall/save_item.php:[80] from /modules/oneforall/save_item.php:[80] strip_tags "strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated"
Wed, 07 Feb 2024 09:01:49 +0000 [E_DEPRECATED] /modules/oneforall/save_item.php:[103] from /modules/oneforall/save_item.php:[103] strip_tags "strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated"
Wed, 07 Feb 2024 09:01:49 +0000 [E_DEPRECATED] /modules/oneforall/save_item.php:[104] from /modules/oneforall/save_item.php:[104] strip_tags "strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated"
Wed, 07 Feb 2024 09:01:49 +0000 [E_USER_DEPRECATED] /framework/class.wb.php:[562] from /modules/oneforall/save_item.php:[571] bin\wb->get_user_id "invalid method call: bin\wb::get_user_id change it to getUserId()"
Wed, 07 Feb 2024 09:01:49 +0000 [E_WARNING] /framework/class.wb.php:[563] from /modules/oneforall/save_item.php:[571] bin\wb->get_user_id "Undefined property: admin::$getUserId""
Title: Re: OneForAll save_item.php problem with class.database.php
Post by: dbs on February 07, 2024, 01:49:41 PM
Hi, you can try the save_item.php from here: https://forum.WebsiteBaker.org/index.php/topic,32247.0.html
 (https://forum.WebsiteBaker.org/index.php/topic,32247.0.html)But not install the whole module!
Title: Re: OneForAll save_item.php problem with class.database.php
Post by: CodeALot on February 07, 2024, 02:09:32 PM
Hi, you can try the save_item.php from here: https://forum.WebsiteBaker.org/index.php/topic,32247.0.html
 (https://forum.WebsiteBaker.org/index.php/topic,32247.0.html)But not install the whole module!

Thank you, but unfortunately that doesn't work because the database setup for that version of OFA is different. When I try save_item, I get:

Code: [Select]
There was an uncatched exception
Table 'mydatabasename.wb_mod_oneforall_general_settings' doesn't exist
in line (828) of (/framework/class.database.php):

EDIT: I commented out lines 56 - 72 and then it works... ;-)
Title: Re: OneForAll save_item.php problem with class.database.php
Post by: dbs on February 07, 2024, 02:34:26 PM
Therefore you should not install the module. It is a version with extras like general_settings instead of OFA config.php
I'm glad it helped  :)
Title: Re: OneForAll save_item.php problem with class.database.php
Post by: CodeALot on February 07, 2024, 03:41:30 PM
For now it does, the only thing is that it doesn't create an access page for the detail view of a new record, but that is solved by using the 'rebuild access pages' function in WB. So it's a workaround, and I hope there will be an updated new OFA that deals with the errors in the current 'official' version under WB 2.13.5 and PHP 8.2 and up...

Thanks again!
Title: Re: OneForAll save_item.php problem with class.database.php
Post by: dbs on February 07, 2024, 04:15:59 PM
"fun fact", if i deactivate detail pages it further create detail pages.
Title: Re: OneForAll save_item.php problem with class.database.php
Post by: CodeALot on February 07, 2024, 10:35:22 PM
"fun fact", if i deactivate detail pages it further create detail pages.
I'll try that! :-)