ryancramerdesign / InputfieldTinyMCE

TinyMCE v6 for ProcessWire 3.0.200+
2 stars 2 forks source link

Fatal Error: Uncaught TypeError: substr_count() #17

Closed flipzoom closed 1 year ago

flipzoom commented 2 years ago

I have just installed TinyMCE in a very fresh installation to test it and unfortunately run into a fatal error. Possible problem: I have deactivated all checkboxes, i.e. no default settings. I wanted to set these individually for each field.

Fatal Error: Uncaught TypeError: substr_count(): Argument #1 ($haystack) must be of type string, array given in /site/modules/InputfieldTinyMCE/InputfieldTinyMCEConfigs.php:1063 Stack trace:
1. /site/modules/InputfieldTinyMCE/InputfieldTinyMCEConfigs.php(1063): substr_count()
2. /site/modules/InputfieldTinyMCE/InputfieldTinyMCEConfigs.php(854): InputfieldTinyMCEConfigs->configInvalidStyles()
3. /site/modules/InputfieldTinyMCE/InputfieldTinyMCE.module.php(826): InputfieldTinyMCEConfigs->getModuleConfigInputfields()
4. /wire/core/Modules.php(4112): InputfieldTinyMCE->getModuleConfigInputfields()
5. /wire/core/Wire.php(419): Modules->___getModuleConfigInputfields()
6. /wire/core/WireHooks.php(952): Wire->_callMethod()
7. /wire/core/Wire.php(484): WireHooks->runHooks()
8. /wire/modules/Process/ProcessModule/ProcessModule.module(1680): Wire->__call()
9. /wire/modules/Process/ProcessModule/ProcessModule.module(1415): ProcessModule->renderEdit()
10. /wire/core/Wire.php(413): ProcessModule->___executeEdit()
11. /wire/core/WireHooks.php(952): Wire->_callMethod()
12. /wire/core/Wire.php(484): WireHooks->runHooks()
13. /wire/core/ProcessController.php(350): Wire->__call()
14. /wire/core/Wire.php(413): ProcessController->___execute()
15. /wire/core/WireHooks.php(952): Wire->_callMethod()
16. /wire/core/Wire.php(484): WireHooks->runHooks()
17. /wire/core/admin.php(160): Wire->__call()
18. /site/templates/admin.php(18): require('...')
19. /wire/core/TemplateFile.php(328): require('...')
20. /wire/core/Wire.php(413): TemplateFile->___render()
21. /wire/core/WireHooks.php(952): Wire->_callMethod()
22. /wire/core/Wire.php(484): WireHooks->runHooks()
23. /wire/modules/PageRender.module(575): Wire->__call()
24. /wire/core/Wire.php(416): PageRender->___renderPage()
25. /wire/core/WireHooks.php(952): Wire->_callMethod()
26. /wire/core/Wire.php(484): WireHooks->runHooks()
27. /wire/core/WireHooks.php(1060): Wire->__call()
28. /wire/core/Wire.php(484): WireHooks->runHooks()
29. /wire/modules/Process/ProcessPageView.module(184): Wire->__call()
30. /wire/modules/Process/ProcessPageView.module(114): ProcessPageView->renderPage()
31. /wire/core/Wire.php(416): ProcessPageView->___execute()
32. /wire/core/WireHooks.php(952): Wire->_callMethod()
33. /wire/core/Wire.php(484): WireHooks->runHooks()
34. /var/www/vhosts/XXXXXXXXXX/index.php(55): Wire->__call() #34 {main} thrown
Line 1063 of /site/modules/InputfieldTinyMCE/InputfieldTinyMCEConfigs.php

PW: 3.0.207 dev TinyMCE: v6.0.8 Beta PHP: 8.1.13

ryancramerdesign commented 2 years ago

@FlipZoomMedia Thanks, I've pushed a fix for this.

flipzoom commented 2 years ago

Thanks, works.

flipzoom commented 2 years ago

Hi @ryancramerdesign, sorry, problem not solved after all, now in another place. When I edit a page where a TinyMCE field is placed, this now comes up.

