1

In desperate need of some help!

I noticed on one of my multi-sites, 5 out of 8 sites have items missing in the Globals sidebar..

When I manually type in the URL to view one of the global items I get: 403 — User not permitted to edit global set

I've checked in Utilites > Queue Manager and see Propagating global sets has failed. When I click inside the error shows Attempting to save an element in an unsupported site.

Does anyone know how to fix this? I'm assuming it's maybe my project config thats messed up somewhere.


Edit:
Also, creating a new site doesn't show Globals either.
And my local dev database seems to be showing the Globals, but staging does not.

2 Answers 2

2

I think the failed propagation job is the problem here.

You can re-run this by creating an executable to push a new propagation job.

Duplicate your craft executable and rename it to propagate (or anything you like.

Replace the code with this:

#!/usr/bin/env php
<?php
/**
 * Craft console bootstrap file
 */

// Set path constants
define('CRAFT_BASE_PATH', __DIR__);
define('CRAFT_VENDOR_PATH', CRAFT_BASE_PATH.'/vendor');

// Load Composer's autoloader
require_once CRAFT_VENDOR_PATH.'/autoload.php';

// Load dotenv?
if (class_exists('Dotenv\Dotenv') && file_exists(CRAFT_BASE_PATH.'/.env')) {
    Dotenv\Dotenv::create(CRAFT_BASE_PATH)->load();
}

// Load and run Craft
define('CRAFT_ENVIRONMENT', getenv('ENVIRONMENT') ?: 'production');
$app = require CRAFT_VENDOR_PATH.'/craftcms/cms/bootstrap/console.php';

// change this to your primary site id
$primarySiteId = 1;

$app->queue->push(new \craft\queue\jobs\PropagateElements([
        'elementType' => \craft\elements\GlobalSet::class,
        'criteria' => [
            'siteId' => $primarySiteId,
        ],
        'siteId' => null,
    ]
));
exit(0);

Change $primarySiteId to your primary site ID :)

Now run ./propagate (or whatever you named the file).

This will create a new job that will (re)propagate your Globalsets to all your sites.

2

You're probably experiencing this issue which can result in global sets not being created in some environments. This issue has already been fixed, the fix will be release with the next Craft version (likely 3.7.31).

Please try to update to the latest development version by requiring the latest dev version of craft in your composer.json:

"require": {
    "craftcms/cms": "dev-develop as 3.7.30.1",
}

Then use composer update to get the latest dev version and php craft project-config/apply --force in your staging environment (and ever other affected environment).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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