NAL-i5K / tripal_chado_datasets

Provides an admin layer and forms for users to submit organisms and analysis into Chado
0 stars 0 forks source link

i5k url check does not work as intended #37

Closed bradfordcondon closed 5 years ago

bradfordcondon commented 5 years ago

  //i5k specific code.
  $link = $GLOBALS['base_url'] . '/long-term-i5k-workspace-project-management';
  if (drupal_valid_path($link)) {
    $form['header_text'] = [
      '#markup' => '<div id="text">Thank you for your interest in submitting your genome project to the i5k Workspace! Please answer the following questions to help us decide if the resources at the i5k Workspace are a good fit for your project. Refer to our <a href="' . $GLOBALS['base_url'] . '/data-management-policy">data management</a> and <a href="' . $GLOBALS['base_url'] . '/long-term-i5k-workspace-project-management">long-term management policy</a> documents for information about the data types that we store and our long-term data management policy.</div>',
    ];
  }

Unfortunately even if this URL doesnt exist, the text displays on the form. simple error in drupal_valid_path probably?

bradfordcondon commented 5 years ago

drupal_valid_path assumes its an outside URL if the path has an http which this did becuase i was using the global site variable.

Changed to this:

  if (drupal_valid_path('long-term-i5k-workspace-project-management') && drupal_valid_path('data-management-policy')) {