CorrelAid / correlaid_website

Source code for the CorrelAid website
https://correlaid.org
3 stars 0 forks source link

Static build should not allow for empty translations in blog pages. #504

Closed KonradUdoHannes closed 1 month ago

KonradUdoHannes commented 10 months ago

Currently the static build successfully builds if blog posts have empty translations. This seems to negate the language fallback mechanism for blog posts (at least in some cases).

Either the fallback mechanism should be made more robust or the static build should fail in such a situation.

The real fix in either situation is to delete the empty translation in directus, but maybe we can make issues on the website less likely until its fixed in the cms. I also feel that fixing the issue in directus is not entirely straight forward, so I'm wondering how we can make sure that content creators know how to do it.

jstet commented 10 months ago

Yes i stumbled over the empty translation thing in the past already. Apparently, if u start to write something in directus, but then delete your text, its saved differently to when not starting a text at all.

But i thought the function i wrote handled this. Will check on monday.

Is this causing the bug described here?: https://github.com/CorrelAid/correlaid_website/issues/507

KonradUdoHannes commented 10 months ago

I also thought the I saw code handling the such an issue, but apparently it does not always work. I already fixed the issue in production before doing a full investigation because I didn't want to leave prod broken. We have to see how easily we can reproduce it. Maybe its an issue of the form '' vs ' ' and all of the sudden the string was not falsy.

Not sure whether its related to #507. I also noticed this issue already and was wondering but did not have time to look into it yet.

Either way I think its important that the content creators also know how to delete the empty translations in directus once it happens. Does anybody know a good place where we could document this?

friep commented 10 months ago

Today, we published first version of the docs for directus: https://docs.correlaid.org/wiki/infrastructure/directus-content-management-system

i'll send you the invite link to gitbook via DM for the future. but i can add this to the list of documentation todos and work on it.

KonradUdoHannes commented 10 months ago

@friep thanks. I added a section about removing empty translations to Tips and Tricks

KonradUdoHannes commented 10 months ago

Previews for blog posts are implemented (#513) This might help to create examples without affecting production for investigating this issue further.

jstet commented 1 month ago

with #679 it wont