MushroomObserver / mushroom-observer

A website for sharing observations of mushrooms.
https://mushroomobserver.org
MIT License
77 stars 25 forks source link

MO incorrectly prepends config.http_domain to some urls #1761

Closed JoeCohen closed 7 months ago

JoeCohen commented 7 months ago

Example:

NOTE:

  1. The link is created by these lines in app/views/controllers/names/_form.html.erb:
    <% between = tag.div(:form_names_taxonomic_notes_warning.t, class: "mark") %>
    <%= text_area_with_label(form: f, field: :notes, rows: 6,
                           label: :form_names_taxonomic_notes.t + ":",
                           between: between) %>

    The translation symbol :form_names_taxonomic_notes_warning is defined in config/locales/en.txt as

    form_names_taxonomic_notes_warning: Please avoid duplicating information from <a href=\"https://www.indexfungorum.org/\">Index Fungorum</a> (IF) or  <a href=\"https://www.mycobank.org/\">MycoBank</a> (MB) in the [:form_names_taxonomic_notes]. Instead, enter the Index Fungorum Registration Identifier or the MycoBank number in the [:form_names_icn_id] field above. This will automatically create links to both IF and MB.
  2. The link to ICN in the Author section is correct. It is created by
    <%= text_area_with_label(
          form: f, field: :author, rows: 2, label: :Authority.t + ":",
          append: help_block(:p, :form_names_author_help.t)
        ) %>

    Where form_names_author_help is defined as:

    form_names_author_help: "Include the author using <a href=\"https://www.iapt-taxon.org/nomen/main.php?page=art46\" target=\"_new\">ICN</a> format. <b>[:Authority]</b> may also include “sensu” and/or status information. E.g.: <br>&nbsp;&nbsp; (Singer) Jenkins <br>&nbsp;&nbsp; sensu Ginns <br>&nbsp;&nbsp; N. Siegel & C.F. Schwarz nom. prov."
JoeCohen commented 7 months ago

Solution

Quote the YAML values in the symbol definitions.

form_names_taxonomic_notes_warning: "Please avoid ..."

I should have figured that out earlier. I'll fix any issues in app/views/controllers/names/_form.html.erb while I'm updating that page for other reasons. (In progress.)

JoeCohen commented 7 months ago

This is fixed in PR #1762