Problem/Motivation

When the Belgrade theme is installed together with the Bootstrap theme, it throws an error:
PHP Fatal error: Cannot redeclare _hex2rgb() (previously declared in /var/www/html/web/themes/contrib/belgrade/includes/html.inc:104) in /var/www/html/web/themes/contrib/bootstrap/bootstrap.theme on line 862

This happens, because both Belgrade and Bootstrap use the same function name.

Proposed resolution

The proposed fix is to add a belgrade_ namespace to this function to prevent such conflicts.

Issue fork belgrade-3563814

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

murz created an issue. See original summary.

murz’s picture

Status: Active » Needs review

Created a MR with fix, please review.

majmunbog’s picture

@murz, great work! Since we're on this subject, we could update Belgrade to use a single helper function: _belgrade_hex2rgba($color, $opacity). This function will return RGB when no opacity is provided and RGBA when it is.

  • majmunbog committed a2e159e6 on 3.x authored by murz
    fix: #3563814 Use namespaced functions _hex2rgb and _hex2rgba in the...
majmunbog’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.