jywarren / mapknitter

Use Public Lab's MapKnitter to turn your aerial images into projected maps for print and web
http://mapknitter.org
GNU General Public License v3.0
44 stars 0 forks source link

Added friendly_id to maps #182

Closed vidurangaw closed 9 years ago

vidurangaw commented 9 years ago

In old mapknitter, it used "name" as unique field. But now we use "slug" or "id" field for that. So I changed most of the href links which refers to a map by its name, to slug field. I skipped changing them in legacy map views because they don't work anymore. Also, I didn't change them in image, export and tms links because it could effect the current data. We need to fix them too.

jywarren commented 9 years ago

OK, i've successfully merged this into the v2-intial-release branch, and then into publiclab master! Thanks, @vpowerrc!

jywarren commented 9 years ago

Hi, @vpowerrc, I'm getting

Mysql2::Error: Duplicate entry 'njn' for key 'index_maps_on_slug': UPDATE maps m SET m.slug = m.name

when I run it on a copy of the production database. Perhaps we have to insert a line to find and delete duplicate map names, or something? I'll manually fix that and see if it's the only one.

jywarren commented 9 years ago

none I've found include two copies of a map where both have images. So I'm writing a part of the migration to delete image-less map duplicates; we'll see how that goes.

vidurangaw commented 9 years ago

Okay. BTW did you see my comment above? I didn't change some of the links/routes. We have to change them, otherwise app won't work properly. Please check it

jywarren commented 9 years ago

yes, thanks. I'll be overhauling all of the routes, and preserving all legacy URLs

vidurangaw commented 9 years ago

cool