calacademy-research / antcat

World Catalog of Ants
19 stars 8 forks source link

Taxon history items garbled #137

Closed marekborowiec closed 7 years ago

marekborowiec commented 8 years ago

There are some cases where formatting of taxon history fails. It appears that some curly braces are not properly escaped? In the 'regular' taxon history view there simply appear to be some superfluous curly braces but in the edit view it can even result in unnecessary breaking-up of history items (I'm guessing these two problems are related).

See for example here: http://antcat.org/taxa/450200/edit and here: http://antcat.org/taxa/442917/edit

jonkerz commented 8 years ago

@marekborowiec I think the code that caused all double braces has been fixed. Saving a taxt item with this issue removes the brackets (tested in dev), and of all the items with this issue, the most recent was updated 2015-05-13, so it may have been fixed already.

I wrote a Rake task for removing all of them months ago, but we haven't run it yet (see).

The stray brackets in the items you linked, do you know if they were introduced recently?

bpescador commented 8 years ago

@jonkerz can you rerun the Rake task and see if it takes care of these two examples. I think these double brackets in the two examples have been there a long time since they include the Brown reference which we knew was a previous problem.

On Mon, Apr 11, 2016 at 9:19 AM, jonkerz notifications@github.com wrote:

@marekborowiec https://github.com/marekborowiec I think the code that caused all double braces has been fixed. Saving a taxt item with this issue removes the brackets (tested in dev), and of all the items with this issue, the most recent was updated 2015-05-13, so it may have been fixed already.

I wrote a Rake task for removing all of them months ago, but we haven't run it yet (see https://github.com/calacademy-research/antcat/blob/a10f30e28263b057550cf73e70cd0a68894cc7a0/lib/tasks/database_maintenance.rake#L115 ).

The stray brackets in the items you linked, do you know if they were introduced recently?

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/calacademy-research/antcat/issues/137#issuecomment-208196819

Brian Fisher Curator of Entomology and Patterson Scholar 55 Music Concourse Drive California Academy of Sciences San Francisco, CA 94118, USA www.fisherlab.org www.antweb.org ResearchGate https://www.researchgate.net/profile/Brian_Fisher7 photos from ongoing Fulbright in Mozambique: https://flic.kr/s/aHsku6pCu2

jonkerz commented 8 years ago

@bpescador It has actually never been run, only tested in dev, and it still works if that's what you're asking. I don't think there will be any issues, but since there are ~3300 items with this issue, we could try it on a test instance first just to be on the safe side. Note: the Rake task has to be tweaked slightly if it is executed on the current test instance with the activity feed, or we would end up with 3300 new items in the feed. Either way, it has to be run in a Rails instance connected to the live db (obviously).

jonkerz commented 7 years ago

Fixed in e9e31e18b33474bc5e3314e81da0cdba461572ca.