processwire-issues icon indicating copy to clipboard operation
processwire-issues copied to clipboard

Uncaught TypeError: strpos(): Argument #1 ($haystack) must be of type string, array given in wire/core/Process.php:254

Open saschanos opened this issue 1 year ago • 3 comments

Short description of the issue

FieldTypeRepeaterMatrix does not work anymore an error in the network console for /cms-admin/page/edit/?id=1558&field=offers&repeater_edit=1560 is thrown

Expected behavior

When open the tab in the admin area it displays the content

Actual behavior

The tab does not open anymore; it just shown a loading sign; exception thrown:

Warning: Array to string conversion in /vendor/processwire/processwire/wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module on line 3346

Not again… Fatal Error: Uncaught TypeError: strpos(): Argument #1 ($haystack) must be of type string, array given in wire/core/Process.php:254

#0 wire/core/Process.php (254): strpos(Array, '/')
#1 wire/core/Wire.php (419): Process->___breadcrumb('./?id=1558', Array)
#2 wire/core/WireHooks.php (968): Wire->_callMethod('___breadcrumb', Array)
#3 wire/core/Wire.php (484): WireHooks->runHooks(Object(ProcessPageEdit), 'breadcrumb', Array)
#4 wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module (3411): Wire->__call('breadcrumb', Array)
#5 wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module (455): ProcessPageEdit->setupBreadcrumbs()
#6 wire/core/ModulesLoader.php (168): ProcessPageEdit->init()
#7 wire/core/Modules.php (625): ModulesLoader->initModule(Object(ProcessPageEdit), Array)
#8 wire/core/ProcessController.php (178): Modules->getModule('ProcessPageEdit', Array)
#9 wire/core/ProcessController.php (334): ProcessController->getProcess()
#10 wire/core/Wire.php (413): ProcessController->___execute()
#11 wire/core/WireHooks.php (968): Wire->_callMethod('___execute', Array)
#12 wire/core/Wire.php (484): WireHooks->runHooks(Object(ProcessController), 'execute', Array)
#13 wire/core/admin.php (174): Wire->__call('execute', Array)
#14 wire/modules/AdminTheme/AdminThemeUikit/controller.php (15): require('/Users/XXX/P...')
#15 site/templates/admin.php (17): require('/Users/XXX/P...')
#16 wire/core/TemplateFile.php (328): require('/Users/XXX/P...')
#17 wire/core/Wire.php (413): TemplateFile->___render()
#18 wire/core/WireHooks.php (968): Wire->_callMethod('___render', Array)
#19 wire/core/Wire.php (484): WireHooks->runHooks(Object(TemplateFile), 'render', Array)
#20 wire/modules/PageRender.module (581): Wire->__call('render', Array)
#21 wire/core/Wire.php (416): PageRender->___renderPage(Object(HookEvent))
#22 wire/core/WireHooks.php (968): Wire->_callMethod('___renderPage', Array)
#23 wire/core/Wire.php (484): WireHooks->runHooks(Object(PageRender), 'renderPage', Array)
#24 wire/core/WireHooks.php (1094): Wire->__call('renderPage', Array)
#25 wire/core/Wire.php (484): WireHooks->runHooks(Object(Page), 'render', Array)
#26 wire/modules/Process/ProcessPageView.module (184): Wire->__call('render', Array)
#27 wire/modules/Process/ProcessPageView.module (114): ProcessPageView->renderPage(Object(Page), Object(PagesRequest))
#28 wire/core/Wire.php (416): ProcessPageView->___execute(true)
#29 wire/core/WireHooks.php (968): Wire->_callMethod('___execute', Array)
#30 wire/core/Wire.php (484): WireHooks->runHooks(Object(ProcessPageView), 'execute', Array)
#31 index.php (66): Wire->__call('execute', Array)
#32 {main}
thrown (line 254 of wire/core/Process.php)

Optional: Screenshots/Links that demonstrate the issue

Bildschirmfoto 2024-07-25 um 12 37 27

Setup/Environment

  • ProcessWire version: 240 (my check says bug was introduced with between 236 and 237)
  • PHP version: 8.1

saschanos avatar Jul 25 '24 10:07 saschanos

@saschanos This was an issue in RepeaterMatrix. Do you have access to the ProFields support boards? There an updated file that fixes it posted here

ryancramerdesign avatar Jul 26 '24 19:07 ryancramerdesign

@ryancramerdesign, great. Would it be possible to create a new version which contains the fix? I think it will make it more easy for everyone to use it :).

saschanos avatar Jul 27 '24 11:07 saschanos

@ryancramerdesign, is there any update? :)

saschanos avatar Sep 26 '24 14:09 saschanos

@saschanos, I'm closing this one as it's not a core issue. Please use the ProFields support board.

matjazpotocnik avatar Dec 14 '24 18:12 matjazpotocnik

@matjazpotocnik, modules/Process/ProcessPageEdit/ProcessPageEdit.module is a core module :(

saschanos avatar Dec 30 '24 12:12 saschanos

@saschanos, yes, of course, but Ryan said that this was an issue in RepeaterMatrix?

matjazpotocnik avatar Dec 30 '24 12:12 matjazpotocnik

Okay. So I need to create another issue there or will you handle it internally?

saschanos avatar Dec 30 '24 12:12 saschanos

What do you mean internally? Only Ryan offers support for pro modules. Can't you download the modified file from the link Ryan provided?

matjazpotocnik avatar Dec 30 '24 14:12 matjazpotocnik

Issue is still existing; answered in the thread provided by Ryan. Have a nice weekend!

saschanos avatar Jan 04 '25 13:01 saschanos

I'm going to re-open because it looks like the issue started between core versions. I don't know if it's a core or Matrix issue, but starting as a result of a core upgrade points more to potential core issue. @saschanos Can you describe the steps necessary to reproduce the issue?

ryancramerdesign avatar Jan 11 '25 16:01 ryancramerdesign

  • Edit page
  • Edit field from type "repeaterMatrix"
  • Edit child containing the following fields (screenshot-1)
  • when now opening the repeater "offers" (which is a repeater; fields see screenshot-2) the error above is produced
screenshot-1 screenshot-2

saschanos avatar Jan 13 '25 09:01 saschanos

@saschanos can you try the latest dev 3.0.245, there is a commit https://github.com/processwire/processwire/commit/1805ad0a599156bba34b72e6104abad8d4cd3417 that might solve the issue. Please report back.

matjazpotocnik avatar Feb 04 '25 04:02 matjazpotocnik

Works perfect. Thank you! <3

saschanos avatar Mar 16 '25 09:03 saschanos