Skip to content
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

It is not possible to edit the "Back office translations" in PrestaShop 1.7.6.1 child theme #15268

Open
Flower7C3 opened this issue Aug 26, 2019 · 19 comments

Comments

@Flower7C3
Copy link

@Flower7C3 Flower7C3 commented Aug 26, 2019

Describe the bug

I am still unable to edit theme translations for child themes. Same error occurs as before. Here is my stack trace for XHR request https://example/com/admin-dev/index.php/api/translations/tree/pl/themes/PRSADD054_ettoi?_token=OfOaV_aHoK1-I2RK2MClfyACxzg-Te5TQUy-Rgtjwx8

Related to #14733

stacktrace
array(10) {
  [0]=>
  array(6) {
    ["file"]=>
    string(122) "/var/www/vendor/prestashop/translationtools-bundle/Translation/Extractor/Util/Flattenizer.php"
    ["line"]=>
    int(83)
    ["function"]=>
    string(2) "in"
    ["class"]=>
    string(31) "Symfony\Component\Finder\Finder"
    ["type"]=>
    string(2) "->"
    ["args"]=>
    array(1) {
      [0]=>
      string(93) "/var/www/var/cache/dev/themes/my_child_theme/translations/pl-PL"
    }
  }
  [1]=>
  array(6) {
    ["file"]=>
    string(97) "/var/www/src/PrestaShopBundle/Translation/Provider/ThemeProvider.php"
    ["line"]=>
    int(213)
    ["function"]=>
    string(7) "flatten"
    ["class"]=>
    string(72) "PrestaShop\TranslationToolsBundle\Translation\Extractor\Util\Flattenizer"
    ["type"]=>
    string(2) "::"
    ["args"]=>
    array(4) {
      [0]=>
      string(93) "/var/www/var/cache/dev/themes/my_child_theme/translations/pl-PL"
      [1]=>
      string(93) "/var/www/var/cache/dev/themes/my_child_theme/translations/pl-PL"
      [2]=>
      string(5) "pl-PL"
      [3]=>
      bool(false)
    }
  }
  [2]=>
  array(6) {
    ["file"]=>
    string(107) "/var/www/src/PrestaShopBundle/Translation/Factory/ThemeTranslationsFactory.php"
    ["line"]=>
    int(70)
    ["function"]=>
    string(16) "synchronizeTheme"
    ["class"]=>
    string(51) "PrestaShopBundle\Translation\Provider\ThemeProvider"
    ["type"]=>
    string(2) "->"
    ["args"]=>
    array(0) {
    }
  }
  [3]=>
  array(6) {
    ["file"]=>
    string(89) "/var/www/src/PrestaShopBundle/Service/TranslationService.php"
    ["line"]=>
    int(126)
    ["function"]=>
    string(23) "createTranslationsArray"
    ["class"]=>
    string(61) "PrestaShopBundle\Translation\Factory\ThemeTranslationsFactory"
    ["type"]=>
    string(2) "->"
    ["args"]=>
    array(4) {
      [0]=>
      string(15) "my_child_theme"
      [1]=>
      string(5) "pl-PL"
      [2]=>
      string(15) "my_child_theme"
      [3]=>
      NULL
    }
  }
  [4]=>
  array(6) {
    ["file"]=>
    string(99) "/var/www/src/PrestaShopBundle/Controller/Api/TranslationController.php"
    ["line"]=>
    int(320)
    ["function"]=>
    string(24) "getTranslationsCatalogue"
    ["class"]=>
    string(43) "PrestaShopBundle\Service\TranslationService"
    ["type"]=>
    string(2) "->"
    ["args"]=>
    array(4) {
      [0]=>
      string(2) "pl"
      [1]=>
      string(15) "my_child_theme"
      [2]=>
      string(15) "my_child_theme"
      [3]=>
      NULL
    }
  }
  [5]=>
  array(6) {
    ["file"]=>
    string(99) "/var/www/src/PrestaShopBundle/Controller/Api/TranslationController.php"
    ["line"]=>
    int(146)
    ["function"]=>
    string(13) "getNormalTree"
    ["class"]=>
    string(53) "PrestaShopBundle\Controller\Api\TranslationController"
    ["type"]=>
    string(2) "->"
    ["args"]=>
    array(4) {
      [0]=>
      string(2) "pl"
      [1]=>
      string(6) "themes"
      [2]=>
      string(15) "my_child_theme"
      [3]=>
      NULL
    }
  }
  [6]=>
  array(6) {
    ["file"]=>
    string(108) "/var/www/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php"
    ["line"]=>
    int(151)
    ["function"]=>
    string(14) "listTreeAction"
    ["class"]=>
    string(53) "PrestaShopBundle\Controller\Api\TranslationController"
    ["type"]=>
    string(2) "->"
    ["args"]=>
    array(1) {
      [0]=>
      object(Symfony\Component\HttpFoundation\Request)#38 (23) {
        ["attributes"]=>
        object(Symfony\Component\HttpFoundation\ParameterBag)#41 (1) {
          ["parameters":protected]=>
          array(9) {
            ["_controller"]=>
            string(57) "prestashop.core.api.translation.controller:listTreeAction"
            ["selected"]=>
            string(15) "my_child_theme"
            ["lang"]=>
            string(2) "pl"
            ["type"]=>
            string(6) "themes"
            ["_route"]=>
            string(28) "api_translation_domains_tree"
            ["_route_params"]=>
            array(3) {
              ["selected"]=>
              string(15) "my_child_theme"
              ["lang"]=>
              string(2) "pl"
              ["type"]=>
              string(6) "themes"
            }
            ["_firewall_context"]=>
            string(34) "security.firewall.map.context.main"
            ["controller_type"]=>
            int(0)
            ["controller_name"]=>
            string(53) "PrestaShopBundle\Controller\Api\TranslationController"
          }
        }
        ["request"]=>
        object(Symfony\Component\HttpFoundation\ParameterBag)#39 (1) {
          ["parameters":protected]=>
          array(0) {
          }
        }
        ["query"]=>
        object(Symfony\Component\HttpFoundation\ParameterBag)#40 (1) {
          ["parameters":protected]=>
          array(1) {
            ["_token"]=>
            string(43) "OfOaV_aHoK1-I2RK2MClfyACxzg-Te5TQUy-Rgtjwx8"
          }
        }
        ["server"]=>
        object(Symfony\Component\HttpFoundation\ServerBag)#44 (1) {
          ["parameters":protected]=>
          array(55) {
            
          }
        }
        ["files"]=>
        object(Symfony\Component\HttpFoundation\FileBag)#43 (1) {
          ["parameters":protected]=>
          array(0) {
          }
        }
        ["cookies"]=>
        object(Symfony\Component\HttpFoundation\ParameterBag)#42 (1) {
          ["parameters":protected]=>
          array(12) {
            
          }
        }
        ["headers"]=>
        object(Symfony\Component\HttpFoundation\HeaderBag)#45 (2) {
          ["headers":protected]=>
          array(10) {
            
          }
          ["cacheControl":protected]=>
          array(0) {
          }
        }
        ["content":protected]=>
        NULL
        ["languages":protected]=>
        NULL
        ["charsets":protected]=>
        NULL
        ["encodings":protected]=>
        NULL
        ["acceptableContentTypes":protected]=>
        NULL
        ["pathInfo":protected]=>
        string(48) "/api/translations/tree/pl/themes/my_child_theme"
        ["requestUri":protected]=>
        string(139) "/admin-dev/index.php/api/translations/tree/pl/themes/my_child_theme?_token=OfOaV_aHoK1-I2RK2MClfyACxzg-Te5TQUy-Rgtjwx8"
        ["baseUrl":protected]=>
        string(40) "/admin-dev/index.php"
        ["basePath":protected]=>
        NULL
        ["method":protected]=>
        string(3) "GET"
        ["format":protected]=>
        NULL
        ["session":protected]=>
        ["locale":protected]=>
        string(5) "pl-PL"
        ["defaultLocale":protected]=>
        string(5) "pl-PL"
        ["isHostValid":"Symfony\Component\HttpFoundation\Request":private]=>
        bool(true)
        ["isForwardedValid":"Symfony\Component\HttpFoundation\Request":private]=>
        bool(true)
      }
      [1]=>
      int(1)
    }
  }
  [8]=>
  array(6) {
    ["file"]=>
    string(104) "/var/www/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php"
    ["line"]=>
    int(200)
    ["function"]=>
    string(6) "handle"
    ["class"]=>
    string(39) "Symfony\Component\HttpKernel\HttpKernel"
    ["type"]=>
    string(2) "->"
    ["args"]=>
    array(3) {
      [0]=>
      object(Symfony\Component\HttpFoundation\Request)#38 (23) {
        ["attributes"]=>
        object(Symfony\Component\HttpFoundation\ParameterBag)#41 (1) {
          ["parameters":protected]=>
          array(9) {
            ["_controller"]=>
            string(57) "prestashop.core.api.translation.controller:listTreeAction"
            ["selected"]=>
            string(15) "my_child_theme"
            ["lang"]=>
            string(2) "pl"
            ["type"]=>
            string(6) "themes"
            ["_route"]=>
            string(28) "api_translation_domains_tree"
            ["_route_params"]=>
            array(3) {
              ["selected"]=>
              string(15) "my_child_theme"
              ["lang"]=>
              string(2) "pl"
              ["type"]=>
              string(6) "themes"
            }
            ["_firewall_context"]=>
            string(34) "security.firewall.map.context.main"
            ["controller_type"]=>
            int(0)
            ["controller_name"]=>
            string(53) "PrestaShopBundle\Controller\Api\TranslationController"
          }
        }
        ["request"]=>
        object(Symfony\Component\HttpFoundation\ParameterBag)#39 (1) {
          ["parameters":protected]=>
          array(0) {
          }
        }
        ["query"]=>
        object(Symfony\Component\HttpFoundation\ParameterBag)#40 (1) {
          ["parameters":protected]=>
          array(1) {
            ["_token"]=>
            string(43) "OfOaV_aHoK1-I2RK2MClfyACxzg-Te5TQUy-Rgtjwx8"
          }
        }
        ["server"]=>
        object(Symfony\Component\HttpFoundation\ServerBag)#44 (1) {
          ["parameters":protected]=>
        }
        ["files"]=>
        object(Symfony\Component\HttpFoundation\FileBag)#43 (1) {
          ["parameters":protected]=>
          array(0) {
          }
        }
        ["cookies"]=>
        object(Symfony\Component\HttpFoundation\ParameterBag)#42 (1) {
          
        }
        ["headers"]=>
        object(Symfony\Component\HttpFoundation\HeaderBag)#45 (2) {
          ["headers":protected]=>
          
          ["cacheControl":protected]=>
          array(0) {
          }
        }
        ["content":protected]=>
        NULL
        ["languages":protected]=>
        NULL
        ["charsets":protected]=>
        NULL
        ["encodings":protected]=>
        NULL
        ["acceptableContentTypes":protected]=>
        NULL
        ["pathInfo":protected]=>
        string(48) "/api/translations/tree/pl/themes/my_child_theme"
        ["requestUri":protected]=>
        string(139) "/admin-dev/index.php/api/translations/tree/pl/themes/my_child_theme?_token=OfOaV_aHoK1-I2RK2MClfyACxzg-Te5TQUy-Rgtjwx8"
        ["baseUrl":protected]=>
        string(40) "/admin-dev/index.php"
        ["basePath":protected]=>
        NULL
        ["method":protected]=>
        string(3) "GET"
        ["format":protected]=>
        NULL
        ["session":protected]=>
        object(Symfony\Component\HttpFoundation\Session\Session)#270 (5) {
          ["storage":protected]=>
          object(Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage)#269 (5) {
            ["bags":protected]=>
            array(2) {
              ["attributes"]=>
              object(Symfony\Component\HttpFoundation\Session\SessionBagProxy)#262 (3) {
                ["bag":"Symfony\Component\HttpFoundation\Session\SessionBagProxy":private]=>
                object(Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag)#264 (3) {
                  ["name":"Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag":private]=>
                  string(10) "attributes"
                  ["storageKey":"Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag":private]=>
                  string(15) "_sf2_attributes"
                  ["attributes":protected]=>
                  &array(3) {
                    ["_csrf/https-ANONYMOUS_USER"]=>
                    string(43) "OfOaV_aHoK1-I2RK2MClfyACxzg-Te5TQUy-Rgtjwx8"
                    ["_security_main"]=>
                    ["_csrf/https-form"]=>
                    string(43) "brJpXX7_iVset3YZ7YVtX4NYtWhBIQWH0lHxOt4oyIY"
                  }
                }
                ["data":"Symfony\Component\HttpFoundation\Session\SessionBagProxy":private]=>
                &array(2) {
                  ["_sf2_attributes"]=>
                  &array(3) {
                    ["_csrf/https-ANONYMOUS_USER"]=>
                    string(43) "OfOaV_aHoK1-I2RK2MClfyACxzg-Te5TQUy-Rgtjwx8"
                    ["_security_main"]=>
                    ["_csrf/https-form"]=>
                    string(43) "brJpXX7_iVset3YZ7YVtX4NYtWhBIQWH0lHxOt4oyIY"
                  }
                  ["_symfony_flashes"]=>
                  &array(0) {
                  }
                }
                ["usageIndex":"Symfony\Component\HttpFoundation\Session\SessionBagProxy":private]=>
                &int(3)
              }
              ["flashes"]=>
              object(Symfony\Component\HttpFoundation\Session\SessionBagProxy)#261 (3) {
                ["bag":"Symfony\Component\HttpFoundation\Session\SessionBagProxy":private]=>
                object(Symfony\Component\HttpFoundation\Session\Flash\FlashBag)#263 (3) {
                  ["name":"Symfony\Component\HttpFoundation\Session\Flash\FlashBag":private]=>
                  string(7) "flashes"
                  ["flashes":"Symfony\Component\HttpFoundation\Session\Flash\FlashBag":private]=>
                  &array(0) {
                  }
                  ["storageKey":"Symfony\Component\HttpFoundation\Session\Flash\FlashBag":private]=>
                  string(16) "_symfony_flashes"
                }
                ["data":"Symfony\Component\HttpFoundation\Session\SessionBagProxy":private]=>
                &array(2) {
                  ["_sf2_attributes"]=>
                  &array(3) {
                    ["_csrf/https-ANONYMOUS_USER"]=>
                    string(43) "OfOaV_aHoK1-I2RK2MClfyACxzg-Te5TQUy-Rgtjwx8"
                    ["_security_main"]=>
                    ["_csrf/https-form"]=>
                    string(43) "brJpXX7_iVset3YZ7YVtX4NYtWhBIQWH0lHxOt4oyIY"
                  }
                  ["_symfony_flashes"]=>
                  &array(0) {
                  }
                }
                ["usageIndex":"Symfony\Component\HttpFoundation\Session\SessionBagProxy":private]=>
                &int(3)
              }
            }
            ["started":protected]=>
            bool(true)
            ["closed":protected]=>
            bool(false)
            ["saveHandler":protected]=>
            object(Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy)#267 (3) {
              ["handler":protected]=>
              object(Symfony\Component\HttpFoundation\Session\Storage\Handler\StrictSessionHandler)#266 (7) {
                ["handler":"Symfony\Component\HttpFoundation\Session\Storage\Handler\StrictSessionHandler":private]=>
                object(SessionHandler)#265 (0) {
                }
                ["doDestroy":"Symfony\Component\HttpFoundation\Session\Storage\Handler\StrictSessionHandler":private]=>
                NULL
                ["sessionName":"Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler":private]=>
                string(9) "PHPSESSID"
                ["prefetchId":"Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler":private]=>
                NULL
                ["prefetchData":"Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler":private]=>
                NULL
                ["newSessionId":"Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler":private]=>
                NULL
                ["igbinaryEmptyData":"Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler":private]=>
                NULL
              }
              ["wrapper":protected]=>
              bool(false)
              ["saveHandlerName":protected]=>
              string(4) "user"
            }
            ["metadataBag":protected]=>
            object(Symfony\Component\HttpFoundation\Session\Storage\MetadataBag)#268 (5) {
              ["name":"Symfony\Component\HttpFoundation\Session\Storage\MetadataBag":private]=>
              string(10) "__metadata"
              ["storageKey":"Symfony\Component\HttpFoundation\Session\Storage\MetadataBag":private]=>
              string(9) "_sf2_meta"
              ["meta":protected]=>
              &array(3) {
                ["u"]=>
                int(1566494428)
                ["c"]=>
                int(1566491187)
                ["l"]=>
                string(1) "0"
              }
              ["lastUsed":"Symfony\Component\HttpFoundation\Session\Storage\MetadataBag":private]=>
              int(1566494391)
              ["updateThreshold":"Symfony\Component\HttpFoundation\Session\Storage\MetadataBag":private]=>
              string(1) "0"
            }
          }
          ["flashName":"Symfony\Component\HttpFoundation\Session\Session":private]=>
          string(7) "flashes"
          ["attributeName":"Symfony\Component\HttpFoundation\Session\Session":private]=>
          string(10) "attributes"
          ["data":"Symfony\Component\HttpFoundation\Session\Session":private]=>
          &array(2) {
            ["_sf2_attributes"]=>
            &array(3) {
              ["_csrf/https-ANONYMOUS_USER"]=>
              string(43) "OfOaV_aHoK1-I2RK2MClfyACxzg-Te5TQUy-Rgtjwx8"
              ["_security_main"]=>
              ["_csrf/https-form"]=>
              string(43) "brJpXX7_iVset3YZ7YVtX4NYtWhBIQWH0lHxOt4oyIY"
            }
            ["_symfony_flashes"]=>
            &array(0) {
            }
          }
          ["usageIndex":"Symfony\Component\HttpFoundation\Session\Session":private]=>
          &int(3)
        }
        ["locale":protected]=>
        string(5) "pl-PL"
        ["defaultLocale":protected]=>
        string(5) "pl-PL"
        ["isHostValid":"Symfony\Component\HttpFoundation\Request":private]=>
        bool(true)
        ["isForwardedValid":"Symfony\Component\HttpFoundation\Request":private]=>
        bool(true)
      }
      [1]=>
      int(1)
      [2]=>
      bool(false)
    }
  }
  [9]=>
  array(6) {
    ["file"]=>
    string(77) "/var/www/admin-dev/index.php"
    ["line"]=>
    int(86)
    ["function"]=>
    string(6) "handle"
    ["class"]=>
    string(35) "Symfony\Component\HttpKernel\Kernel"
    ["type"]=>
    string(2) "->"
    ["args"]=>
    array(3) {
      [0]=>
      object(Symfony\Component\HttpFoundation\Request)#38 (23) {
        ["attributes"]=>
        object(Symfony\Component\HttpFoundation\ParameterBag)#41 (1) {
          ["parameters":protected]=>
          array(9) {
            ["_controller"]=>
            string(57) "prestashop.core.api.translation.controller:listTreeAction"
            ["selected"]=>
            string(15) "my_child_theme"
            ["lang"]=>
            string(2) "pl"
            ["type"]=>
            string(6) "themes"
            ["_route"]=>
            string(28) "api_translation_domains_tree"
            ["_route_params"]=>
            array(3) {
              ["selected"]=>
              string(15) "my_child_theme"
              ["lang"]=>
              string(2) "pl"
              ["type"]=>
              string(6) "themes"
            }
            ["_firewall_context"]=>
            string(34) "security.firewall.map.context.main"
            ["controller_type"]=>
            int(0)
            ["controller_name"]=>
            string(53) "PrestaShopBundle\Controller\Api\TranslationController"
          }
        }
        ["request"]=>
        object(Symfony\Component\HttpFoundation\ParameterBag)#39 (1) {
          ["parameters":protected]=>
          array(0) {
          }
        }
        ["query"]=>
        object(Symfony\Component\HttpFoundation\ParameterBag)#40 (1) {
          ["parameters":protected]=>
          array(1) {
            ["_token"]=>
            string(43) "OfOaV_aHoK1-I2RK2MClfyACxzg-Te5TQUy-Rgtjwx8"
          }
        }
        ["server"]=>
        object(Symfony\Component\HttpFoundation\ServerBag)#44 (1) {
          ["parameters":protected]=>
          array(55) {
            ["PATH"]=>
            string(60) "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
            ["TEMP"]=>
            string(37) "/tmp"
            ["TMPDIR"]=>
            string(37) "/tmp"
            ["TMP"]=>
            string(37) "/tmp"
            ["HOSTNAME"]=>
            string(0) ""
            ["USER"]=>
            string(6) "web407"
            ["HOME"]=>
            string(47) "/./home/web407"
            ["ORIG_PATH_TRANSLATED"]=>
            string(125) "/var/www/admin-dev/index.php/api/translations/tree/pl/themes/my_child_theme"
            ["ORIG_SCRIPT_FILENAME"]=>
            string(69) "/cgi-bin/php-fcgi-*-443-example.com"
            ["ORIG_SCRIPT_NAME"]=>
            string(9) "/php-fcgi"
            ["ORIG_PATH_INFO"]=>
            string(88) "/admin-dev/index.php/api/translations/tree/pl/themes/my_child_theme"
            ["PATH_TRANSLATED"]=>
            string(85) "/var/www/api/translations/tree/pl/themes/my_child_theme"
            ["PATH_INFO"]=>
            string(48) "/api/translations/tree/pl/themes/my_child_theme"
            ["SCRIPT_NAME"]=>
            string(40) "/admin-dev/index.php"
            ["REQUEST_URI"]=>
            string(139) "/admin-dev/index.php/api/translations/tree/pl/themes/my_child_theme?_token=OfOaV_aHoK1-I2RK2MClfyACxzg-Te5TQUy-Rgtjwx8"
            ["QUERY_STRING"]=>
            string(50) "_token=OfOaV_aHoK1-I2RK2MClfyACxzg-Te5TQUy-Rgtjwx8"
            ["REQUEST_METHOD"]=>
            string(3) "GET"
            ["SERVER_PROTOCOL"]=>
            string(8) "HTTP/1.1"
            ["GATEWAY_INTERFACE"]=>
            string(7) "CGI/1.1"
            ["REDIRECT_URL"]=>
            string(88) "/admin-dev/index.php/api/translations/tree/pl/themes/my_child_theme"
            ["REDIRECT_QUERY_STRING"]=>
            string(50) "_token=OfOaV_aHoK1-I2RK2MClfyACxzg-Te5TQUy-Rgtjwx8"
            ["REMOTE_PORT"]=>
            string(5) "15407"
            ["SCRIPT_FILENAME"]=>
            string(77) "/var/www/admin-dev/index.php"
            ["SERVER_ADMIN"]=>
            ["CONTEXT_DOCUMENT_ROOT"]=>
            ["CONTEXT_PREFIX"]=>
            string(9) "/php-fcgi"
            ["REQUEST_SCHEME"]=>
            string(5) "https"
            ["DOCUMENT_ROOT"]=>
            string(37) "/web"
            ["REMOTE_ADDR"]=>
            ["SERVER_PORT"]=>
            string(3) "443"
            ["SERVER_ADDR"]=>
            ["SERVER_NAME"]=>
            string(12) "example.com"
            ["SERVER_SOFTWARE"]=>
            string(22) "Apache/2.4.10 (Debian)"
            ["SERVER_SIGNATURE"]=>
            string(74) "
Apache/2.4.10 (Debian) Server at example.com Port 443

"
            ["HTTP_UPGRADE_INSECURE_REQUESTS"]=>
            string(1) "1"
            ["HTTP_COOKIE"]=>
            ["HTTP_CONNECTION"]=>
            string(10) "keep-alive"
            ["HTTP_DNT"]=>
            string(1) "1"
            ["HTTP_ACCEPT_ENCODING"]=>
            string(17) "gzip, deflate, br"
            ["HTTP_ACCEPT_LANGUAGE"]=>
            string(23) "pl,en-US;q=0.7,en;q=0.3"
            ["HTTP_ACCEPT"]=>
            string(63) "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
            ["HTTP_USER_AGENT"]=>
            string(82) "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:69.0) Gecko/20100101 Firefox/69.0"
            ["HTTP_HOST"]=>
            string(12) "example.com"
            ["SSL_TLS_SNI"]=>
            string(12) "example.com"
            ["HTTPS"]=>
            string(2) "on"
            ["REDIRECT_STATUS"]=>
            string(3) "200"
            ["REDIRECT_HANDLER"]=>
            string(8) "php-fcgi"
            ["REDIRECT_SSL_TLS_SNI"]=>
            string(12) "example.com"
            ["REDIRECT_HTTPS"]=>
            string(2) "on"
            ["REDIRECT_HTTP_MOD_REWRITE"]=>
            string(2) "On"
            ["REDIRECT_BASE"]=>
            string(30) "/admin-dev"
            ["FCGI_ROLE"]=>
            string(9) "RESPONDER"
            ["PHP_SELF"]=>
            string(88) "/admin-dev/index.php/api/translations/tree/pl/themes/my_child_theme"
            ["REQUEST_TIME_FLOAT"]=>
            float(1566494428.4064)
            ["REQUEST_TIME"]=>
            int(1566494428)
          }
        }
        ["files"]=>
        object(Symfony\Component\HttpFoundation\FileBag)#43 (1) {
          ["parameters":protected]=>
          array(0) {
          }
        }
        ["cookies"]=>
        object(Symfony\Component\HttpFoundation\ParameterBag)#42 (1) {
          ["parameters":protected]=>
          array(12) {
            ["id_employee"]=>
            string(1) "1"
            ["iso_code"]=>
            string(2) "pl"
            ["autoupgrade"]=>
            string(32) "abec1b415d3806a198fa016191046684"
            ["_ga"]=>
            string(27) "GA1.2.1477039089.1547037223"
            ["cookie_ue"]=>
            string(1) "1"
            ["__atuvc"]=>
            string(10) "8|14,44|15"
            ["PrestaShop-4845a1ddbc021e8f69abeab2e80b30bf"]=>
            ["PHPSESSID"]=>
            string(26) "rv4u71t4ibcgun0i1euj0elpdl"
            ["username_addons"]=>
            ["password_addons"]=>
            ["is_contributor"]=>
            string(1) "0"
            ["PrestaShop-b135660727ecad03b4f4241b067e950d"]=>
          }
        }
        ["headers"]=>
        object(Symfony\Component\HttpFoundation\HeaderBag)#45 (2) {
          ["headers":protected]=>
          array(10) {
            ["upgrade-insecure-requests"]=>
            array(1) {
              [0]=>
              string(1) "1"
            }
            ["cookie"]=>
            array(1) {
              [0]=>
            }
            ["connection"]=>
            array(1) {
              [0]=>
              string(10) "keep-alive"
            }
            ["dnt"]=>
            array(1) {
              [0]=>
              string(1) "1"
            }
            ["accept-encoding"]=>
            array(1) {
              [0]=>
              string(17) "gzip, deflate, br"
            }
            ["accept-language"]=>
            array(1) {
              [0]=>
              string(23) "pl,en-US;q=0.7,en;q=0.3"
            }
            ["accept"]=>
            array(1) {
              [0]=>
              string(63) "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
            }
            ["user-agent"]=>
            array(1) {
              [0]=>
              string(82) "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:69.0) Gecko/20100101 Firefox/69.0"
            }
            ["host"]=>
            array(1) {
              [0]=>
              string(12) "example.com"
            }
            ["x-php-ob-level"]=>
            array(1) {
              [0]=>
              int(1)
            }
          }
          ["cacheControl":protected]=>
          array(0) {
          }
        }
        ["content":protected]=>
        NULL
        ["languages":protected]=>
        NULL
        ["charsets":protected]=>
        NULL
        ["encodings":protected]=>
        NULL
        ["acceptableContentTypes":protected]=>
        NULL
        ["pathInfo":protected]=>
        string(48) "/api/translations/tree/pl/themes/my_child_theme"
        ["requestUri":protected]=>
        string(139) "/admin-dev/index.php/api/translations/tree/pl/themes/my_child_theme?_token=OfOaV_aHoK1-I2RK2MClfyACxzg-Te5TQUy-Rgtjwx8"
        ["baseUrl":protected]=>
        string(40) "/admin-dev/index.php"
        ["basePath":protected]=>
        NULL
        ["method":protected]=>
        string(3) "GET"
        ["format":protected]=>
        NULL
        ["session":protected]=>
        object(Symfony\Component\HttpFoundation\Session\Session)#270 (5) {
          ["storage":protected]=>
          object(Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage)#269 (5) {
            ["bags":protected]=>
            array(2) {
              ["attributes"]=>
              object(Symfony\Component\HttpFoundation\Session\SessionBagProxy)#262 (3) {
                ["bag":"Symfony\Component\HttpFoundation\Session\SessionBagProxy":private]=>
                object(Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag)#264 (3) {
                  ["name":"Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag":private]=>
                  string(10) "attributes"
                  ["storageKey":"Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag":private]=>
                  string(15) "_sf2_attributes"
                  ["attributes":protected]=>
                  &array(3) {
                    ["_csrf/https-ANONYMOUS_USER"]=>
                    string(43) "OfOaV_aHoK1-I2RK2MClfyACxzg-Te5TQUy-Rgtjwx8"
                    ["_security_main"]=>
                    ["_csrf/https-form"]=>
                    string(43) "brJpXX7_iVset3YZ7YVtX4NYtWhBIQWH0lHxOt4oyIY"
                  }
                }
                ["data":"Symfony\Component\HttpFoundation\Session\SessionBagProxy":private]=>
                &array(2) {
                  ["_sf2_attributes"]=>
                  &array(3) {
                    ["_csrf/https-ANONYMOUS_USER"]=>
                    string(43) "OfOaV_aHoK1-I2RK2MClfyACxzg-Te5TQUy-Rgtjwx8"
                    ["_security_main"]=>
                    ["_csrf/https-form"]=>
                    string(43) "brJpXX7_iVset3YZ7YVtX4NYtWhBIQWH0lHxOt4oyIY"
                  }
                  ["_symfony_flashes"]=>
                  &array(0) {
                  }
                }
                ["usageIndex":"Symfony\Component\HttpFoundation\Session\SessionBagProxy":private]=>
                &int(3)
              }
              ["flashes"]=>
              object(Symfony\Component\HttpFoundation\Session\SessionBagProxy)#261 (3) {
                ["bag":"Symfony\Component\HttpFoundation\Session\SessionBagProxy":private]=>
                object(Symfony\Component\HttpFoundation\Session\Flash\FlashBag)#263 (3) {
                  ["name":"Symfony\Component\HttpFoundation\Session\Flash\FlashBag":private]=>
                  string(7) "flashes"
                  ["flashes":"Symfony\Component\HttpFoundation\Session\Flash\FlashBag":private]=>
                  &array(0) {
                  }
                  ["storageKey":"Symfony\Component\HttpFoundation\Session\Flash\FlashBag":private]=>
                  string(16) "_symfony_flashes"
                }
                ["data":"Symfony\Component\HttpFoundation\Session\SessionBagProxy":private]=>
                &array(2) {
                  ["_sf2_attributes"]=>
                  &array(3) {
                    ["_csrf/https-ANONYMOUS_USER"]=>
                    string(43) "OfOaV_aHoK1-I2RK2MClfyACxzg-Te5TQUy-Rgtjwx8"
                    ["_security_main"]=>
                    ["_csrf/https-form"]=>
                    string(43) "brJpXX7_iVset3YZ7YVtX4NYtWhBIQWH0lHxOt4oyIY"
                  }
                  ["_symfony_flashes"]=>
                  &array(0) {
                  }
                }
                ["usageIndex":"Symfony\Component\HttpFoundation\Session\SessionBagProxy":private]=>
                &int(3)
              }
            }
            ["started":protected]=>
            bool(true)
            ["closed":protected]=>
            bool(false)
            ["saveHandler":protected]=>
            object(Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy)#267 (3) {
              ["handler":protected]=>
              object(Symfony\Component\HttpFoundation\Session\Storage\Handler\StrictSessionHandler)#266 (7) {
                ["handler":"Symfony\Component\HttpFoundation\Session\Storage\Handler\StrictSessionHandler":private]=>
                object(SessionHandler)#265 (0) {
                }
                ["doDestroy":"Symfony\Component\HttpFoundation\Session\Storage\Handler\StrictSessionHandler":private]=>
                NULL
                ["sessionName":"Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler":private]=>
                string(9) "PHPSESSID"
                ["prefetchId":"Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler":private]=>
                NULL
                ["prefetchData":"Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler":private]=>
                NULL
                ["newSessionId":"Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler":private]=>
                NULL
                ["igbinaryEmptyData":"Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler":private]=>
                NULL
              }
              ["wrapper":protected]=>
              bool(false)
              ["saveHandlerName":protected]=>
              string(4) "user"
            }
            ["metadataBag":protected]=>
            object(Symfony\Component\HttpFoundation\Session\Storage\MetadataBag)#268 (5) {
              ["name":"Symfony\Component\HttpFoundation\Session\Storage\MetadataBag":private]=>
              string(10) "__metadata"
              ["storageKey":"Symfony\Component\HttpFoundation\Session\Storage\MetadataBag":private]=>
              string(9) "_sf2_meta"
              ["meta":protected]=>
              &array(3) {
                ["u"]=>
                int(1566494428)
                ["c"]=>
                int(1566491187)
                ["l"]=>
                string(1) "0"
              }
              ["lastUsed":"Symfony\Component\HttpFoundation\Session\Storage\MetadataBag":private]=>
              int(1566494391)
              ["updateThreshold":"Symfony\Component\HttpFoundation\Session\Storage\MetadataBag":private]=>
              string(1) "0"
            }
          }
          ["flashName":"Symfony\Component\HttpFoundation\Session\Session":private]=>
          string(7) "flashes"
          ["attributeName":"Symfony\Component\HttpFoundation\Session\Session":private]=>
          string(10) "attributes"
          ["data":"Symfony\Component\HttpFoundation\Session\Session":private]=>
          &array(2) {
            ["_sf2_attributes"]=>
            &array(3) {
              ["_csrf/https-ANONYMOUS_USER"]=>
              string(43) "OfOaV_aHoK1-I2RK2MClfyACxzg-Te5TQUy-Rgtjwx8"
              ["_security_main"]=>
              ["_csrf/https-form"]=>
              string(43) "brJpXX7_iVset3YZ7YVtX4NYtWhBIQWH0lHxOt4oyIY"
            }
            ["_symfony_flashes"]=>
            &array(0) {
            }
          }
          ["usageIndex":"Symfony\Component\HttpFoundation\Session\Session":private]=>
          &int(3)
        }
        ["locale":protected]=>
        string(5) "pl-PL"
        ["defaultLocale":protected]=>
        string(5) "pl-PL"
        ["isHostValid":"Symfony\Component\HttpFoundation\Request":private]=>
        bool(true)
        ["isForwardedValid":"Symfony\Component\HttpFoundation\Request":private]=>
        bool(true)
      }
      [1]=>
      int(1)
      [2]=>
      bool(false)
    }
  }
}

