luyadev / luya

LUYA is a scalable web framework and content management system with the goal to please developers, clients and users alike.
https://luya.io
MIT License
812 stars 207 forks source link

Theme basepath #2002

Closed boehsermoe closed 4 years ago

boehsermoe commented 4 years ago

Problem here is, that the imported base path (the theme name) will be stored in the database. And the same base path will be searching in the database. But if the base path is changed while config loading from alias to an absolute path, this theme cannot found.

this closes #1970

codeclimate[bot] commented 4 years ago

Code Climate has analyzed commit 715af6fa and detected 1 issue on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1

The test coverage on the diff in this pull request is 87.5% (80% is the threshold).

This pull request will bring the total coverage in the repository to 65.3% (0.0% change).

View more on Code Climate.

boehsermoe commented 4 years ago

I have found one more problem with relative and absolute path. Theme base path will be stored in the database and have to be found also if the app is installed in other location or maschine.

My idea was to save all theme base paths as alias. Each loaded theme from a package will be imported and stored with the alias "@vendor" in the db. https://github.com/luyadev/luya/pull/2002/files#diff-6bb382275a22b5600c36a95ae7d0f1dbR185

Problem could be, that already exists themes would be imported again with the alias base path and the active theme (with the old basepath) cannot found. I have to test this behaviour.

nadar commented 4 years ago

Sorry i am a bit outdated, but what is the situation with this PR, does it fix the issue (https://github.com/luyadev/luya/pull/2002#issuecomment-601024034) or does it conflict with your comment. can we merge? Current version would be 1.2 (please adjust changelog)

boehsermoe commented 4 years ago

This PR should be ready to merge. Every theme from a vendor package will be imported again with a new base path and the old entry will be delete from the importer automatically.