Account created on 10 November 2011, over 12 years ago
#

Merge Requests

Recent comments

🇦🇺Australia Toby Wild

Hi smethawee.

This worked for me today:

In the directory /themes/civictheme

On the command line I ran:

php civictheme_create_subtheme.php cttesttheme "Test Theme" "Human theme description" ../cttest

Breaking that down it goes as:

  1. php: running a PHP command on the command line
  2. civictheme_create_subtheme.php: Triggering that file
  3. cttestheme: That is the machine name of the theme I want to create
  4. "Test Theme": Is the human readable name
  5. "Humn theme description": That is the theme description
  6. ../cttest: Means go back one directory (Back into /themes) and create it in the new folder "cttest"

If you just straight up copy and paste the suggested command without changing the theme machine name and path arguments, it wont work.

If this doesn't work for you, can you provide what error you are seeing, or what outcome is happening at all?

🇦🇺Australia Toby Wild

Clarifying my above suggestion:

/**
 * Preprocess block function to add additional cache context on Banner block.
 */
function <THEMENAME>_preprocess_block(&$variables) {
  if ($variables['base_plugin_id'] != 'block_content') {
    return;
  }

  $node = \Drupal::routeMatch()->getParameter('node');
  $block = $variables['elements']['content']['#block_content'];

  // If the node is not loaded, adjust the cache max-age of the banner block to -1.
  if ($block && $block->bundle() == 'civictheme_banner' && !$node) {
    $variables['#cache']['max-age'] = 0;
  }
}

🇦🇺Australia Toby Wild

Adding a pre_process function to the theme should fix this.


function <THEMENAME>_preprocess_block(&$variables) {

  if ($variables['configuration']['label'] && $variables['configuration']['label'] == 'Banner') {
    $variables['#cache']['contexts'][] = 'user';
  if ($variables['base_plugin_id'] != 'block_content') {
    return;
  }

  /** @var \Drupal\node\Entity\Node $node */
  $node = \Drupal::routeMatch()->getParameter('node');

  $block = $variables['elements']['content']['#block_content'];

  // If the node is not loaded, adjust the cache max-age of the banner block to -1.
  if ($block && $block->bundle() == 'civictheme_banner' && !$node) {
    $variables['#cache']['max-age'] = 0;
  }
}
🇦🇺Australia Toby Wild

Hi.

I have tested the current 1.x-dev branch and everything appears to be working correctly, however it is showing a failed Gitlab CI Pipeline (https://git.drupalcode.org/project/consultation/-/jobs/855721)

But all the issues outlined above appear to be implemented and working.

🇦🇺Australia Toby Wild

Pushed change to issue fork that wraps the code that changes the to_mail variable to check if we are coming from the webform_submission_resend form.

Also tested this code to ensure it still works when normal submissions are submitted, and everything appears to work correctly.

$_POST['form_id'] should always exist, as this is a FormHandler, which by definition must always be submitted from a Form with a form_id.

https://git.drupalcode.org/project/consultation/-/merge_requests/6

🇦🇺Australia Toby Wild

Had the same issue, and can confirm that changing array_flip to array_keys solved it.

🇦🇺Australia Toby Wild

Also now getting this error:

Drupal\Component\Plugin\Exception\PluginNotFoundException: The "civictheme_one_column" plugin does not exist. Valid plugin IDs for Drupal\Core\Layout\LayoutPluginManager are: layout_twocol_section, layout_threecol_section, layout_fourcol_section, layout_onecol, layout_twocol, layout_twocol_bricks, layout_threecol_25_50_25, layout_threecol_33_34_33, layout_builder_blank in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 53 of /Users/tobywild/Sites/second/web/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).

Production build 0.69.0 2024