Project

General

Profile

Actions

Bug #91170

closed

PHP Warning: mb_strlen() expects parameter 1 to be string, array given in /srv/www/htdocs/t3intranetnedev/web/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php line 3371

Added by Bernd Wilke over 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Install Tool
Target version:
-
Start date:
2020-04-22
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

I tried to open the ADMIN TOOL -> Settings -> Configure Installation-Wide Options

and got the error:


(1/1) #1476107295 TYPO3\CMS\Core\Error\Exception

PHP Warning: mb_strlen() expects parameter 1 to be string, array given in /srv/www/htdocs/t3intranetnedev/web/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php line 3371
in /srv/www/htdocs/t3intranetnedev/web/typo3/sysext/core/Classes/Error/ErrorHandler.php line 124

            E_DEPRECATED => 'PHP Runtime Deprecation Notice'
        ];
        $message = $errorLevels[$errorLevel] . ': ' . $errorMessage . ' in ' . $errorFile . ' line ' . $errorLine;
        if ($errorLevel & $this->exceptionalErrors) {
            throw new Exception($message, 1476107295);
        }
        switch ($errorLevel) {
            case E_USER_ERROR:
            case E_RECOVERABLE_ERROR:

at TYPO3\CMS\Core\Error\ErrorHandler->handleError(2, 'mb_strlen() expects parameter 1 to be string, array given', '/srv/www/htdocs/t3intranetnedev/web/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php', 3371, array('content' => array('http' => 'proxyad.itk.local:8080', 'https' => 'proxyad.itk.local:8080', 'no' => array('localhost', 'itk.local', 'idmz.local')), 'options' => array('40', '…', ''), 'chars' => 40, 'afterstring' => '…', 'crop2space' => ''))
at mb_strlen(array('http' => 'proxyad.itk.local:8080', 'https' => 'proxyad.itk.local:8080', 'no' => array('localhost', 'itk.local', 'idmz.local')), 'utf-8')
in /srv/www/htdocs/t3intranetnedev/web/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php line 3371

        $chars = (int)$options[0];
        $afterstring = trim($options[1] ?? '');
        $crop2space = trim($options[2] ?? '');
        if ($chars) {
            if (mb_strlen($content, 'utf-8') > abs($chars)) {
                $truncatePosition = false;
                if ($chars < 0) {
                    $content = mb_substr($content, $chars, null, 'utf-8');
                    if ($crop2space) {

at TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer->crop(array('http' => 'proxyad.itk.local:8080', 'https' => 'proxyad.itk.local:8080', 'no' => array('localhost', 'itk.local', 'idmz.local')), array('40', '&hellip;', ''))
in /srv/www/htdocs/t3intranetnedev/web/typo3/sysext/fluid/Classes/ViewHelpers/Format/CropViewHelper.php line 136

        $contentObject = GeneralUtility::makeInstance(ContentObjectRenderer::class);
        if ($respectHtml) {
            $content = $contentObject->cropHTML($stringToTruncate, $maxCharacters . '|' . $append . '|' . $respectWordBoundaries);
        } else {
            $content = $contentObject->crop($stringToTruncate, $maxCharacters . '|' . $append . '|' . $respectWordBoundaries);
        }

        return $content;
    }

at TYPO3\CMS\Fluid\ViewHelpers\Format\CropViewHelper::renderStatic(array('maxCharacters' => 40, 'append' => '&hellip;', 'respectWordBoundaries' => false, 'respectHtml' => false), object(Closure), object(TYPO3\CMS\Fluid\Core\Rendering\RenderingContext))
in /srv/www/htdocs/t3intranetnedev/vendor/typo3fluid/fluid/src/Core/ViewHelper/Traits/CompileWithRenderStatic.php line 30

    {
        return static::renderStatic(
            $this->arguments,
            $this->buildRenderChildrenClosure(),
            $this->renderingContext
        );
    }

    /**

at TYPO3\CMS\Fluid\ViewHelpers\Format\CropViewHelper->render()
at call_user_func(array(object(TYPO3\CMS\Fluid\ViewHelpers\Format\CropViewHelper), 'render'))
in /srv/www/htdocs/t3intranetnedev/vendor/typo3fluid/fluid/src/Core/ViewHelper/AbstractViewHelper.php line 262

     */
    protected function callRenderMethod()
    {
        if (method_exists($this, 'render')) {
            return call_user_func([$this, 'render']);
        }
        if ((new \ReflectionMethod($this, 'renderStatic'))->getDeclaringClass()->getName() !== AbstractViewHelper::class) {
            // Method is safe to call - will not recurse through ViewHelperInvoker via the default
            // implementation of renderStatic() on this class.

at TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper->callRenderMethod()
in /srv/www/htdocs/t3intranetnedev/vendor/typo3fluid/fluid/src/Core/ViewHelper/AbstractViewHelper.php line 250

    {
        $this->validateArguments();
        $this->initialize();

        return $this->callRenderMethod();
    }

    /**
     * Call the render() method and handle errors.

at TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper->initializeArgumentsAndRender()
in /srv/www/htdocs/t3intranetnedev/vendor/typo3fluid/fluid/src/Core/ViewHelper/ViewHelperInvoker.php line 79

            }
            $viewHelper->setRenderingContext($renderingContext);
            $viewHelper->setArguments($evaluatedArguments);
            $viewHelper->handleAdditionalArguments($undeclaredArguments);
            return $viewHelper->initializeArgumentsAndRender();
        } catch (Exception $error) {
            return $renderingContext->getErrorHandler()->handleViewHelperError($error);
        }
    }

at TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperInvoker->invoke(object(TYPO3\CMS\Fluid\ViewHelpers\Format\CropViewHelper), array('maxCharacters' => 40, 'respectWordBoundaries' => object(TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\BooleanNode), 'respectHtml' => object(TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\BooleanNode)), object(TYPO3\CMS\Fluid\Core\Rendering\RenderingContext))
in /srv/www/htdocs/t3intranetnedev/vendor/typo3fluid/fluid/src/Core/Parser/SyntaxTree/ViewHelperNode.php line 153

     * @return string evaluated node after the view helper has been called.
     */
    public function evaluate(RenderingContextInterface $renderingContext)
    {
        return $renderingContext->getViewHelperInvoker()->invoke($this->uninitializedViewHelper, $this->arguments, $renderingContext);
    }

    /**
     * Wraps the argument tree, if a node is boolean, into a Boolean syntax tree node

at TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\ViewHelperNode->evaluate(object(TYPO3\CMS\Fluid\Core\Rendering\RenderingContext))
in /srv/www/htdocs/t3intranetnedev/vendor/typo3fluid/fluid/src/Core/Parser/SyntaxTree/AbstractNode.php line 56

     * @return mixed
     */
    protected function evaluateChildNode(NodeInterface $node, RenderingContextInterface $renderingContext, $cast)
    {
        $output = $node->evaluate($renderingContext);
        if ($cast) {
            $output = $this->castToString($output);
        }
        return $output;

at TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\AbstractNode->evaluateChildNode(object(TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\ViewHelperNode), object(TYPO3\CMS\Fluid\Core\Rendering\RenderingContext), false)
in /srv/www/htdocs/t3intranetnedev/vendor/typo3fluid/fluid/src/Core/Parser/SyntaxTree/AbstractNode.php line 36

    public function evaluateChildNodes(RenderingContextInterface $renderingContext)
    {
        $evaluatedNodes = [];
        foreach ($this->getChildNodes() as $childNode) {
            $evaluatedNodes[] = $this->evaluateChildNode($childNode, $renderingContext, false);
        }
        // Make decisions about what to actually return
        if (empty($evaluatedNodes)) {
            return null;

at TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\AbstractNode->evaluateChildNodes(object(TYPO3\CMS\Fluid\Core\Rendering\RenderingContext))
in /srv/www/htdocs/t3intranetnedev/vendor/typo3fluid/fluid/src/Core/ViewHelper/AbstractViewHelper.php line 304

        if ($this->renderChildrenClosure !== null) {
            $closure = $this->renderChildrenClosure;
            return $closure();
        }
        return $this->viewHelperNode->evaluateChildNodes($this->renderingContext);
    }

    /**
     * Helper which is mostly needed when calling renderStatic() from within

at TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper->renderChildren()
in /srv/www/htdocs/t3intranetnedev/vendor/typo3fluid/fluid/src/Core/ViewHelper/AbstractConditionViewHelper.php line 176

        if ($elseViewHelperEncountered) {
            return '';
        } else {
            return $this->renderChildren();
        }
    }

    /**
    :
    :
    :

the reason:
as we have a very special network we need a special proxy-configuration in LocalConfiguration.php:

    'HTTP' => [
        'proxy' => [
            'http' => 'proxyad.internal.local:8080',
            'https' => 'proxyad.internal.local:8080',
            'no' => [
                'localhost',
                'internal.local',
                'idmz.local',
            ]
        ]
    ],

which works (especially for solr indexing).

without these lines I can access the 'Configure Installation-Wide Options'


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #88835: fatal error in settings-controller when [HTTP][proxy] is arrayClosed2019-07-24

Actions
Actions #1

Updated by Georg Ringer about 4 years ago

  • Related to Bug #88835: fatal error in settings-controller when [HTTP][proxy] is array added
Actions #2

Updated by Georg Ringer about 4 years ago

  • Status changed from New to Closed

this has been fixed with #88835

Actions

Also available in: Atom PDF