Using Log1x / sage-directives with sage9/php8.1

When i update my sage9 installation to php8.1 using this article: Is there a way to use Sage 9 with PHP 8.1? - #2 by evance my sage directives stop working.

Is there a workaround for this?

Could you specify on what sage directives you are using? Code examples?

Thanks for the reply!
This is my composer.json:

{
  "name": "roots/sage",
  "type": "wordpress-theme",
  "license": "MIT",
  "description": "WordPress starter theme with a modern development workflow",
  "homepage": "https://roots.io/sage/",
  "authors": [
    {
      "name": "Ben Word",
      "email": "ben@benword.com",
      "homepage": "https://github.com/retlehs"
    },
    {
      "name": "Scott Walkinshaw",
      "email": "scott.walkinshaw@gmail.com",
      "homepage": "https://github.com/swalkinshaw"
    },
    {
      "name": "QWp6t",
      "email": "hi@qwp6t.me",
      "homepage": "https://github.com/qwp6t"
    }
  ],
  "keywords": ["wordpress"],
  "support": {
    "issues": "https://github.com/roots/sage/issues",
    "forum": "https://discourse.roots.io/"
  },
  "autoload": {
    "psr-4": {
      "App\\": "app/"
    }
  },
  "repositories": [
    { "type": "vcs", "url": "https://github.com/jeh5256/sage-installer" },
    { "type": "vcs", "url": "https://github.com/jeh5256/sage-lib" }
  ],
  "require": {
    "php": "^7.4|^8.0",
   	"composer/installers": "^2.0",
    "roots/sage-installer": "^2.0",
    "roots/sage-lib": "dev-master",
    "soberwp/controller": "~2.1.0",
    "roots/sage-woocommerce": "^1.0",
    "log1x/sage-directives": "^1.1",
    "stoutlogic/acf-builder": "^1.10"
  },
  "require-dev": {
    "squizlabs/php_codesniffer": "^2.8.0"
  },
  "scripts": {
    "test": ["phpcs"],
    "post-create-project-cmd": [
      "Roots\\Sage\\Installer\\ComposerScript::postCreateProject"
    ]
  },
  "config": {
    "allow-plugins": {
      "kylekatarnls/update-helper": false,
      "composer/installers": true
    }
  }
}

Now i am talking about log1x/sage-directives which stopped working.

Do you get an error of some sort running composer update in your theme folder with this setup?

What do you refer to when saying

my sage directives stop working

? Any errors here?

Please post them.

Also: As you are not using log1x/blade-svg-sage then you might have to explicitely composer require illuminate/support.

1 Like

It doesnt compile anymore in the uploads/cache files, so it for example shows @field(‘test’) instead of the compiled PHP

Maybe check if ACF is activated? Judging by the docs this could well be the explanation (no error thrown, @field showing in cache files)…?

The following directives are for use with Advanced Custom Fields. If ACF is not installed and activated, they will not be initialized.

Otherwise I am clueluess and cannot offer any more help, sorry…

@Erwin_Wijnveld_BOOOM were you able to find a solution here?

I have a similar problem, soberwp/controller stopped working.

For posterity, this was solved in @herdl-ash’s new topic

1 Like