Problem/Motivation
Civictheme is not currently passing shipshape on GovCMS
[FILE] Banned PHP methods and classes
Name
[FILE] Banned PHP methods and classes
Execution time
0.00ms
System output
{"message"=>"file: /builds/xxx/yyy/themes/civictheme/src/CivicthemeColorManager.php:\n - line 330: Cannot access constant VERSION on Drupal"}
{"message"=>"file: /builds/xxx/yyy/themes/civictheme/src/CivicthemeStylesheetGenerator.php:\n - line 174: Cannot access constant EXISTS_REPLACE on Drupal\\Core\\File\\FileSystemInterface"}
{"message"=>"file: /builds/xxx/yyy/themes/civictheme/src/Settings/CivicthemeSettingsFormSectionBase.php:\n - line 146: Cannot access constant EXISTS_REPLACE on Drupal\\Core\\File\\FileSystemInterface"}
{"message"=>"file: /builds/xxx/yyy/themes/civictheme/theme-settings.provision.inc:\n - line 575: Cannot access constant EXISTS_REPLACE on Drupal\\Core\\File\\FileSystemInterface"}
Comments
Comment #2
granticusiv commentedI'm not sure if it's of any help, but I did find this regex '#Cannot access constant (\w+)#' in the ignore rules for PHP standards in GovCMS - https://projects.govcms.gov.au/GovCMS/govcms-ci/-/blob/master/config/php...
I was suddenly encountering the same "Cannot access constant ...." error for the bootstrap theme last week, but now I'm not.
Comment #3
granticusiv commentedFollowing up from my own comment above, I was triggering the "Cannot access constant" error when I switched the base theme in my sub-theme's info.yml (in my case, switching from bootstrap to bootstrap_barrio). My workaround was to create a clone of my sub-theme and base it on bootstrap_barrio and leave the origin sub-theme based on boostrap. The pipeline was fixed in the next deployment.
Comment #5
richardgaunt commentedWe have merged a fix for this issue today: https://github.com/civictheme/monorepo-drupal/pull/1314
Comment #6
richardgaunt commentedComment #8
fionamorrison23 commentedComment #9
richardgaunt commentedComment #10
richardgaunt commented