1

I am installing a custom distribution, I have created a form:

my_distribution.install:

/**
 * Implements hook_install_tasks().
 */
function my_distribution_install_tasks(&$install_state) {
  $tasks = [
    "extra_configs" => [
      "display_name" => t("Extra configurations"),
      "type" => "form",
      "function" => "Drupal\my_distribution\Form\ExtraConfigsForm",
    ]
  ];

  return $tasks;
}

Drupal\my_distribution\Form\ExtraConfigsForm.php:

// more code ...

/**
 * {@inheritdoc}
 */
public function buildForm(array $form, FormStateInterface $form_state) {
    $form['#title'] = $this->t('Extra configurations');

    $form['logo'] = [
        '#type' => 'managed_file',
        '#title' => t('Load logo'),
        '#upload_location' => 'public://logo/',
        '#upload_validators' => [
          'file_validate_extensions' => [
            'png jpg jpeg',
          ],
        ],
        '#required' => TRUE,
      ];

    $form['actions'] = ['#type' => 'actions'];
    $form['actions']['submit'] = [
      '#type' => 'submit',
      '#value' => $this->t('Save and continue'),
      '#button_type' => 'primary',
    ];

    return $form;
}

// more code ...

Everything works fine but, when I get to that form and load an image I get an error in the javascript console, and i can't continue:

AjaxError: 
An AJAX HTTP error occurred.
HTTP Result Code: 404
Debugging information follows.
Path: /core/install.php/%3Cnone%3E?element_parents=logo&langcode=es&profile=my_distribution&ajax_form=1
StatusText: Not Found
ResponseText: {"message":"No route found for \u0022POST \/core\/install.php\/%3Cnone%3E\u0022 (from \u0022http:\/\/my-distribution.local\/core\/install.php?langcode=es\u0026profile=my_distribution\u0022)"}

In watchdog i only see:

ID  Date          Type      Severity  Message                                                                                                                                             
79  08/Oct 13:15  page not  warning   /core/install.php/%3Cnone%3E?element_parents=logo&langcode=es&profile=my_distribution&ajax_form=1&_wrapper_format=drupal_ajax 

Drupal version: 8.5.7

What could be the issue?

1 Answer 1

1

Try add:

rewrite ^/core/install.php/(.*)$ /core/install.php$1;

to the config/nginx/drupal8.conf about line 16.

Adapting from:

https://github.com/kalabox/kalabox/issues/1767

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.