Additional information
PrestaShop version: 1.7.6.1
PHP version: 7.2

@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

@khouloudbelguith khouloudbelguith commented Aug 27, 2019

Hi @Flower7C3,

I did not manage to reproduce the issue with PS1.7.6.1 & a child theme cloned from this link:
https://github.com/PrestaShop/childtheme-example
childtheme-example.zip
I attached a screen record
https://drive.google.com/file/d/1JrDBwYCShjKsmKwmAVqY7q2AiOqhL_u4/view
Thanks to check & feedback.

@Flower7C3

This comment has been minimized.

Copy link
Author

@Flower7C3 Flower7C3 commented Aug 27, 2019

In my configuration child theme has different parent theme (not classic).
I have downloaded Your example child theme, but there is still red error: image

@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

@khouloudbelguith khouloudbelguith commented Aug 27, 2019

@Flower7C3, have you tried to follow this comment: #14733 (comment)?

Thanks!

@Flower7C3

This comment has been minimized.

Copy link
Author

@Flower7C3 Flower7C3 commented Aug 27, 2019

@khouloudbelguith I have tried this solution but it does not work.
I have also tried to change childtheme-example and I find out that this error is show where there is no template file in theme directory. So child theme does not extend translation keys from parent theme, even if xlf files from parent are imported.

