🇪🇸Spain jaramoshu
In patch with code:
- $path = implode('/', $args);
+$path = '/' . implode('/', $args);
It doesn't solve my problem. However, the following modification does:
if ((strpos($path, '/') !== 0) && (strpos($path, '#') !== 0) && (strpos($path, '?') !== 0)) {
$url = $path;
} else {
$url = Url::fromUserInput($path, $options)->toString();
}
🇪🇸Spain jaramoshu
In my case it throws:
Warning: Undefined array key "url" in Drupal\Core\Asset\JsCollectionOptimizerLazy->optimizeGroup() (line 174 of /var/www/html/web/core/lib/Drupal/Core/Asset/JsCollectionOptimizerLazy.php).
This is the undefined "url" key. To avoid this situation I check with isset().
🇪🇸Spain jaramoshu
How to use it?
In my module:
/**
* Implements hook_form_FORM_ID_alter().
*/
function MYMODULE_form_field_config_edit_form_alter(&$form, FormStateInterface $form_state, $form_id) {
if (\Drupal::service('module_handler')->moduleExists('upload_image_changer')) {
return \Drupal::service('upload_image_changer.hooks')->formFieldConfigEditFormAlter($form, $form_state, $form_id, 'myfield_image');
}
}
🇪🇸Spain jaramoshu
The $field_type parameter is added to the formFieldConfigEditFormAlter() function.
🇪🇸Spain jaramoshu
jaramoshu → created an issue.