Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed issue: custom css/js not loaded on extended themes
- Loading branch information
LouisGac
committed
Feb 9, 2018
1 parent
e600c10
commit bcda36f
Showing
2 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
bcda36f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
? Then :
version.php
must go out of repo ?Why not use a DB settings for this ?
PS : for regenerate assets in plugin i use a extra file : 1, 2, 3 … or a
touch assets/ok
unlink asstets/ok
with a test of DB version vs Class constant.bcda36f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we removed the "touch" way of doing because directory modification date is not reliable enough.
LimeSurvey/application/core/LSYii_AssetManager.php
Line 32 in 9c9ac0f
test DB vs "constant" is exactly what we're doing (the system is the very same as for DB upgrade)
bcda36f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHP file update version.php here
fwrite($handle, $line);
DB upgrade didn't update version.php file, only DB
And about touch : you trye to use touch on directory, not add/remove a file on directory. Tested on a lot of different system.
bcda36f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/LimeSurvey/LimeSurvey/blob/master/application/config/version.php#L16
When running comfort update, version.php is updated, then dbversion in db and in version are different, then the update of db is launched.
I agree I could make it more complex for asset version number, using a version number from the Theme XML itself
bcda36f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know how DB update work … but if you update a PHP file in a directory , this file can't be included in GIT …
After this commit :
application/config/version.php
must be added to .gitignorebcda36f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?
bcda36f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/LimeSurvey/LimeSurvey/blob/master/application/models/UpdateForm.php#L394
bcda36f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because i can have a different buildnumber than yours in the same GIT commit id.
What happen if you update (
generateAssetVersionNumber
) 5 times and me only 3 times ?bcda36f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now: custom asset version number is > 100000, whereas repo asset version number is > 30000
So let say you start with version number 30014, if you update one time you'll be at 130014, two time you'll be at 130015, etc. If then you update using CU or manual update, then you'll be at 30015.
Again, I agree that a system based on the theme manifest would be better.
bcda36f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The question is not here … i can have a different php file with same git commit id than you : then : the file must be in .gitignore
bcda36f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
" i can have a different php file with same git commit id than you "
then pull, merge, problem solved...
or can you give an example where it will be a problem?
bcda36f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but sure: not adding version.php at each commit can be annoying, I agree.
making the system more granular by using the Theme manifest would take time.
What we could do, if you insist, is to quickly add a file out of the repo containing a custom asset version to generate the asset path.
bcda36f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The question is more : why not use only DB ?
After ComfortUpdate : clean assets and add 1
After manual update : inform user on manual
After Git update : git user know :)
Another solution : create a asset-version.php file with ONLY asset number (and goes out of .gitconfig like config.php)
bcda36f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just to keep a trace on it, the system now use a DB value as you asked:
3e746e1