@Flower7C3

This comment has been minimized.

Copy link
Author

@Flower7C3 Flower7C3 commented Aug 27, 2019

I have created following example theme file and I am able to open translations page, but only one field is available for translation.

/themes/my-child-theme/templates/example.tpl
{l s='Example' d='Shop.Theme.Demo'}

All other fields imported form parent theme gives me error: image

@Flower7C3 Flower7C3 changed the title It is not possible to edit the "Back office translations" in PrestaShop 1.7.6.1 It is not possible to edit the "Back office translations" in PrestaShop 1.7.6.1 child theme Aug 27, 2019
@Flower7C3

This comment has been minimized.

Copy link
Author

@Flower7C3 Flower7C3 commented Aug 27, 2019

I have made bash script, that will walk through all XLF files in child themes and create fake template with all translations strings. So finally I am able do child theme translations.
It is not good solution, but works for me.

translations-match-to-template.sh
    themes_dir_name="themes/"
    translations_dir_name='translations/'
    template_file_name='templates/example.tpl'
    themes_list=($(cd "$themes_dir_name" && ls -d */))
    for theme_name in "${themes_list[@]}"; do
        theme_dir_path="${themes_dir_name}${theme_name}"
        theme_config_file="${theme_dir_path}config/theme.yml"
        if [[ -f "$theme_config_file" ]]; then
            is_child_theme=$(grep 'parent: ' "$theme_config_file")
            if [[ -n "$is_child_theme" ]]; then
                info_line "$theme_name"
                template_file_path="${theme_dir_path}${template_file_name}"
                template_dir_path="$(dirname "$template_file_path")"
                translation_dir_path="${theme_dir_path}${translations_dir_name}"
                mkdir -p "$template_dir_path"
                rm -rf "$template_file_path"
                touch "$template_file_path"
                languages_list=($(cd "$translation_dir_path" && ls -d */))
                if [[ "${#languages_list[@]}" -gt "0" ]]; then
                    for language_name in "${languages_list[@]}"; do
                        info_line "$theme_name $language_name"
                        language_dir_path="${translation_dir_path}${language_name}"
                        translation_files_list=($(cd "$language_dir_path" && ls -f *.xlf))
                        if [[ "${#translation_files_list[@]}" -gt "0" ]]; then
                            for file_name in "${translation_files_list[@]}"; do
                                translation_file_path="${language_dir_path}${file_name}"
                                translation_domain=${file_name}
                                translation_domain=$(echo "$translation_domain" | sed 's/\.pl-PL\.xlf//g')
                                translation_domain=$(echo "$translation_domain" | sed 's/[[:upper:]]/.&/g' | sed 's/^\.//g')
                                info_line "$theme_name $language_name $translation_domain"
                                oldIFS=$IFS
                                IFS=$'\n'
                                translations=($(sed -ne 's?.*<source>\(.*\)</source>.*?\1?p' "$translation_file_path"))
                                IFS=$oldIFS
                                for key in "${translations[@]}"; do
                                    printf "{l s='%s' d='%s'}\n" "$key" "$translation_domain" >>"$template_file_path"
                                done
                            done
                        fi
                    done
                fi
            fi
        fi
    done
