Magento2: Magento 2.2.0-rc22 static content deploy not compiling locale for child theme

Created on 4 Sep 2017  路  13Comments  路  Source: magento/magento2

Child theme locale is not compiled to pub/static/frontend/themedir/locale after running bin/magento setup:static-content:deploy in Magento 2.2.0-rc22

Preconditions

  1. Magento 2.2.0-rc22 (Communit Edition) installed w Composer
  2. nginx/1.10.0
  3. PHP 7.0.15-0ubuntu0.16.04.4
  4. MAGE_MODE = production
  5. Theme and storeview setup as follows
    a. Create a custom parent theme
    b. Apply parent theme to default storeview (w/ locale en_US)
    c. Create a child theme
    d. Create new storeview
    e. Configure different locale (e.g. nl_NL) to new storeview
    f. Apply child theme to new storeview

Steps to reproduce

  1. Run bin/magento setup:static-content:deploy in different variants (see attached screenshots).

Expected result

  1. Child theme locale should be compiled to pub/static

Actual result

  1. Child theme locale is not compiled to pub/static

magento2 2 0-rc22-theme-setup
magento2 2 0-rc22-static-content-deploy-quick
magento2 2 0-rc22-static-content-deploy-quick-theme-locale
magento2 2 0-rc22-static-content-deploy-standard-theme-locale
magento2 2 0-rc22-static-content-deploy-compact-theme-locale

Clear Description Confirmed Format is valid Ready for Work done Reproduced on 2.2.x Reproduced on 2.3.x bug report

All 13 comments

Thank you for your submission. Didn't try to dive deep into this issue, but just noticed that you are using root user to perform CLI commands, also you are not trying to use
php bin/magento setup:static-content:deploy
instead of
bin/magento setup:static-content:deploy
This guide may be useful.

Is your issue in some way connected with default 'Luma' or 'Blank' theme?

Could you please provide a bit more information? Have a look in config.php and env.php and report what is in the "scopes" section. http://devdocs.magento.com/guides/v2.2/config-guide/prod/config-reference-configphp.html. There were changes in 2.2 around this area. The official list of scopes is now in these files for pushing say from dev to prod. That might be related to your problem.

@TomashKhamlai I haven't had file permission issues with bin/magento setup:static-content:deploy in this Docker environment before. So I feel it can't be the 'root' cause in this issue ;-) .

I am giving you some extra info so we can figure out if this is a special case or a real M2 issue.

When I add an i18n folder to the web folder in the frontend-theme-en then Magento will compile the Dutch locale for both themes. See screenshot. So we need to figure out why in M2.2 a locale within a theme does trigger locale compilation for all themes and why a seperate child theme does not.

I suggest you first try yourself with a separate theme, if you have no issues with compiling at your end, then it's an issue within my setup or M2.2 deploy workflow.

Screenshot of adjusted theme with i18n folder:
magento2 2 0-rc22-static-content-deploy-with-separate-i18n-folder-theme-structure

Compilation screenshot with and without separate i18n folder in en theme:
magento2 2 0-rc22-static-content-deploy-with-separate-i18n-folder

@ennostuurman So I deleted my last comment, because it lead to nowhere.

There is a much better tempory solution than adding logos to some specific folders, which just induces all languages set in that way to be compiled is to specify the theme you want to deploy with the wanted language. It's not perfect, but a working solution, which needs no adjustments.

Just run
'bin/magento setup:static-content:deploy theme=Custom/nl nl_NL'.
And remove your workaround solution beforehand. Otherwise you probably won't see a difference.

So you can still specify the compilation process in that way, but of course most of the other options for the deployment process don't really work the way they should.

Hi all,
I faced with the same issue after updated magento with 2.2.0 version.
I've created folder with logo image in the custom theme and seems like static deploy works fine with all specified languages.
Thanks for @ennostuurman

@ennostuurman , thanks for the report. Unfortunately, we can not reproduce this issue with specified steps.
Steps we did:
Magento 2.2.2

  1. Create custom parent theme(based on blank)
  2. Create child theme(basically empty, has only registration.php and theme.xml)
  3. Create additional store view.
  4. Assign parent theme to default store view(en_US)
  5. Assign child theme to custom store view(nl_NL)
  6. Enable production mode (bin/magento deploy:mode:set production)
    Both themes have static files in en_US and nl_NL locale.
    Please correct our steps, in case they are wrong, or try to reproduce this issue on latest 2.2.x(currently 2.2.2)

@magento-engcom-team thx for your investigation, the use case that you tested (bin/magento deploy:mode:set production) does indeed produce the right output. But that is not the issue that I described.

Did you also test the different deploy strategies, http://devdocs.magento.com/guides/v2.2/config-guide/cli/config-cli-subcommands-static-view.html 'stand alone' in production mode?

  1. remove pub/static
  2. run a quick, standard and compact static:content:deploy ?

@ennostuurman, thank you for your report.
We've acknowledged the issue and added to our backlog.

@magento-engcom-team thanx for the feedback. It might be obvious but will you also test this with the 2.2 deployment pipeline http://devdocs.magento.com/guides/v2.2/config-guide/deployment/pipeline/ (i.e. config export including multi store views and locales) ?

The languages must no longer be specified via the -l or --language flags, but as optional argument list.

This was changed and the input option was not removed causing an incorrect cli usage for --help. :facepalm:

Use it like this, and the locales will be deployed:

./bin/magento setup:static-content:deploy en_US de_DE nl_NL

Never the less they should also be generated for 'all' (i.e. when Locales are omitted)

hey @tux-rampage thank you for chiming in. I didn't dig into this further for some time, this refers back to a release candidate version some while ago. I indeed haven't used the language flag anymore for quite some time.

I didn't dig into the code but maybe @magento-engcom-team can shed some light on the supposed removal of the locale flag. Because if it has been removed than both the bin/magento se:st:de --help and dev docs documentation should be updated as well https://devdocs.magento.com/guides/v2.3/config-guide/cli/config-cli-subcommands-static-view.html .

And hopefully we can then close this 2,5 yrs old issue.

Hi @ihor-sviziev. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:


    1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

    1. Verify that the issue is reproducible on 2.4-develop branch
      Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
      - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
      - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!
    1. If the issue is not relevant or is not reproducible any more, feel free to close it.

@ennostuurman thank you! I'm closing this issue as not relevant anymore.

Was this page helpful?
0 / 5 - 0 ratings