Errors: Application Upgraded to Xataface latest version

132 views
Skip to first unread message

Muzafar Shah

unread,
Jul 13, 2021, 7:14:54 AM7/13/21
to Xataface

Hi Steve,

Hope you are doing well,

I am trying to implement Xataface latest version downloaded from here (https://github.com/shannah/xataface) on our old version application, but I am getting the errors as mentioned in the attached screenshot. I have cleared the templates__c directory as well. I tried to disable G2 but it is not working though

Could you please help resolve the issue?

I have converted all MySQL functions to MySQLi using ant script.

PHP 7.3.29 (cli) (built: Jul  6 2021 21:58:04) ( NTS )

Zend Engine v3.3.29, Copyright (c) 1998-2018 Zend Technologies

error-latest-version.png
page.png

Steve Hannah

unread,
Jul 13, 2021, 7:26:20 AM7/13/21
to xata...@googlegroups.com
That exception should be impossible.  Something must be wrong with the installation.

--
You received this message because you are subscribed to the Google Groups "Xataface" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xataface+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xataface/e587437b-058e-4b9d-ad4d-d4aa882cda9en%40googlegroups.com.


--
Steve Hannah
Web Lite Solutions Corp.

Muzafar Shah

unread,
Jul 13, 2021, 8:34:59 AM7/13/21
to Xataface
What do you think can be wrong? 
I have just downloaded the latest version from Github, run Ant script to change functions from MySQL to MySQLi (xf_db), put driver=mysqli in conf.ini and nothing else changed. 

Do you think there might be an issue with the server or what? I just installed a fresh server container.

tom wible

unread,
Jul 13, 2021, 9:27:01 AM7/13/21
to Xataface
i just uploaded the latest github version & set php version to 8, & got this error:

[13-Jul-2021 13:16:42 UTC] PHP Fatal error: Uncaught TypeError: error_reporting(): Argument #1 ($error_level) must be of type ?int, string given in ~/public_html/lalo_DB/index.php:5 Stack trace: #0 ~/public_html/lalo_DB/index.php(5): error_reporting() #1 {main} thrown in ~/public_html/lalo_DB/index.php on line 5 
[13-Jul-2021 13:21:04 UTC] PHP Fatal error: Uncaught TypeError: error_reporting(): Argument #1 ($error_level) must be of type ?int, string given in ~/public_html/lalo_DB/index.php:5 Stack trace: #0 ~/public_html/lalo_DB/index.php(5): error_reporting() #1 {main} thrown in ~/public_html/lalo_DB/index.php on line 5

otoh, wordpress isn't php8-ready, either;-}

Steve Hannah

unread,
Jul 13, 2021, 9:40:38 AM7/13/21
to xata...@googlegroups.com
On Tue, Jul 13, 2021 at 5:35 AM Muzafar Shah <shah...@gmail.com> wrote:
What do you think can be wrong? 
I have just downloaded the latest version from Github, run Ant script to change functions from MySQL to MySQLi (xf_db), put driver=mysqli in conf.ini and nothing else changed. 

Do you think there might be an issue with the server or what? I just installed a fresh server container.

Did you run the ant script on the xataface directory? (You shouldn't).  Only run the ant script on your own legacy code that uses deprecated mysql apis.
 

Steve Hannah

unread,
Jul 13, 2021, 9:41:32 AM7/13/21
to xata...@googlegroups.com
Look at your call to error_reporting() inside your index.php script.  Probably you have an issue with how you are passing the arguments there.

--
You received this message because you are subscribed to the Google Groups "Xataface" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xataface+u...@googlegroups.com.

tom wible

unread,
Jul 13, 2021, 10:04:57 AM7/13/21
to Xataface
On Tuesday, July 13, 2021 at 9:41:32 AM UTC-4 Steve Hannah wrote:
Look at your call to error_reporting() 

yup, didn't like quotes...but got this:
Fatal error: Uncaught Error: Call to undefined function money_format() in ~/public_html/xataface10july/Dataface/Table.php:5591 
Stack trace: 
#0 ~/public_html/xataface10july/Dataface/Record.php(2706): Dataface_Table->format() 
#1 ~/public_html/xataface10july/Dataface/Record.php(2815): Dataface_Record->display() 
#2 ~/public_html/lalo_DB/templates_c/dataface/%%C1^C17^C174B680%%Dataface_View_Record.html.php(320): Dataface_Record->htmlValue() 
#3 ~/public_html/xataface10july/lib/Smarty/Smarty.class.php(1259): include('~/...') 
#4 ~/public_html/xataface10july/lib/Smarty/Smarty.class.php(1109): Smarty->fetch() 
#5 ~/public_html/xataface10july/Dataface/SkinTool.php(425): Smarty->display() 
#6 ~/public_html/xataface10july/public-api.php(635): Dataface_SkinTool->display()
#7 ~/public_html/xataface10july/actions/default.php(51): df_display()
#8 ~/public_html/xataface10july/Dataface/Application.php(3446): dataface_actions_default->handle()
#9 ~/public_html/xataface10july/Dataface/Application.php(3639): Dataface_Application->handleRequest()
#10 ~/public_html/xataface10july/Dataface/Application.php(3474): Dataface_Application->_display()
#11 ~/public_html/lalo_DB/index.php(12): Dataface_Application->display()
#12 {main} thrown in ~/public_html/xataface10july/Dataface/Table.php on line 5591Fatal error: Uncaught Error: Call to undefined function money_format() in ~/public_html/xataface10july/Dataface/Table.php:5591 Stack trace:
#0 ~/public_html/xataface10july/Dataface/Record.php(2706): Dataface_Table->format()
#1 ~/public_html/xataface10july/Dataface/Record.php(2815): Dataface_Record->display()
#2 ~/public_html/lalo_DB/templates_c/dataface/%%C1^C17^C174B680%%Dataface_View_Record.html.php(320): Dataface_Record->htmlValue()
#3 ~/public_html/xataface10july/lib/Smarty/Smarty.class.php(1259): include('~/...')
#4 ~/public_html/xataface10july/lib/Smarty/Smarty.class.php(1109): Smarty->fetch()
#5 ~/public_html/xataface10july/Dataface/SkinTool.php(425): Smarty->display()
#6 ~/public_html/xataface10july/public-api.php(635): Dataface_SkinTool->display()
#7 ~/public_html/xataface10july/actions/default.php(51): df_display()
#8 ~/public_html/xataface10july/Dataface/Application.php(3446): dataface_actions_default->handle()
#9 ~/public_html/xataface10july/Dataface/Application.php(3639): Dataface_Application->handleRequest()
#10 ~/public_html/xataface10july/Dataface/Application.php(3474): Dataface_Application->_display()
#11 ~/public_html/lalo_DB/index.php(12): Dataface_Application->display()
#12 {main} thrown in ~/public_html/xataface10july/Dataface/Table.php on line 5591

tom wible

unread,
Jul 13, 2021, 10:19:11 AM7/13/21
to Xataface
ps:
Warning: Undefined array key "-relationship" in ~/public_html/xataface10july/Dataface/Application.php(3933) : eval()'d code on line 1
Warning: Undefined array key "-relationship" in ~/public_html/xataface10july/Dataface/Application.php(3933) : eval()'d code on line 1
Warning: Undefined array key "record_id" in ~/public_html/xataface10july/Dataface/Application.php(3808) : eval()'d code on line 1
Warning: Undefined array key "history" in ~/public_html/xataface10july/Dataface/Application.php(3933) : eval()'d code on line 1
Warning: Undefined array key "-relationship" in ~/public_html/xataface10july/Dataface/Application.php(3808) : eval()'d code on line 1
Warning: Undefined array key "-relationship" in ~/public_html/xataface10july/Dataface/Application.php(3808) : eval()'d code on line 1
Warning: Undefined array key "_auth" in ~/public_html/xataface10july/Dataface/Application.php(3933) : eval()'d code on line 1
Warning: Trying to access array offset on value of type null in ~/public_html/xataface10july/Dataface/Application.php(3933) : eval()'d code on line 1
Warning: Undefined array key "history__id" in ~/public_html/xataface10july/Dataface/Application.php(3808) : eval()'d code on line 1
Warning: Undefined array key "_output_cache" in ~/public_html/xataface10july/Dataface/Application.php(3933) : eval()'d code on line 1
Warning: Undefined array key "-relationship" in ~/public_html/xataface10july/Dataface/Application.php(3933) : eval()'d code on line 1
Warning: Undefined array key "-relationship" in ~/public_html/xataface10july/Dataface/Application.php(3933) : eval()'d code on line 1
Warning: Undefined array key "_auth" in ~/public_html/xataface10july/Dataface/Application.php(3933) : eval()'d code on line 1
Deprecated: Function money_format() is deprecated in ~/public_html/xataface10july/Dataface/Table.php on line 5591

Steve Hannah

unread,
Jul 13, 2021, 10:30:20 AM7/13/21
to xata...@googlegroups.com
Looks like money_format is deprecated so the money_format directive is failing.  Will need to create a PHP fallback function for this.  

The rest of the warnings should be suppressed unless you are running with debug=1 in conf.ini

--
You received this message because you are subscribed to the Google Groups "Xataface" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xataface+u...@googlegroups.com.

Muzafar Shah

unread,
Jul 14, 2021, 7:08:11 AM7/14/21
to Xataface
Nope, I didn't run the ant script on xataface directory. I have diagnosed the issue and it is due to getPreferences() function, But I really don't know why it is throwing errors here on a new version. Below is the code of getPrerferences in conf/ApplicationDelegate.php. If I remove the below function, the page works fine.

function getPreferences(){ 
    $app =& Dataface_Application::getInstance();
    $user = Dataface_AuthenticationTool::getInstance()->getLoggedInUser();
    $query =& $app->getQuery();
   
 if ( !isset($user) )return Dataface_PermissionsTool::NO_ACCESS();
     $role = $user->val('role');
     switch ($role){
       case 'Admin':
       case 'Partner':
       case 'Regular':
       case 'Con':
       case 'Staff':
       case 'FFStaff':return array('disable_ajax_record_details'=>0);
       default:return Dataface_PermissionsTool::NO_ACCESS();
     }
   }

Steve Hannah

unread,
Jul 14, 2021, 7:34:53 AM7/14/21
to xata...@googlegroups.com
Why do you think the problem is in getPreferences?  What error/stack trace do you get that suggests that?

--
You received this message because you are subscribed to the Google Groups "Xataface" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xataface+u...@googlegroups.com.

Muzafar Shah

unread,
Jul 14, 2021, 9:09:43 AM7/14/21
to Xataface
I have on error reporting as you can see in the attached screen, and it has thrown the same error of getAction()

This is strangely works when I remove getPreferences function.

issue.png
Message has been deleted

webm...@mycascadescenter.org

unread,
Jul 24, 2021, 12:35:49 PM7/24/21
to Xataface
github 18jul runs on php7.4, but 8.0 still breaks on money_format

Xataface

unread,
Sep 18, 2023, 2:51:34 PM9/18/23
to Xataface
just tried php8, got bit by this...
[18-Sep-2023 18:45:35 UTC] PHP Fatal error: Uncaught Error: Call to undefined function money_format() in /home/cardin55/public_html/hoaDB/xataface22may23/Dataface/Table.php:5523 any suggestions?


Steve Hannah

unread,
Sep 23, 2023, 9:06:09 AM9/23/23
to xata...@googlegroups.com
PHP 8 removed the money_format function.  Xataface should use it only if you specify the "money_format" property in your fields.ini file somewhere. Here is where it is used:
https://github.com/shannah/xataface/blob/8c9eb4086a1978ebf3b8c5f1dcf3fbadca0f1499/Dataface/Table.php#L5507

It should be replaced with NumberFormatter::formatCurrency().  Should be a simple change.

If you get it working, please consider submitting a PR.

On Mon, Sep 18, 2023 at 11:51 AM 'Xataface' via Xataface <xata...@googlegroups.com> wrote:
just tried php8, got bit by this...
[18-Sep-2023 18:45:35 UTC] PHP Fatal error: Uncaught Error: Call to undefined function money_format() in /home/cardin55/public_html/hoaDB/xataface22may23/Dataface/Table.php:5523 any suggestions?


--
You received this message because you are subscribed to the Google Groups "Xataface" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xataface+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages