Limerick
Account created on 16 April 2018, over 6 years ago
#

Recent comments

🇮🇪Ireland b0gucki3 Limerick

That does not really answer my question, as I wanted to set the available paragraphs in a paragraph field using code only, not the UI.

That said, I figured out how to do it with code alone.

As @berdir mentioned, there are two handler settings (target_bundles and target_bundles_drag_drop). The target_bundles_drag_drop setting needs to be configured. Here's an example implementation, in case someone else needs it.

$field_definition = \Drupal::entityTypeManager()->getStorage('field_config')
    ->load('node.' . $content_type . '.' . $field_name);

// Ensure the field exists and has the target_bundles setting.
if ($field_definition) {
    // Get the handler settings, which contain 'target_bundles'.
    $handler_settings = $field_definition->getSetting('handler_settings');

    // Define the allowed types with their configuration.
    $target_bundles = $handler_settings['target_bundles'];
    $target_bundles[$paragraph_type] = $paragraph_type;

    // Define the target_bundles_drag_drop structure.
    $target_bundles_drag_drop = $handler_settings['target_bundles_drag_drop'];
    $target_bundles_drag_drop[$paragraph_type] = [
        'enabled' => true,
    ];

    // Define the handler settings.
    $handler_settings = [
        'target_bundles' => $target_bundles,
        'negate' => 0,
        'target_bundles_drag_drop' => $target_bundles_drag_drop,
    ];

    // Update the field configuration.
    $field_definition->setSetting('handler_settings', $handler_settings);

    // Save the updated field configuration.
    $field_definition->save();
}
🇮🇪Ireland b0gucki3 Limerick

I'm attaching a patch here that adds _admin_route: TRUE to profile.routing.yml directly.

🇮🇪Ireland b0gucki3 Limerick

Adding #11 as .patch for easier deployment.
I'm having the same issue on Drupal 10.2.6 when importing config. I still cannot figure out how to reproduce the issue.

🇮🇪Ireland b0gucki3 Limerick

I'm having the same issue with SiteGround running PHP 8.1 on bash.

Setting up the makes sense, and it's logical.

alias php='/usr/local/bin/php81'
alias drush='/usr/local/bin/php81 -d memory_limit=2048M [directory path]/public_html/[project name]/vendor/drush/drush/drush.php'
alias composer='/usr/local/bin/php81 -d memory_limit=4096M /usr/local/bin/composer.phar'

However overriding /vendor/bin/drush with "#!/usr/local/bin/php81" feels wrong, even with a patch.

I'm starting to realize that SiteGround isn't an ideal choice for Drupal.

🇮🇪Ireland b0gucki3 Limerick

#49 worked for me. Many thanks!

Production build 0.71.5 2024