@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

@khouloudbelguith khouloudbelguith commented Aug 28, 2019

@Flower7C3, could you please provide me your demo child theme to test it.

I have also tried to change childtheme-example and I find out that this error is shown where there is no template file in theme directory

I tried with childtheme where there is no template file in theme directory & it is OK
childtheme.zip

Thanks!

@Flower7C3

This comment has been minimized.

Copy link
Author

@Flower7C3 Flower7C3 commented Aug 28, 2019

@khouloudbelguith Your childtheme has tpl files in modules directory:
image

If You delete all files except config/theme.yml translations will not work.

@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

@khouloudbelguith khouloudbelguith commented Aug 29, 2019

@Flower7C3, thanks for these clarifications.
I manage to reproduce the issue with PS1.7.5.2 & PS1.7.6.1.
It is not a regression.
This issue is reproduced only if we have a theme without tpl files.
image
checked with this child theme
childtheme.zip
I’ll add this to the debug roadmap so that it’s fixed. If you have already fixed it on your end or if you think you can do it, please do send us a pull request!
Thanks!

@pierreloicq

This comment has been minimized.

Copy link

@pierreloicq pierreloicq commented Sep 9, 2019

This issue is reproduced only if we have a theme without tpl files.

I have a footer.tpl in my child theme at templates/_partials/ and still I have red alerts when trying to edit "theme translations".

