Repository navigation
Fix/fresh install errors - #5
Merged
Merged
Conversation
The seeded home page was inserted without created_at/updated_at, so viewing it while logged in threw "Call to a member function toDateTimeString() on null". Seed the timestamps and guard the site views against null dates.
The datetimenotified and deniedreason migrations only ran when the table did NOT exist, so the columns were never added and order pages failed with "Unknown column". Existing installs that already recorded these migrations will need them re-run.
Module::isEnabled() throws when a module is not installed. The courses module was removed from the public repo, so /account/history failed with "Module [courses] does not exist".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
A fresh install throws errors as soon as you log in. This fixes three of them, one commit each:
datetimenotifiedanddeniedreasonmigrations had their table check inverted, so the columns were never added.Module::isEnabled('courses')throws when the module isn't installed. It's now guarded withModule::find(), the same way ContactReports does it.Related Issue
None. Found while setting up a fresh local install with the Docker setup.
Motivation and Context
Without these, a new install hits errors on
/,/account/ordersand/account/historyright after login.Heads up: existing installs already have those two Orders migrations marked as run, so they'll need to re-run them by hand. Happy to add a follow-up migration that handles this instead.
How Has This Been Tested?
Fresh Docker install (PHP 8.2, Laravel 10, MySQL 8). Reproduced each error on
masterand confirmed it's gone on this branch. The admin pages still load.phpunitresults are the same asmaster; the 22 Messages API failures were already there.