Giter Club home page Giter Club logo

Comments (8)

QWp6t avatar QWp6t commented on June 12, 2024

Is this the result of a cached config?

from acorn.

ouun avatar ouun commented on June 12, 2024

@QWp6t cached and not cached.

from acorn.

oxyc avatar oxyc commented on June 12, 2024

I used this on a multisite with acorn v2 and parent/child themes that had similar issues, maybe it’s useful https://gist.github.com/oxyc/d5f62c41b6ed87f743d33c1b3c5a5c30

from acorn.

ouun avatar ouun commented on June 12, 2024

Hi @oxyc
Thanks a lot but I am afraid I do not get the context. Can you please explain a bit which parts might be of help to solve what? Is this overwriting the Config getter? Thanks a lot

from acorn.

oxyc avatar oxyc commented on June 12, 2024

So 6 months later I updated acorn :)

In functions.php I changed:

@@ -40,7 +40,12 @@ if (! function_exists('\Roots\bootloader')) {
     );
 }
 
-\Roots\bootloader()->boot();
+$bootloader = \Roots\bootloader();
+$bootloader->getApplication()->bind(
+    \Roots\Acorn\Bootstrap\LoadConfiguration::class,
+    \App\Bootstrap\LoadConfiguration::class
+);
+$bootloader->boot();
 
 /*

Add added this to app/Boostrap/LoadConfiguration.php:

<?php

namespace App\Bootstrap;

use Illuminate\Contracts\Foundation\Application;
use Roots\Acorn\Bootstrap\LoadConfiguration as AcornLoadConfiguration;

class LoadConfiguration extends AcornLoadConfiguration
{
    /**
     * {@inheritdoc}
     */
    public function bootstrap(Application $app)
    {
        parent::bootstrap($app);

        // When `wp acorn optimize` runs it will create a cached config.php file
        // with pre-determined values at build times. This causes issues with
        // multisite since the config.php file uses get_theme_file_path() which
        // needs to be dynamically evaluated per site.
        // Here we override the cached config by re-evaluating the config files.
        $this->loadConfigurationFiles($app, $app->make('config'));
    }
}

The context for this was parent/child theme having cached theme paths but same should apply to l10n.

from acorn.

slackday avatar slackday commented on June 12, 2024

Any update on fixing this? I get translations to work as normal in WordPress but then suddenly they stop working. I try some combination of wp acorn optimize wp acorn optimize:clear yarn translate yarn translate:compile and it starts working again to stop working again later on. Not sure what's wrong.

from acorn.

retlehs avatar retlehs commented on June 12, 2024

All the updates so far are in this issue β€” there has not yet been a PR submitted to address this in Acorn

Did you try the solution from the comment above you?

from acorn.

slackday avatar slackday commented on June 12, 2024

Sorry if I hijacked the issue. I tried the solutions but they did not work for me. My problem seems to be with log1x/poet package. This comment helped me Log1x/poet#46 (comment)

from acorn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.