3

Hello I am facing the issue after upgrade from 2.2.6 to 2.3.0 Can you suggest what is needed to be modified?

  1. file __.php :

<?php

declare(strict_types=1);

function __()
{
  $argc = func_get_args();



$text = array_shift($argc);
if (!empty($argc) && is_array($argc[0])) {
    $argc = $argc[0];
}

return new \Magento\Framework\Phrase($text, $argc);
}

2.file - functions.php:

$text = array_shift($argc);
if (!empty($argc) && is_array($argc[0])) {
    $argc = $argc[0];
}

return new \Magento\Framework\Phrase($text, $argc);
}
1
  • Were you ever able to resolve this? I recently ran into the same issue while trying to upgrade from 2.2.1 to 2.3 :( – Daniel Black Apr 17 '19 at 18:22
6

This is original content of app/functions.php file:

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

/**
 * Create value-object \Magento\Framework\Phrase
 * @deprecated The global function __() is now loaded via Magento Framework, the below require is only
 *             for backwards compatibility reasons and this file will be removed in a future version
 * @see        Magento\Framework\Phrase\__.php
 * @SuppressWarnings(PHPMD.ShortMethodName)
 * @return \Magento\Framework\Phrase
 */
if (!function_exists('__')) {
    function __()
    {
        $argc = func_get_args();

        $text = array_shift($argc);
        if (!empty($argc) && is_array($argc[0])) {
            $argc = $argc[0];
        }

        return new \Magento\Framework\Phrase($text, $argc);
    }
}

If your file has different content, please change it to the above one

1
  • 1
    Thanks Adrian, unfortunately I am still having the same issue. – Arnaldo Serrano Jan 21 '19 at 14:57
1

Just try to remove vendor,var/ and run composer install command:

rm -rf vendor/* && composer install

0

I ran into this problem with a site running Magento 2.3.3 and the Fishpig_Root (and Shortcode) module(s).

There is an update for Fishpig_Root available that resolves it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.