Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
saschanos opened this issue Jul 25, 2024 · 13 comments

Comments

@saschanos
Copy link

saschanos commented Jul 25, 2024

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
@ryancramerdesign
Copy link
Member

@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

@saschanos
Copy link
Author

@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
Copy link
Author

@ryancramerdesign, is there any update? :)

@matjazpotocnik
Copy link
Collaborator

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

@saschanos
Copy link
Author

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

@matjazpotocnik
Copy link
Collaborator

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

@saschanos
Copy link
Author

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

@matjazpotocnik
Copy link
Collaborator

matjazpotocnik commented Dec 30, 2024

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

@saschanos
Copy link
Author

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

@ryancramerdesign
Copy link
Member

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?

@saschanos
Copy link
Author

saschanos commented Jan 13, 2025

  • 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

@matjazpotocnik
Copy link
Collaborator

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

@saschanos
Copy link
Author

Works perfect. Thank you! <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants