Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes an issue with English language activity and Spanish and Mandarin artist names.
Problem 1
We're not seeing English language activity text: Both in the CMS and the FE, English language activity text (eg detailNarrative, lookAgain, and activityTemplate) isn't being correctly pulled in. Spanish and Mandarin content is working without issue.
From nikhil: "It appears that the seeders are not pulling that data in from the current production JSON files. I wonder if something is going awry with the English translations here: https://github.com/art-institute-of-chicago/journeymaker-cms/blob/develop/database/seeders/ArtworkSeeder.php#L71-L85"
Solution
nikhil correctly pointed out the source of the issue. When merging the English values with the translated values, I used the incorrect
snake_casing
when I should have built the English array using the samecamelCasing
as the translations. This bug affected the detail narrative, viewing description, activity instructions, and location directions.Problem 2
We also do not see Spanish and Mandarin artist names: Similar, but different! Again, in both the CMS and the FE, the Spanish and Mandarin artist names aren't being pulled from the JSON. Within the CMS these fields are just blank, and then on the FE they render as
null
.Solution
This one was more tricky. The artist's name appears in both the Spanish and Mandarin data. When the data is passed to
ArtworkRepository::firstOrCreate
it callsprepareFieldsBeforeCreate
, which was setting $translatedFields.This bug was introduced in PR #40, updating seeders to add revisions and activity. Before this the
ArtworkRepository
was not used during the seeding process.