🇪🇸Spain @jaramoshu

Account created on 2 June 2010, over 14 years ago
#

Recent comments

🇪🇸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

I have only removed a space.

🇪🇸Spain jaramoshu

It allows to use the modules with custom image fields.

🇪🇸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.

Production build 0.71.5 2024