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();
}
b0gucki3 → created an issue.
I can confirm that #11 works on 10.3.9. Thanks!
I'm attaching a patch here that adds _admin_route: TRUE
to profile.routing.yml directly.
#61 works perfectly on 10.3.2, thanks.
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.
10.2.5 - Patch #11 Fixed it for me. Thanks!
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.
#49 worked for me. Many thanks!
I can confirm that #8 works for me on 9.5.2.