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

Fails on initial dev/build, but works subsequently #3

Closed
lerni opened this issue Oct 9, 2021 · 2 comments
Closed

Fails on initial dev/build, but works subsequently #3

lerni opened this issue Oct 9, 2021 · 2 comments

Comments

@lerni
Copy link
Owner

lerni commented Oct 9, 2021

DB isn't ready when PublicAssetAdapter_HTAccess.ss asks for $list("SilverStripe\Assets\Folder").filter("ShowInSearch", 0) so we get

<[Emergency] Uncaught SilverStripe\ORM\Connect\DatabaseException: Couldn't run query: SELECT CASE WHEN EXISTS SELECT * FROM "File" WHERE ("File"."ClassName" IN (?))) THEN 1 ELSE 0 END Table 'ss_ssvanilla.file' doesn't exist

Happens on fresh projects with this module installed. The template for assets/.htaccess is generated early in the course of a first/initial request but than, still DB isn't generated and so querying it errors. It's a bit of a chicken egg situation, AssetAdapter should probable be tweaked to completely bail out generating assets/.htaccess if tables aren't generated yet?

@lerni lerni closed this as completed in 5456d75 Nov 15, 2021
@lerni lerni reopened this Dec 13, 2021
@digitall-it
Copy link
Contributor

One solution may be not to query the database at all during .htaccess generation, by mantaining the necessary data in sync in a separate folderindex.json file.

lerni added a commit that referenced this issue Jun 28, 2023
@lerni
Copy link
Owner Author

lerni commented Jun 28, 2023

fixed with #892da10 ? See also: silverstripe/silverstripe-framework#10332

@lerni lerni closed this as completed Jun 30, 2023
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

No branches or pull requests

2 participants