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

Fix #5701 with SugarTheme Enhancement #6380

Open
wants to merge 110 commits into
base: develop
Choose a base branch
from

Conversation

matthewpoer
Copy link
Contributor

@matthewpoer matthewpoer commented Oct 4, 2018

Custom CSS generated for the SuiteP theme was being ignored due to the subTheme system. This enhancement resolves by self-referencing for the current "primary" theme, then descending to get any files for the subTheme.

Description

Existing customizations from prior versions of Sugar/Suite are using this architecture and it should continue to be supported, while also supporting extra CSS for the Dawn/Dark/etc. subThemes.

Issue logged as #5701

How To Test This

Install a custom CSS file in custom/themes/SuiteP/css/style.css that does something obvious, e.g.

h2.module-title-text {
  font-weight: bold;
  color: pink;
}

QRR and notice that the change isn't seen. Apply the patch and the change will appear because this file is found and used.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Final checklist

  • My code follows the code style of this project found here.
  • My change requires a change to the documentation.
  • I have read the How to Contribute guidelines.

isleshocky77 and others added 5 commits February 20, 2018 14:36
Custom CSS generated for the SuiteP theme was being ignored due to the subTheme system. This enhancement resolves by self-referencing for the current "primary" theme, then descending to get any files for the subTheme.
@codecov-io
Copy link

Codecov Report

Merging #6380 into develop will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #6380      +/-   ##
===========================================
+ Coverage     7.23%    7.23%   +<.01%     
===========================================
  Files         3400     3400              
  Lines       332825   332828       +3     
===========================================
+ Hits         24078    24086       +8     
+ Misses      308747   308742       -5
Impacted Files Coverage Δ
include/SugarTheme/SugarTheme.php 57.7% <100%> (+1.64%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update acf2960...79ceffd. Read the comment docs.

@jack7anderson7 jack7anderson7 added the PR:Community Contribution These are contribution made by the community label Dec 3, 2018
@@ -965,12 +965,21 @@ protected function _getImageFileName(
* @param bool $returnURL if true, returns URL with unique image mark, otherwise returns path to the file
* @return string path of css file to include
*/
public function getCSSURL($cssFileName, $returnURL = true)
public function getCSSURL($cssFileName, $returnURL = true, $skipSubTheme = FALSE)
Copy link
Contributor

Choose a reason for hiding this comment

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

I can not find any usages of third parameter $skipSubTheme. Is this function still works properly if I call it and pass true as $skipSubTheme value? Can I Test is some way? I think this function needs a unit and/or acceptance test to see it works properly in each calling situation.
Also: FALSE should be lowercase as it is in PSR standards what we use:
https://www.php-fig.org/psr/psr-2/#25-keywords-and-truefalsenull

Copy link
Contributor

Choose a reason for hiding this comment

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

@gymad The third parameter is used in the following # 970 line?

Copy link
Contributor

Choose a reason for hiding this comment

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

@samus-aran Sorry, I was not specific enough. I meant I can not find a single call in the codebase something like this:

$theme->getCSSURL($cssFile, $retUrl, $thirdParameterHere); // "usages of third parameter"

@gymad gymad added the Status:Requires Automated Tests Suggestion to OP to provide automated testing (unit, or acceptance) label Dec 17, 2018
Dillon-Brown and others added 21 commits January 2, 2019 10:02
* Update command to allow for cache directory specified in config
* Remove warnings/errors when no cached directory present
* Update to have namespace "cache" so we can add other cache commands later
  * Leave alias for current command
* Use provided toolsets required by robo for implementation
* Print cleaned directories
* Confirm before cleaning directory
  * Allow for force override
…-notes

# Conflicts:
#	modules/Campaigns/Campaign.php
#	modules/Campaigns/views/view.detail.php
#	modules/Notes/vardefs.php
…gn-notes

Add ability to have Notes on a Campaign
…e-command-config-cache-dir

Allow for clean cache command to use config'd cache_dir (plus clean up)
connorshea and others added 26 commits October 17, 2019 09:52
As far as I've been able to tell, this code is entirely unused. So I've removed it.
…l-view-smarty

Remove dead code: Re:Remastered
This was only ever used as part of HTMLPurifier (as an experimental
parser), as far as I can tell. Since HTMLPurifier is no longer vendored
in the repository, this library no longer needs to be vendored either.
Smarty is included via Composer now, so these files can be removed. If
anyone is requiring these files in their custom code, they
should make sure to remove those requires.

All Smarty plugins remain as-is.
The XHProf project has been abandoned for 4 years, and
the version vendored here is much older than even that. It's
undocumented, unmaintained, and it doesn't seem like it even works
on PHP 7.x.

"The best way to choose what to keep and what to throw away
is to take each item in one’s hand and ask: 'Does this spark joy?'
If it does, keep it. If not, dispose of it."

- Marie Kondō
It's not used anywhere else in the codebase besides the test
suite, should be safe to remove.
These have been deprecated for over six years now.

There was only one use of encodeReal, so I've replaced it.
This leaves getHelper() for now because it's still used in a
few places. As far as I can tell, all of these have been deprecated
since at  least the fork from SugarCRM.
None of the removed functions are being used elsewhere in the codebase.
This code doesn't do anything and hasn't been used for a long time.

Also removes the test for it.
This has been deprecated for a long time and is unused.
…d-sugar-date-time-function

Remove get_day_by_index_this_year from SugarDateTime.
…dundant-http-function

Remove remove_redundant_http() from Account.
…d-call-helper-function

Remove deprecated getReminderTime function in CallHelper.
…d-code-from-dbmanager

Remove unused, deprecated functions from DBManager.php.
…d-json-functions

Remove deprecated JSON functions encodeReal() and decodeReal()
…d-encrypt-function

Remove deprecated encrypt_password function for User.
…d-smarty

Remove all deprecated Smarty files.
It's been deprecated since SuiteCRM's initial commit and a grep
for load_menu doesn't return anything, so it doesn't seem to be used
anywhere.
Remove get_admin_modules_for_user, get_theme_display, get_themes,
and isValidId.

These are all deprecated and unused.
…d-functions

Remove deprecated functions from utils.php.
…d-load-menu-function

Remove the deprecated load_menu() function in utils.php
@Mac-Rae Mac-Rae removed the Status:Requires Updates Issues & PRs which requires input or update from the author label Feb 7, 2020
@SuiteBot
Copy link

SuiteBot commented Aug 27, 2020

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR:Community Contribution These are contribution made by the community Status:Requires Automated Tests Suggestion to OP to provide automated testing (unit, or acceptance)
Projects
None yet
Development

Successfully merging this pull request may close these issues.