unicef / iogt

BSD 2-Clause "Simplified" License
25 stars 35 forks source link

Warn about manually inserted internal links during migration #646

Closed geoo89 closed 2 years ago

geoo89 commented 3 years ago

While ideally links to internal pages should be done via page blocks, we should log warnings whenever we encounter manual links to internal pages so that they can be fixed manually. (This will need another commandline argument for the migration, which identifies the site itself, such as www.internetofgoodthings.org or tz.goodinternet.org )

Examples: Internal link done in HTML: https://www.internetofgoodthings.org/admin/pages/3041/edit/ https://www.internetofgoodthings.org/section/parents-caregivers/vaccines/countrys-vaccination-schedule/ http://mena.iogt.site/en/sections/parents-caregivers/vaccines/countrys-vaccination-schedule/

Internal link done in Markdown: https://www.internetofgoodthings.org/admin/pages/1809/edit/ https://www.internetofgoodthings.org/section/connect-smart/internet-safety/receiving-messages-about-winning-money/ http://mena.iogt.site/en/sections/connect-smart/internet-safety/receiving-messages-about-winning-money/

A string match for the site url within any kind of content blocks will be sufficient here. As part of the warning, output a link to the V2 page and the admin panel.

cbunicef commented 3 years ago

Can you explain a bit what the problems are which require these to be fixed manually? For example the manual internal link on

V1 https://www.internetofgoodthings.org/section/parents-caregivers/vaccines/countrys-vaccination-schedule/ V2 http://iogt-global-showcase.idems.international/en/sections/parents-caregivers/vaccines/countrys-vaccination-schedule/

Both seem to work the same way. I see potentially a problem with sites accessible on two domains, but what else?

geoo89 commented 3 years ago

In the migrated page, the link still points to the document/page hosted on www.internetofgoodthings.org Currently, that means that the user will leave the V2 site (http://iogt-global-showcase.idems.international) and end up on the V1 site (www.internetofgoodthings.org). Once the V2 site is hosted on www.internetofgoodthings.org these links will not work anymore as the URL patterns are different from V1 to V2 (e.g. https://www.internetofgoodthings.org/section/connect-smart/share-your-story-us/ becomes http://mena.iogt.site/en/sections/connect-smart/share-your-story-us/ , and taking different locales into account this is not entirely trivial to fix.)

ehmadzubair commented 2 years ago

Proposed Resolution:

ehmadzubair commented 2 years ago

@mbilalhameed