What solution is the best ? translate the parent theme or try to apply @Flower7C3 solution ?
Will the translation of the parent theme be erased in case of update ?

Thank you

@Flower7C3

This comment has been minimized.

Copy link
Author

@Flower7C3 Flower7C3 commented Sep 9, 2019

@pierreloicq my solution is just workaround and will generate missing translations from xlf files in theme to temporary tpl file. But there is other problem with translations described in #15346

@pollat

This comment has been minimized.

Copy link

@pollat pollat commented Sep 24, 2019

I have the same bug with backoffice translations in Prestashop 1.7.6.0

@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

@khouloudbelguith khouloudbelguith commented Sep 25, 2019

Hi @pollat,

This issue is added to our bug roadmap.
Thanks for your understanding!

@HartLarsson

This comment has been minimized.

Copy link

@HartLarsson HartLarsson commented Nov 17, 2019

any news or fix?

thanks

@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

@khouloudbelguith khouloudbelguith commented Nov 18, 2019

Hi @HartLarsson,

Sorry not yet.
PrestaShop is an open source project, so it can be solved before if someone submits a pull request to solve it.

Thanks!

@HartLarsson

This comment has been minimized.

Copy link

@HartLarsson HartLarsson commented Nov 18, 2019

Hi @HartLarsson,