Excuse me… Fatal Error: Uncaught TypeError: strpos(): Argument #1 ($haystack) must be of type string, array given in site/modules/InputfieldTinyMCE/InputfieldTinyMCEFormats.php:416

#0 site/modules/InputfieldTinyMCE/InputfieldTinyMCEFormats.php (416): strpos()
#1 site/modules/InputfieldTinyMCE/InputfieldTinyMCESettings.php (78): InputfieldTinyMCEFormats->getInvalidStyles()
#2 site/modules/InputfieldTinyMCE/InputfieldTinyMCESettings.php (624): InputfieldTinyMCESettings->getSettings()
#3 site/modules/InputfieldTinyMCE/InputfieldTinyMCE.module.php(591): InputfieldTinyMCESettings->applyRenderReadySettings()
#4 wire/core/InputfieldWrapper.php (1069): InputfieldTinyMCE->renderReady()
#5 wire/core/Wire.php (419): InputfieldWrapper->___renderInputfield()
#6 wire/core/WireHooks.php (952): Wire->_callMethod()
#7 wire/core/Wire.php (484): WireHooks->runHooks()
#8 wire/core/InputfieldWrapper.php (768): Wire->__call()
#9 wire/core/Wire.php (413): InputfieldWrapper->___render()
#10 wire/core/WireHooks.php (952): Wire->_callMethod()
#11 wire/core/Wire.php (484): WireHooks->runHooks()
#12 wire/core/InputfieldWrapper.php (1096): Wire->__call()
#13 wire/core/Wire.php (419): InputfieldWrapper->___renderInputfield()
#14 wire/core/WireHooks.php (952): Wire->_callMethod()
#15 wire/core/Wire.php (484): WireHooks->runHooks()
#16 wire/core/InputfieldWrapper.php (768): Wire->__call()
#17 wire/modules/Inputfield/InputfieldForm.module (187): InputfieldWrapper->___render()
#18 wire/core/Wire.php (413): InputfieldForm->___render()
#19 wire/core/WireHooks.php (952): Wire->_callMethod()
#20 wire/core/Wire.php (484): WireHooks->runHooks()
#21 wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module (609): Wire->__call()
#22 wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module (575): ProcessPageEdit->renderEdit()
#23 wire/core/Wire.php (413): ProcessPageEdit->___execute()
#24 wire/core/WireHooks.php (952): Wire->_callMethod()
#25 wire/core/Wire.php (484): WireHooks->runHooks()
#26 wire/core/ProcessController.php (350): Wire->__call()
#27 wire/core/Wire.php (413): ProcessController->___execute()
#28 wire/core/WireHooks.php (952): Wire->_callMethod()
#29 wire/core/Wire.php (484): WireHooks->runHooks()
#30 wire/core/admin.php (160): Wire->__call()
#31 site/templates/admin.php (18): require('...')
#32 wire/core/TemplateFile.php (328): require('...')
#33 wire/core/Wire.php (413): TemplateFile->___render()
#34 wire/core/WireHooks.php (952): Wire->_callMethod()
#35 wire/core/Wire.php (484): WireHooks->runHooks()
#36 wire/modules/PageRender.module (575): Wire->__call()
#37 wire/core/Wire.php (416): PageRender->___renderPage()
#38 wire/core/WireHooks.php (952): Wire->_callMethod()
#39 wire/core/Wire.php (484): WireHooks->runHooks()
#40 wire/core/WireHooks.php (1060): Wire->__call()
#41 wire/core/Wire.php (484): WireHooks->runHooks()
#42 wire/modules/Process/ProcessPageView.module (184): Wire->__call()
#43 wire/modules/Process/ProcessPageView.module (114): ProcessPageView->renderPage()
#44 wire/core/Wire.php (416): ProcessPageView->___execute()
#45 wire/core/WireHooks.php (952): Wire->_callMethod()
#46 wire/core/Wire.php (484): WireHooks->runHooks()
#47 index.php (55): Wire->__call()
#48 {main}
thrown (line 416 of site/modules/InputfieldTinyMCE/InputfieldTinyMCEFormats.php)
ryancramerdesign commented 2 years ago

Thanks @FlipZoomMedia I've pushed another update to correct this.