Manager throws Error 500 when editing resource: CB error

MODX2 site, updated to 2.8.7. and CB 1.13.4.:

Site works on frontend. Manager works, too, but throws Error 500 when clicking on a resource in the tree. Server shows this log:

[24-Apr-2024 06:35:30 Europe/Berlin] PHP Fatal error:  Uncaught TypeError: cbBaseInput::parsePathProperties(): Argument #1 ($properties) must be of type array, string given, called in /www/htdocs/PATH/DOMAIN/core/components/contentblocks/model/contentblocks/contentblocks.class.php on line 302 and defined in /www/htdocs/PATH/DOMAIN/core/components/contentblocks/model/contentblocks/cbinput.class.php:206
Stack trace:
#0 /www/htdocs/PATH/DOMAIN/core/components/contentblocks/model/contentblocks/contentblocks.class.php(302): cbBaseInput->parsePathProperties('')
#1 /www/htdocs/PATH/DOMAIN/core/components/contentblocks/model/contentblocks/contentblocks.class.php(227): ContentBlocks->_prepareFieldForCanvas(Object(cbField_mysql), Object(modDocument_mysql))
#2 /www/htdocs/PATH/DOMAIN/core/cache/includes/elements/modplugin/11.include.cache.php(132): ContentBlocks->getObjectsForCanvas(Object(modDocument_mysql))
#3 /www/htdocs/PATH/DOMAIN/core/model/modx/modscript.class.php(76): include('/www/htdocs/w00...')
#4 /www/htdocs/PATH/DOMAIN/core/model/modx/modx.class.php(1674): modScript->process(NULL)
#5 /www/htdocs/PATH/DOMAIN/manager/controllers/default/resource/resource.class.php(169): modX->invokeEvent('OnDocFormPreren...', Array)
#6 /www/htdocs/PATH/DOMAIN/core/model/modx/modmanagercontroller.class.php(164): ResourceManagerController->firePreRenderEvents()
#7 /www/htdocs/PATH/DOMAIN/core/model/modx/modmanagerresponse.class.php(79): modManagerController->render()
#8 /www/htdocs/PATH/DOMAIN/core/model/modx/modmanagerrequest.class.php(187): modManagerResponse->outputContent(Array)
#9 /www/htdocs/PATH/DOMAIN/core/model/modx/modmanagerrequest.class.php(135): modManagerRequest->prepareResponse()
#10 /www/htdocs/PATH/DOMAIN/manager/index.php(59): modManagerRequest->handleRequest()
#11 {main}
  thrown in /www/htdocs/PATH/DOMAIN/core/components/contentblocks/model/contentblocks/cbinput.class.php on line 206

What can I do?

Very short-term fix you can try re-saving fields in the manager - especially older ones that may not have had any properties saved. If you have a lot of fields, checking in the modx_contentblocks_fields table for fields that do not have properties would help narrow down the list of fields to check.

That does look a lot like a bug we need to fix in an update though. I’ll try to take a look at that ASAP.

1 Like

Hi Mark,

The short-term fix (saving all fields) worked! Thanks so much for your quick solution!