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

When editing a NEO block, the SiteUriModel contains a URL string with value "__home__" causing the homepage not to be cleared #754

Open
lenvanessen opened this issue Jan 17, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@lenvanessen
Copy link

Bug Report

We stumbled upon this issue when we where debugging why our homepage wasn't clearing properly. We've found that for some reason the magic-name __home__ isn't normalized when saving the entry when you've only edited a neo-block field. When you edit the primary title of the page however, it is correctly transformed from __home__ to '' and cleared from the cache.

We currently have a workaround in place:

	Event::on(
			RefreshCacheService::class,
			RefreshCacheService::EVENT_BEFORE_REFRESH_CACHE,
			function(RefreshCacheEvent $event) {
				$event->siteUris = array_map(
					function(SiteUriModel $siteUriModel) {
						$siteUriModel->uri = str_replace('__home__', '', $siteUriModel->uri);
						return $siteUriModel;
					},
					$event->siteUris
				);
			}

		);

But it would be nice to get it fixed.

Diagnostics Report

Marktlink
Craft CMS werkt in ontwikkelaarsmodus.
Blitz Diagnostics
Diagnostics Report
This report may be shared when requesting support. Sensitive data has been redacted, but should be double-checked before sharing publicly.

Application Info

  • PHP version: 8.2.24
  • Craft edition & version: Pro 4.13.10
  • Database driver & version: MySQL 8.3.0

Installed Plugins

  • Admin Bar: 4.3.0
  • Amazon S3: 2.2.1
  • Blitz: 4.23.10
  • CKEditor: 3.10.0
  • Cloudflare Image Transforms: 2.0.0
  • Cloudflare R2: 1.1.1
  • CP Field Inspect: 1.4.4
  • Feed Me: 5.9.0
  • Formie: 2.1.39
  • GeoMate: 2.1.3
  • Hyper: 1.3.5
  • Knock Knock: 2.0.12
  • Multi Translator: dev-lenvanessen-patch-2
  • Navigation: 2.1.1
  • Neo: 4.2.24
  • Retour: 4.1.21
  • Scout: 4.1.2
  • SEO: 4.1.10
  • Sprig: 2.13.1

Loaded Modules

  • site-module: modules\sitemodule\SiteModule
  • dealfunnel: modules\dealfunnel\DealFunnel
  • buyerscheck: modules\buyerscheck\BuyersCheck
  • personio: modules\personio\Personio
  • codeeditor: nystudio107\codeeditor\CodeEditor
  • sprig-core: putyourlightson\sprig\Sprig
  • verbb-base: verbb\base\Base
  • debug: craft\debug\Module

Blitz Plugin Settings

{
    "debug": true,
    "hintsEnabled": false,
    "cachingEnabled": true,
    "refreshCacheEnabled": true,
    "refreshMode": 1,
    "includedUriPatterns": [
        {
            "siteId": "",
            "uriPattern": ".*"
        }
    ],
    "excludedUriPatterns": [
        {
            "siteId": "",
            "uriPattern": "knock-knock"
        }
    ],
    "cacheStorageType": "putyourlightson\\blitz\\drivers\\storage\\YiiCacheStorage",
    "cacheStorageSettings": [],
    "cacheStorageTypes": [],
    "cacheGeneratorType": "putyourlightson\\blitz\\drivers\\generators\\HttpGenerator",
    "cacheGeneratorSettings": {
        "concurrency": "3"
    },
    "cacheGeneratorTypes": [],
    "customSiteUris": [],
    "cachePurgerType": "putyourlightson\\blitz\\drivers\\purgers\\DummyPurger",
    "cachePurgerSettings": [],
    "cachePurgerTypes": [],
    "deployerType": "putyourlightson\\blitz\\drivers\\deployers\\DummyDeployer",
    "deployerSettings": [],
    "deployerTypes": [],
    "ssiEnabled": false,
    "ssiTagFormat": "<!--#include virtual=\"{uri}\" -->",
    "detectSsiEnabled": true,
    "esiEnabled": false,
    "queryStringCaching": 1,
    "includedQueryStringParams": [
        {
            "siteId": "",
            "queryStringParam": "uid"
        },
        {
            "siteId": "",
            "queryStringParam": "search"
        },
        {
            "siteId": "",
            "queryStringParam": "related*"
        }
    ],
    "excludedQueryStringParams": [],
    "apiKey": "",
    "generatePagesWithQueryStringParams": true,
    "purgeAssetImagesWhenChanged": true,
    "refreshCacheAutomaticallyForGlobals": true,
    "refreshCacheWhenElementMovedInStructure": true,
    "refreshCacheWhenElementSavedUnchanged": false,
    "refreshCacheWhenElementSavedNotLive": false,
    "cacheNonHtmlResponses": false,
    "trackElements": true,
    "trackElementQueries": true,
    "excludedTrackedElementQueryParams": [],
    "cacheElements": true,
    "cacheElementQueries": true,
    "cacheDuration": null,
    "nonCacheableElementTypes": [],
    "sourceIdAttributes": [],
    "liveStatuses": [],
    "integrations": [
        "putyourlightson\\blitz\\drivers\\integrations\\CommerceIntegration",
        "putyourlightson\\blitz\\drivers\\integrations\\FeedMeIntegration",
        "putyourlightson\\blitz\\drivers\\integrations\\SeomaticIntegration"
    ],
    "defaultCacheControlHeader": "no-store",
    "cacheControlHeader": "public, s-maxage=31536000, max-age=0",
    "cacheControlHeaderExpired": "public, s-maxage=5, max-age=0",
    "sendPoweredByHeader": false,
    "outputComments": true,
    "refreshCacheJobPriority": 10,
    "driverJobBatchSize": 100,
    "driverJobPriority": 100,
    "queueJobTtr": 1200,
    "maxRetryAttempts": 10,
    "maxUriLength": 255,
    "mutexTimeout": 1,
    "commands": [],
    "injectScriptEvent": "DOMContentLoaded",
    "injectScriptPosition": 3
}

