Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Check and convert types to string if not already #259

Closed
wants to merge 1 commit into from

Conversation

tech2serve
Copy link
Contributor

Some sites have trouble displaying meetings when the 11th Step Meditation
type, being sanitized to create css classes, throws an error because the
11 is an integer instead of a string.

It remains unclear why this only affects a small set of sites.

closes #257

Some sites have trouble displaying meetings when the 11th Step Meditation
type, being sanitized to create css classes, throws an error because the
11 is an integer instead of a string.

It remains unclear why this only affects a small set of sites.

closes #257
@crispyatl
Copy link
Contributor

There are a few issues here:

#1 Instead of:

typeClass = typeof obj.types[i] === 'string' ? obj.types[i] : obj.types[i].toString();
classes.push('type-' + sanitizeTitle(typeClass));

You can simply do:
classes.push('type-' + sanitizeTitle(obj.types[i].toString()));

#2 Instead of fixing this one field, we could fix future issues with any fields by doing the string conversion in sanitizeTitle(). Since the function deals with titles, whatever it is passed should be converted to a string if it isn't already. I will create a new PR for this.

@crispyatl crispyatl closed this Jan 16, 2021
@tech2serve tech2serve deleted the 257-fix-sunday-meetings-not-showing branch July 8, 2021 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants