Skip to content

Instantly share code, notes, and snippets.

find the below error message in nginx error log: upstream sent too big header while reading response header from upstream

add the three rows to http and server section

fastcgi_buffer_size 256k;
fastcgi_buffers 32 256k;
fastcgi_busy_buffers_size 256k;

Show error message:

Unable to install Media Image, core.entity_form_display.media.image.default, core.entity_view_display.media.image.default, media.type.image already exist in active configuration.

delete 3 record in config table:

core.entity_form_display.media.image.default
core.entity_view_display.media.image.default
media.type.image
@PureLandFlying
PureLandFlying / drupal theme setting reset .md
Last active July 8, 2019 16:51
In EntityStorageBase.php line 482: 'block' entity with ID 'xxx_messages' already exists.

when we enable a theme, we can reset theme setting if below message shows up

In EntityStorageBase.php line 482:

  'block' entity with ID 'themename_messages' already exists.

for Drupal 6/7

@PureLandFlying
PureLandFlying / composer.json for drupal .md
Last active July 7, 2019 21:22
Composer returns "Your requirements could not be resolved to an installable set of packages"

composer update drupal/core --with-dependencies

Your requirements could not be resolved to an installable set of packages.

Problem 1 - don't install drupal/core 8.7.4|remove drupal/drupal No version set (parsed as 1.0.0) - remove drupal/drupal No version set (parsed as 1.0.0)|remove drupal/core 8.7.4 - don't install drupal/core 8.7.4|remove drupal/drupal No version set (parsed as 1.0.0) - Installation request for drupal/drupal No version set (parsed as 1.0.0) -> satisfiable by drupal/drupal[No version set (parsed as 1.0.0)].

  • Installation request for drupal/core ^8.7.4 -> satisfiable by drupal/core[8.7.4].
# Leverage Browser Caching by SG-Optimizer
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 2 months"
# CSS
ExpiresByType text/css "access plus 4 hours"
# Data interchange
ExpiresByType application/json "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType text/xml "access plus 0 seconds"
function main() {
var adGroupIterator = AdsApp.adGroups().withCondition("CampaignStatus = ENABLED").withCondition("AdGroupType IN [SEARCH_STANDARD, SEARCH_DYNAMIC_ADS]").get();
while (adGroupIterator.hasNext()) {
var adGroup = adGroupIterator.next();
var gn=adGroup.getName().replace(/[\s|<|>|=]/g,'_');
var cn=adGroup.getCampaign().getName().replace(/[\s|<|>|=]/g,'_');
adGroup.urls().setCustomParameters({adgroup: gn, campaign: cn});
adGroup.urls().setTrackingTemplate("{lpurl}?utm_medium=Search&utm_source=GoogleSearch&utm_campaign={_campaign}&utm_content={_adgroup}&utm_term={keyword}")
}
}