Jump to content

Please stop overwriting the custom.css file on upgrade


scottlf

Recommended Posts

Whenever an update takes place, the custom.css file is overwritten on all default templates.

I'm not sure why the custom.css file is given a special "custom" designation when it isn't safe from the update process. Duplicating the theme to avoid this would mean losing access to any theme compatibility updates in the future unless I manually transfer them over which defeats the usefulness of that workaround too.

Please don't overwrite this file anymore.

Link to comment
Share on other sites

or I think more accurately, don't ship an empty (apart from the comments header) custom.css file at all - it's because the updater thinks that it's a core file that it gets overwritten during an update.

I mentioned this years ago that there is absolutely no need to include the file by default - if a  user wants to create a custom.css file, then let them create the file themselves... the same as they would have to for whois.json, countries.json etc

if a user has enough knowledge to add their own CSS (even if it's a copy & paste from elsewhere), they surely have the skill to create a file on their own server. 🙄

sadly, I doubt this will happen - three years after that feature request, it still only has 2 votes - even if it got another 50 votes, that wouldn't guarantee it being added.

Link to comment
Share on other sites

Of course, in a more perfect world, somebody from WHMCS would just read this and think "hey, that's really dumb to overwrite custom overrides like that" and quietly do the necessary to rectify that behavior going forward.   I'm sure that's what used to happen way back in the mists of time.  Omitting a blank file hardly represents a major architectural change.

But apparently our reality is that even simple fixes like this need to be voted on, achieve sufficient popularity and be awarded a gold watch for long service before even being considered.  Just more cover for inaction, it looks like 😐

Link to comment
Share on other sites

10 hours ago, bear said:

Pretty simple to treat it like a typical config file in a lot of software. 
custom.css.txt (with a note to rename it)

This would make the most sense. Will show users that it can be re-named for use but also won't be overwritten.

This is one of those changes that is a no brainer and should be implemented right now without question.

Link to comment
Share on other sites

  • WHMCS Support Manager

Hi all,

Thanks for taking the time to provide your feedback.

We recommend creating a copy of the “six” theme and making your template/css customisations to that copy. This will not be overwritten during update, so your customisations will remain in place. You should consider the six theme "owned" and updated by WHMCS. The six theme is updated so there’s always a working stock theme for your reference and troubleshooting purposes.

A feature request for this kind of thing didn’t pick up much interest a few years ago, so has now been archived: https://requests.whmcs.com/topic/ignore-option-on-update

Please do submit a new request, and if there’s more demand this time round, we can potentially consider it for the future.

Link to comment
Share on other sites

51 minutes ago, WHMCS John said:

A feature request for this kind of thing didn’t pick up much interest a few years ago, so has now been archived: https://requests.whmcs.com/topic/ignore-option-on-update

Please do submit a new request, and if there’s more demand this time round, we can potentially consider it for the future.

Always the same tune, John. You tell members/users to go find the requests, which is far removed from the flow of conversation and sees little participation as a result. It's where ideas go to die ™️

To have that be useful, it should at least be clearly linked to here in the community, and share the community login. It would be helpful if it was simpler to navigate and find what you need and so on. Before you say it, I know, I should start a request in the requests system, to update the requests system. 😉 

Link to comment
Share on other sites

Feature requests don't get taken seriously now even if they do pick up interest, it is at the point that the entire feature request thing has lost the interest of the majority of your client base.

Some are 7+ years old with a LOT of up votes (considering the very small pool of people active on the requests site) that have not even been acknowledged by WHMCS in any meaningful way.

The obvious solution to this problem is NOT to get in to the habit of keeping a copy of the six theme as any important changes will then likely be missed as that bad habit forms, the proper solution as implemented in the majority of serious projects is the ability to either point at a custom css file via the web ui so theme: six Custom css: template/custom/mycustom.css

 

I might put in a feature request to abolish the feature requests section and start it again with a fresh clean slate and invite the entire customer base to participate again with the promise that WHMCS will acknowledge and make final decisions within 3 months of XX threshold being reached, then I will check back on this request in 2025 🙂

Edited by backtogeek
Link to comment
Share on other sites

Sigh, whatever.

I don't customize the template except for hiding a bunch of links in the navigation. I'm not running a diff to migrate the changes into my own custom template every time a x.x.1 weekly security vulnerability patch comes out that I need to rush to deploy.

Link to comment
Share on other sites

On 2/7/2020 at 5:26 AM, WHMCS John said:

We recommend creating a copy of the “six” theme

Why make more work for your customers though? Seriously?

This is the point of custom.css , to have that one file that's designed for the customer alone. In other words, as the OP posted please stop overwriting it!

A 'feature request' really shouldn't be needed for this, that's just ridiculous

Link to comment
Share on other sites

I have to agree with everyone else on this.  I don't moan a lot about WHMCS but this is just silly.  The whole point of the custom.css file is for custom css.  To then overwrite that on an upgrade is frankly ridiculous.

Link to comment
Share on other sites

https://developers.whmcs.com/themes/css-styling/

Quote

If you want to make changes to any of the CSS that is applied by default, we recommend making those customisations inside of the /css/custom.css file.

This file is included after styles.css allowing you to override any of the CSS defined within it and will not be affected by future updates to the WHMCS software.

 

Link to comment
Share on other sites

3 minutes ago, bear said:

Me? I was quoting the WHMCS documentation, to illustrate that *they* state it won't be overwritten, even though it's been doing exactly that.

Oh, sorry... ok, but the question still remains - if a template will be updated do they put the empty 'custom.css' there as well, or the update package doesn't include THIS file?

Link to comment
Share on other sites

25 minutes ago, indy0077 said:

if a template will be updated do they put the empty 'custom.css' there as well, or the update package doesn't include THIS file?

if you don't rename the Six template, then the updater will overwrite the custom.css file with it's blank equivalent... though it should warn you first to take a backup.

if you rename the Six template, and use a custom.css, then the updater won't touch it... on the other hand, you then have to compare the rest of your templates with the latest release for the changes...

damned if you do, damned if you don't.

Link to comment
Share on other sites

5 minutes ago, brian! said:

if you don't rename the Six template, then the updater will overwrite the custom.css file with it's blank equivalent... though it should warn you first to take a backup.

if you rename the Six template, and use a custom.css, then the updater won't touch it... on the other hand, you then have to compare the rest of your templates with the latest release for the changes...

damned if you do, damned if you don't.

This is a question for WHMCS staff and developers: Is that so complicated to "remove" the 'custom.css' from the update package and save time and work to "YOUR VALUABLE CUSTOMERS???"

Edited by indy0077
Link to comment
Share on other sites

  • WHMCS Support Manager

Hi all,

Thanks for sharing your passionate opinions on this matter.

The overrides.css file is provided in the six template we distribute and "own" as an example of the most effective way to make css customizations to your custom templates based upon it.

Step 1 of the template customisation documentation is to create a copy of the six template. You can then make any changes to the custom.css file in the duplicated template's directory. Eg. /templates/custom_dir/css/custom.css.

We do not recommend or document making changes to files in the ~/six directory. As Brian pointed out, you will be warned about this during the auto-update.

There are a couple of benefits to this; by owning and updating the six template with each release, it will always work with the latest features, it's available as a fallback in the event of custom templates causing a problem, and facilitates more effective troubleshooting of technical problems.

To make merging template changes take no more than a few minutes, we recommend using version control. This is something we do for our own template customizations: https://blog.whmcs.com/112975/customising-templates-the-easy-way

I'm interested to hear constructive thoughts on any problems that copying the six template and making your modifications there poses to your operations and procedures.

Could we clarify the template customisation docs or comments in the /templates/six/css/custom.css file at all? As it sounds like the current wording may giving the misleading impression that the ~/six files are intended to be modified?

 

Link to comment
Share on other sites

My short answer:

 

I only want to change a couple things in the CSS. I don’t want to maintain and diff an entire template every time I update for a small security patch.

Perhaps a “custom css” field in the admin area would be a better fit for this. 

Link to comment
Share on other sites

  • 4 weeks later...

that is a completely OTT and ridiculous workaround John, and creates even more problems. We then have to manually maintain and update a separate template just for the sake of some simple css changes.

Why do the docs state that the custom.css file does not get overwritten when this is not true and you are overwriting it and destroying peoples customisations.

This would be such a trivial thing to simply remove that file so it doesn't get overwritten, or as has been mentioned above, a global custom.css file instead.

Link to comment
Share on other sites

On 3/17/2020 at 4:57 AM, snake said:

that is a completely OTT and ridiculous workaround John, and creates even more problems. We then have to manually maintain and update a separate template just for the sake of some simple css changes.

Why do the docs state that the custom.css file does not get overwritten when this is not true and you are overwriting it and destroying peoples customisations.

This would be such a trivial thing to simply remove that file so it doesn't get overwritten, or as has been mentioned above, a global custom.css file instead.

Honestly it's time to just give it up. @WHMCS John even made this thread not appear for logged out users of the community. The users have no say in WHMCS, and that's just what we have to accept.

Link to comment
Share on other sites

13 hours ago, scottlf said:

even made this thread not appear for logged out users of the community.

I think the entire "Feedback" subforum is visible to members only... though it's a pretty redundant feature of this place anyway in my opinion.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated