MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005805ATutorThemepublic2017-09-23 13:252017-09-24 17:40
Reportergreg 
Assigned Togreg 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version 
Target Version2.2.3Fixed in Version2.2.3 
Summary0005805: Savant assign() breaks php7
DescriptionWith PHP7, Savant is not longer able to assign the top_level_pages to $this.
Steps To ReproduceProblem seems to originate at:
https://github.com/atutor/ATutor/blob/master/include/classes/Savant2/Savant2.php#L1036 [^]
Additional Informationreplace with same function from Savant3
    public function assign()
    {
        // get the arguments; there may be 1 or 2.
        $arg0 = @func_get_arg(0);
        $arg1 = @func_get_arg(1);
        
        // assign from object
        if (is_object($arg0)) {
            // assign public properties
            foreach (get_object_vars($arg0) as $key => $val) {
                // can't assign to __config
                if ($key != '__config') {
                    $this->$key = $val;
                }
            }
            return true;
        }
        
        // assign from associative array
        if (is_array($arg0)) {
            foreach ($arg0 as $key => $val) {
                // can't assign to __config
                if ($key != '__config') {
                    $this->$key = $val;
                }
            }
            return true;
        }
        
        // assign by name and value (can't assign to __config).
        if (is_string($arg0) && func_num_args() > 1 && $arg0 != '__config') {
            $this->$arg0 = $arg1;
            return true;
        }
        
        // $arg0 was not object, array, or string.
        return false;
    }
TagsNo tags attached.
Affects versionSVN
SVN Revision#25b8b78
Attached Files

- Relationships

-  Notes
(0007651)
greg (administrator)
2017-09-24 17:40

Replaced assign() function with the one from Savant 3 for php7 compatibility

- Issue History
Date Modified Username Field Change
2017-09-23 13:25 greg New Issue
2017-09-24 17:40 greg SVN Revision# => 25b8b78
2017-09-24 17:40 greg Note Added: 0007651
2017-09-24 17:40 greg Status new => resolved
2017-09-24 17:40 greg Fixed in Version => 2.2.3
2017-09-24 17:40 greg Resolution open => fixed
2017-09-24 17:40 greg Assigned To => greg


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker