Help! PHP Fatal error: Uncaught TypeError: strpos(): Argument #1 ($haystack) must be of type string, array given in

60 views
Skip to first unread message

Gary Woodruff

unread,
Feb 15, 2024, 4:30:22 PMFeb 15
to Xataface
I have a field that stores a 1,2 or 3 from a checkbox selection. All works fine except when I try to batch update records, it throws the error:  PHP Fatal error:  Uncaught TypeError: strpos(): Argument #1 ($haystack) must be of type string, array given in /srv/http/....


Steve Hannah

unread,
Feb 16, 2024, 6:11:18 PMFeb 16
to xata...@googlegroups.com
Is there any more to that error message?  It got cut off before it got to the file name or line number

On Thu, Feb 15, 2024 at 1:30 PM Gary Woodruff <bristolm...@gmail.com> wrote:
I have a field that stores a 1,2 or 3 from a checkbox selection. All works fine except when I try to batch update records, it throws the error:  PHP Fatal error:  Uncaught TypeError: strpos(): Argument #1 ($haystack) must be of type string, array given in /srv/http/....


--
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/4c3fdccd-e23d-4746-89f4-3116f5b52d88n%40googlegroups.com.


--
Steve Hannah
Web Lite Solutions Corp.
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

Gary Woodruff

unread,
Mar 3, 2024, 3:29:23 PMMar 3
to Xataface
I installed the new code and now get an error as soon as I select update, this is a change from previously as now I cannot use the update function for any table.

[php:error] [pid 928] [client 192.168.0.5:51590] PHP Fatal error:  Uncaught TypeError: array_keys(): Argument #1 ($array) must be of type array, null given in /srv/http/xataface/actions/copy_replace.php:201\nStack trace:\n#0 /srv/http/xataface/actions/copy_replace.php(201): array_keys()\n#1 /srv/http/xataface/actions/copy_replace.php(78): dataface_actions_copy_replace->addFields()\n#2 /srv/http/xataface/Dataface/Application.php(3715): dataface_actions_copy_replace->handle()\n#3 /srv/http/xataface/Dataface/Application.php(3857): Dataface_Application->handleRequest()\n#4 /srv/http/xataface/Dataface/Application.php(3743): Dataface_Application->_display()\n#5 /srv/http/BMdata/index.php(51): Dataface_Application->display()\n#6 {main}\n  thrown in /srv/http/xataface/actions/copy_replace.php on line 201, referer: http://192.168.0.5/BMdata/index.php?-table=Batch
 I am also struggling to use google groups, can post a new message but any reply seems to get deleted after receiving the message it succesfully posted.

Steve Hannah

unread,
Mar 4, 2024, 6:33:46 PMMar 4
to xata...@googlegroups.com, Gary Woodruff
Hi Gary,

The error message suggests that the call to array_keys() on line 201 of copy_replace.php received a null input.  I'm looking through this file on the master branch(https://github.com/shannah/xataface/blob/master/actions/copy_replace.php) and I don't see any possible way it could have received null there.

Can you share the copy_replace.php file that you are using so I can take a look?  Just in case it is different.

Steve


Gary Woodruff

unread,
Mar 5, 2024, 3:44:29 PMMar 5
to Xataface

Hi Steve, I will attach the file. I cant view a record with the new code from master, here is the error:

  PHP Fatal error: Uncaught Error: Call to a member function fields() on null in /srv/http/xataface/Dataface/RecordView.php:31\nStack trace:\n#0 /srv/http/xataface/Dataface/SkinTool.php(578): Dataface_RecordView->__construct()\n#1 /srv/http/BMdata/templates_c/dataface/%%C1^C17^C174B680%%Dataface_View_Record.html.php(15): Dataface_SkinTool->record_view()\n#2 /srv/http/xataface/lib/Smarty/Smarty.class.php(1259): include('...')\n#3 /srv/http/xataface/lib/Smarty/Smarty.class.php(1109): Smarty->fetch()\n#4 /srv/http/xataface/Dataface/SkinTool.php(425): Smarty->display()\n#5 /srv/http/xataface/public-api.php(635): Dataface_SkinTool->display()\n#6 /srv/http/xataface/actions/default.php(51): df_display()\n#7 /srv/http/xataface/Dataface/Application.php(3715): dataface_actions_default->handle()\n#8 /srv/http/xataface/Dataface/Application.php(3857): Dataface_Application->handleRequest()\n#9 /srv/http/xataface/Dataface/Application.php(3743): Dataface_Application->_display()\n#10 /srv/http/BMdata/index.php(51): Dataface_Application->display()\n#11 {main}\n thrown in /srv/http/xataface/Dataface/RecordView.php on line 31, referer: http://192.168.0.5/BMdata/index.php?-table=Batch

[Tue Mar 05 08:56:14.184972 2024] [authz_core:debug] [pid 914] mod_authz_core.c(815): [client 192.168.0.6:53302] AH01626: authorization result of Require all granted: granted
copy_replace.php
Reply all
Reply to author
Forward
Message has been deleted
0 new messages