Sorry not yet.
PrestaShop is an open source project, so it can be solved before if someone submits a pull request to solve it.

Thanks!

any workaround in the while that will be fixed?
There is a way to bring manually translation to the child theme?

thanks

@tippysrl

This comment has been minimized.

Copy link

@tippysrl tippysrl commented Jan 10, 2020

I have experienced the same issue with a fresh installation of PS 1.7.6.2.
After some research and tests, i have found that this error shows up when inside the child theme there is nothing to translate; after placing inside the child theme a template with some translatable string, for example {l s='test' d='Shop.Theme.Catalog'}, the translation page in backoffice started working regularly.

@Flower7C3

This comment has been minimized.

Copy link
Author

@Flower7C3 Flower7C3 commented Jan 10, 2020

@tippysrl that's why I wrote script which process all files in master theme, app/Resources/translations/default/ directory and debug:translation command. Then I save output in child theme in same extra tpl file. Feel free to use it and comment if there is some error.

@tippysrl

This comment has been minimized.

Copy link

@tippysrl tippysrl commented Jan 10, 2020

@tippysrl that's why I wrote script which process all files in master theme, app/Resources/translations/default/ directory and debug:translation command. Then I save output in child theme in same extra tpl file. Feel free to use it and comment if there is some error.

Thank you, i will try it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.