Recommendations

  • ❌ One or more globals exist and refreshCacheAutomaticallyForGlobals is enabled.
  • ❌ The blitz/cache/refresh-expired console command has not been executed within the past 24 hours.
  • ✅ Blitz is configured not to refresh cached pages when an element is saved but unchanged.
  • ✅ Blitz is configured not to refresh cached pages when an element is saved but not live.
  • ✅ Image transforms are configured to be generated before page load.
  • ✅ The @web alias is not used in the base URL of any sites.
  • ✅ Queue jobs are configured not to run automatically via web requests.
  • ✅ The Blitz Hints utility is disabled.
  • ✅ The Async Queue plugin is not installed or enabled.

Site Tracking [2]

  • Tracked Pages: 1
  • Tracked Includes: 0
  • Tracked Query String Params: 0
  • Tracked Elements: 107
    • verbb\navigation\elements\Node: 57
    • craft\elements\Entry: 36
    • craft\elements\Asset: 14
  • Tracked Element Queries: 11
    • verbb\navigation\elements\Node: 9
    • craft\elements\Entry: 2
  • Tracked Tags: 0

Site Tracking [4]

  • Tracked Pages: 0
  • Tracked Includes: 0
  • Tracked Query String Params: 0
  • Tracked Elements: 0
  • Tracked Element Queries: 0
  • Tracked Tags: 0

Site Tracking [5]

  • Tracked Pages: 1
  • Tracked Includes: 0
  • Tracked Query String Params: 0
  • Tracked Elements: 98
    • verbb\navigation\elements\Node: 49
    • craft\elements\Entry: 36
    • craft\elements\Asset: 13
  • Tracked Element Queries: 10
    • verbb\navigation\elements\Node: 8
    • craft\elements\Entry: 2
  • Tracked Tags: 0

Site Tracking [6]

  • Tracked Pages: 0
  • Tracked Includes: 0
  • Tracked Query String Params: 0
  • Tracked Elements: 0
  • Tracked Element Queries: 0
  • Tracked Tags: 0

Site Tracking [7]

  • Tracked Pages: 0
  • Tracked Includes: 0
  • Tracked Query String Params: 0
  • Tracked Elements: 0
  • Tracked Element Queries: 0
  • Tracked Tags: 0

Site Tracking [8]

  • Tracked Pages: 0
  • Tracked Includes: 0
  • Tracked Query String Params: 0
  • Tracked Elements: 0
  • Tracked Element Queries: 0
  • Tracked Tags: 0

Site Tracking [9]

  • Tracked Pages: 0
  • Tracked Includes: 0
  • Tracked Query String Params: 0
  • Tracked Elements: 0
  • Tracked Element Queries: 0
  • Tracked Tags: 0

Site Tracking [10]

  • Tracked Pages: 0
  • Tracked Includes: 0
  • Tracked Query String Params: 0
  • Tracked Elements: 0
  • Tracked Element Queries: 0
  • Tracked Tags: 0

Site Tracking [11]

  • Tracked Pages: 0
  • Tracked Includes: 0
  • Tracked Query String Params: 0
  • Tracked Elements: 0
  • Tracked Element Queries: 0
  • Tracked Tags: 0

Site Tracking [12]

  • Tracked Pages: 0
  • Tracked Includes: 0
  • Tracked Query String Params: 0
  • Tracked Elements: 0
  • Tracked Element Queries: 0
  • Tracked Tags: 0

Site Tracking [13]

  • Tracked Pages: 0
  • Tracked Includes: 0
  • Tracked Query String Params: 0
  • Tracked Elements: 0
  • Tracked Element Queries: 0
  • Tracked Tags: 0

Site Tracking [14]

  • Tracked Pages: 0
  • Tracked Includes: 0
  • Tracked Query String Params: 0
  • Tracked Elements: 0
  • Tracked Element Queries: 0
  • Tracked Tags: 0

Site Tracking [15]

  • Tracked Pages: 0
  • Tracked Includes: 0
  • Tracked Query String Params: 0
  • Tracked Elements: 0
  • Tracked Element Queries: 0
  • Tracked Tags: 0
    Craft CMS
    4.13.1
@lenvanessen lenvanessen added the bug Something isn't working label Jan 17, 2025
@bencroker
Copy link
Collaborator

That’s an unusual find. Thanks for the bug report, I’ll look into fixing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants