by eggsurplus

Control what your users can access and save time, money, and frustrations. Lock down sensitive data in SugarCRM or SuiteCRM to specific groups or teams. Supports unlimited assigned users, unlimited group assignments to records, custom layouts for each group, login/sudo capabilities and much more.

Free Trial

By clicking you consent to share your profile with the developer

#2581 - Compatibility with PHP 7.0

Closed Bug? created by mminnie 7 years ago

In PHP 7.0 there is a change:

From php.net - Calls from incompatible context removed > Previously deprecated in PHP 5.6, static calls made to a non-static method with an incompatible context will now result in the called method having an undefined $this variable and a deprecation warning being issued.

When running under PHP 7.0+ the code in SecurityGroup.php breaks when making references to $this.

Example:

    function assign_default_groups(&$focus,$isUpdate)
    {
        global $sugar_config;
        global $current_user;
        if(!$isUpdate) {
            $defaultGroups = SecurityGroup::retrieveDefaultGroups(); // <-- Class function called statically
        .......

In the function retrieveDefaultGroups:

    function retrieveDefaultGroups() {

        $default_groups = array();
        $query = "select securitygroups_default.id, securitygroups.name, securitygroups_default.module, securitygroups_default.securitygroup_id "
                ."from securitygroups_default "
                ."inner join securitygroups on securitygroups_default.securitygroup_id = securitygroups.id "
                ."where securitygroups_default.deleted = 0 and securitygroups.deleted = 0";
        $GLOBALS['log']->debug("SecuritySuite: Retrieve Default Groups: $query");
        $result = $this->db->query($query);   // <-----   This produces a PHP Fatal error

Could all the references to $this->db be changed to $GLOBALS['db'] ??

  1. eggsurplus member avatar

    eggsurplus Provider Affiliate

    7 years ago

    There are definitely a number of things that would need to be cleaned up. Yes, changing to the global db would do the trick.

  2. mminnie member avatar

    mminnie

    7 years ago

    Do you have an ETA on PHP 7.x compatibility?

    Thanks as always Jason. Great product.

    • eggsurplus member avatar

      eggsurplus Provider Affiliate

      7 years ago

      Thanks! I don't have a timeline on this yet. I will follow up here when that is ready.

    • eggsurplus member avatar

      eggsurplus Provider Affiliate

      7 years ago

      Just following up on this. I am currently working on it. Target is beginning of the new year.

  3. eggsurplus member avatar

    eggsurplus Provider Affiliate

    7 years ago

    Support has been added in the soon-to-be-released 2.9.5 version of SecuritySuite starting with SuiteCRM 7.7.9 and SugarCRM CE 6.5.24.

This case is public. Please leave out any sensitive information such as URLs, passwords, etc.
Saving Comment Saving Comment...
Rating
Rating
  • "Great support, works pretty well. A few glitches here and there with Easy Theme - but thats related to the theme and not the securitysuite. Would lo..." - dgreene

    Read More Reviews