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

reorder again #167

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

reorder again #167

wants to merge 1 commit into from

Conversation

vmario89
Copy link
Contributor

No description provided.

@vmario89 vmario89 requested a review from jsuto as a code owner August 21, 2024 12:22
@vmario89
Copy link
Contributor Author

some config settings where not taken over from /etc/config-site.php because the initial file overwrites again

Copy link
Owner

@jsuto jsuto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's a good idea to move this huge block of config above where config-site.php is read, because if PATH_PREFIX is overridden, then it won't be effective.

@vmario89
Copy link
Contributor Author

i have PATH_PREFIX='/' and the config-site.php is not read this way. Means the changed i applied in /etc/config-site.php do never apply because this config overrides it. I think thats not the wanted behaviour

Copy link
Owner

@jsuto jsuto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PATH_PREFIX is set in the 29th line. Let's say a user wants to change it, and overrides it in config-site.php. The problem is that with your change it can't be done any longer, because you move several settings before reading values from config-site.php.

@vmario89
Copy link
Contributor Author

vmario89 commented Aug 22, 2024

okay, but how to deal with customizations in custom-settings.php for the BRANDING_* settings then? the only way i have right now is changing the settings directly in /var/piler/www/config.php

that file gets overwritten by each project compilation to be updated properly by default

@jsuto
Copy link
Owner

jsuto commented Aug 22, 2024

Ehh, you are right, I see your point now. This is the catch 22. You need to defer all PATH_PREFIX related values until you read PATH_PREFIX from config-site.php, however after that you can't override them. I think I'll revert my original PR, and document it that if you changed PATH_PREFIX, then you need to fix BRANDING_*, etc. variables that depend on it. Give me a little time to think about it. @th-2021 what do you think?

@jsuto
Copy link
Owner

jsuto commented Aug 22, 2024

I think we can leave both JS_CODE and CSS_CODE as where they are now, because it's unlikely that you want to override them.

We need to move up the following:

  • BRANDING_FAVICON perhaps without $config['PATH_PREFIX']
  • SITE_LOGO_LG
  • SITE_LOGO_SM
  • all the BRANDING_* variables

However, I'd rather leave these below after we read config-site.php, unless you want to customize them as well:

  • $config['ICON_DOC'] = $config['PATH_PREFIX'] . 'assets/images/fileicons/doc.png';
  • $config['ICON_XLS'] = $config['PATH_PREFIX'] . 'assets/images/fileicons/xls.png';
  • $config['ICON_PDF'] = $config['PATH_PREFIX'] . 'assets/images/fileicons/pdf.png';
  • $config['ICON_IMAGE'] = $config['PATH_PREFIX'] . 'assets/images/fileicons/image.png';
  • $config['ICON_FILE'] = $config['PATH_PREFIX'] . 'assets/images/fileicons/file.png';

@jsuto jsuto mentioned this pull request Aug 22, 2024
@th-2021
Copy link
Contributor

th-2021 commented Aug 22, 2024 via email

@th-2021
Copy link
Contributor

th-2021 commented Aug 24, 2024

E.g. something like:
diff --git a/config.php.in b/config.php.in
index 7dd50f96..d12cebf0 100644
--- a/config.php.in
+++ b/config.php.in
@@ -354,6 +354,14 @@ $letters = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M'

define('NOW', time());

+$config['SITE_LOGO_LG'] = 'assets/images/archive-logo-lg.png';
+$config['SITE_LOGO_SM'] = 'assets/images/archive-logo-sm.png';
+
+$config['ICON_DOC'] = 'assets/images/fileicons/doc.png';
+$config['ICON_XLS'] = 'assets/images/fileicons/xls.png';
+$config['ICON_PDF'] = 'assets/images/fileicons/pdf.png';
+$config['ICON_IMAGE'] = 'assets/images/fileicons/image.png';
+$config['ICON_FILE'] = 'assets/images/fileicons/file.png';

/*

  • normally you don't have to change anything below
    @@ -389,24 +397,24 @@ $config['CSS_CODE'] = '

';

-$config['BRANDING_FAVICON'] = '
+if (!isset($config['BRANDING_FAVICON']))

  • $config['BRANDING_FAVICON'] = '

-';

  • ';

-$config['SITE_LOGO_LG'] = $config['PATH_PREFIX'] . 'assets/images/archive-logo-lg.png';
-$config['SITE_LOGO_SM'] = $config['PATH_PREFIX'] . 'assets/images/archive-logo-sm.png';
+$config['SITE_LOGO_LG'] = $config['PATH_PREFIX'] . $config['SITE_LOGO_LG'];
+$config['SITE_LOGO_SM'] = $config['PATH_PREFIX'] . $config['SITE_LOGO_SM'];

-$config['ICON_DOC'] = $config['PATH_PREFIX'] . 'assets/images/fileicons/doc.png';
-$config['ICON_XLS'] = $config['PATH_PREFIX'] . 'assets/images/fileicons/xls.png';
-$config['ICON_PDF'] = $config['PATH_PREFIX'] . 'assets/images/fileicons/pdf.png';
-$config['ICON_IMAGE'] = $config['PATH_PREFIX'] . 'assets/images/fileicons/image.png';
-$config['ICON_FILE'] = $config['PATH_PREFIX'] . 'assets/images/fileicons/file.png';
+$config['ICON_DOC'] = $config['PATH_PREFIX'] . $config['ICON_DOC'];
+$config['ICON_XLS'] = $config['PATH_PREFIX'] . $config['ICON_XLS'];
+$config['ICON_PDF'] = $config['PATH_PREFIX'] . $config['ICON_PDF'];
+$config['ICON_IMAGE'] = $config['PATH_PREFIX'] . $config['ICON_IMAGE'];
+$config['ICON_FILE'] = $config['PATH_PREFIX'] . $config['ICON_FILE'];

foreach ($config as $k => $v) {
define($k, $v);

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

Successfully merging this pull request may close these issues.

3 participants