Page 1 of 1

cmsms 2.2.16 PHP 8.1.0 blank screen on import design

Posted: Mon May 23, 2022 9:21 am
by SolsWebdesign
Hello,

I have CmsMadeSimple 2.2.16 running on PHP 8.1.0 and want to import a new design and am getting the following error":
PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /...../public_html/modules/DesignManager/lib/class.dm_design_reader.php:56

I think it may be PHP 8.1.0 related but since I can't downgrade this particular package I thought I'd ask here first. Anyone encountered this? Is there a ready made solution available?
kind regards,
Isolde

Re: cmsms 2.2.16 PHP 8.1.0 blank screen on import design

Posted: Mon May 23, 2022 12:07 pm
by SolsWebdesign

Code: Select all

private function _scan()
    {
        $in = array();
        $__get_in = function() use ($in) {
            global $in;
            if( ($n = count($in)) ) {
                return $in[$n-1];
            }
        };
        switch( $this->_xml->localName ) {
        case 'name':
                        if( $__get_in() != 'design' ) {
meaning that if $in (which is an empty array) should give back the fore-last value it has (not possible) and this should not be equal to the string 'design'.

Re: cmsms 2.2.16 PHP 8.1.0 blank screen on import design

Posted: Mon May 23, 2022 2:28 pm
by DIGI3
The next version will have more PHP 8.1 support, but you may wish to file this as a bug report. Code shouldn't be posted here as per forum rules, and it's less likely to be seen by the devs actually working on the core.